llvm.org GIT mirror llvm / fcb2c3c
Remove the "-promote-elements" flag. This flag is now enabled by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157925 91177308-0d34-0410-b5e6-96231b3b80d8 Nadav Rotem 7 years ago
17 changed file(s) with 25 addition(s) and 44 deletion(s). Raw diff Collapse all Expand all
17191719 const TargetData *TD;
17201720 const TargetLoweringObjectFile &TLOF;
17211721
1722 /// We are in the process of implementing a new TypeLegalization action
1723 /// which is the promotion of vector elements. This feature is under
1724 /// development. Until this feature is complete, it is only enabled using a
1725 /// flag. We pass this flag using a member because of circular dep issues.
1726 /// This member will be removed with the flag once we complete the transition.
1727 bool mayPromoteElements;
1728
17291722 /// PointerTy - The type to use for pointers, usually i32 or i64.
17301723 ///
17311724 MVT PointerTy;
19291922 if (NumElts == 1)
19301923 return LegalizeKind(TypeScalarizeVector, EltVT);
19311924
1932 // If we allow the promotion of vector elements using a flag,
1933 // then try to widen vector elements until a legal type is found.
1934 if (mayPromoteElements && EltVT.isInteger()) {
1925 // Try to widen vector elements until a legal type is found.
1926 if (EltVT.isInteger()) {
19351927 // Vectors with a number of elements that is not a power of two are always
19361928 // widened, for example <3 x float> -> <4 x float>.
19371929 if (!VT.isPow2VectorType()) {
3131 #include "llvm/Support/MathExtras.h"
3232 #include
3333 using namespace llvm;
34
35 /// We are in the process of implementing a new TypeLegalization action
36 /// - the promotion of vector elements. This feature is disabled by default
37 /// and only enabled using this flag.
38 static cl::opt
39 AllowPromoteIntElem("promote-elements", cl::Hidden, cl::init(true),
40 cl::desc("Allow promotion of integer vector element types"));
4134
4235 /// InitLibcallNames - Set default libcall names.
4336 ///
521514 /// NOTE: The constructor takes ownership of TLOF.
522515 TargetLowering::TargetLowering(const TargetMachine &tm,
523516 const TargetLoweringObjectFile *tlof)
524 : TM(tm), TD(TM.getTargetData()), TLOF(*tlof),
525 mayPromoteElements(AllowPromoteIntElem) {
517 : TM(tm), TD(TM.getTargetData()), TLOF(*tlof) {
526518 // All operations default to being supported.
527519 memset(OpActions, 0, sizeof(OpActions));
528520 memset(LoadExtActions, 0, sizeof(LoadExtActions));
828820 unsigned NElts = VT.getVectorNumElements();
829821 if (NElts != 1) {
830822 bool IsLegalWiderType = false;
831 // If we allow the promotion of vector elements using a flag,
832 // then return TypePromoteInteger on vector elements.
833823 // First try to promote the elements of integer vectors. If no legal
834824 // promotion was found, fallback to the widen-vector method.
835 if (mayPromoteElements)
836825 for (unsigned nVT = i+1; nVT <= MVT::LAST_VECTOR_VALUETYPE; ++nVT) {
837826 EVT SVT = (MVT::SimpleValueType)nVT;
838827 // Promote vectors of integers to vectors with the same number
None ; RUN: llc -mcpu=cortex-a9 -mtriple=arm-linux-unknown -promote-elements -mattr=+neon < %s | FileCheck %s
0 ; RUN: llc -mcpu=cortex-a9 -mtriple=arm-linux-unknown -mattr=+neon < %s | FileCheck %s
11
22 ; CHECK: func_4_8
33 ; CHECK: vst1.32
None ;RUN: llc < %s -march=x86 -mcpu=yonah -promote-elements -mattr=+sse2,-sse41 | FileCheck %s
0 ;RUN: llc < %s -march=x86 -mcpu=yonah -mattr=+sse2,-sse41 | FileCheck %s
11
22 ;CHECK: @max
33 ;CHECK: cmplepd
None ; RUN: llc < %s -march=x86-64 -mcpu=corei7 -promote-elements -mattr=+sse41
0 ; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+sse41
11
22 ; Make sure we are not crashing on this code.
33
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -promote-elements -mattr=-sse41
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=-sse41
11
22 target triple = "x86_64-unknown-linux-gnu"
33
0 ; A test for checking PR 9623
1 ; RUN: llc -march=x86-64 -mcpu=corei7 -promote-elements < %s | FileCheck %s
1 ; RUN: llc -march=x86-64 -mcpu=corei7 < %s | FileCheck %s
22
33 target triple = "x86_64-apple-darwin"
44
5 ; CHECK: pmulld
6 ; CHECK: paddd
7 ; CHECK-NOT: movdqa
5 ; CHECK: pmulld
6 ; CHECK: paddd
7 ; CHECK-NOT: movdqa
88 ; CHECK: ret
99
1010 define <4 x i8> @foo(<4 x i8> %x, <4 x i8> %y) {
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -promote-elements -mattr=+avx | FileCheck %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7-avx -mattr=+avx | FileCheck %s
11
22 ; AVX128 tests:
33
None ; RUN: llc < %s -march=x86-64 -mattr=+avx -asm-verbose=false -enable-unsafe-fp-math -enable-no-nans-fp-math -promote-elements | FileCheck -check-prefix=UNSAFE %s
0 ; RUN: llc < %s -march=x86-64 -mattr=+avx -asm-verbose=false -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck -check-prefix=UNSAFE %s
11
22 ; UNSAFE: maxpd:
33 ; UNSAFE: vmaxpd {{.+}}, %xmm
0 ; Test that vectors are scalarized/lowered correctly
11 ; (with both legalization methods).
2 ; RUN: llc -march=x86 -promote-elements < %s
3 ; RUN: llc -march=x86 < %s
2 ; RUN: llc -march=x86 < %s
3 ; RUN: llc -march=x86 < %s
44
55 ; A simple test to check copyToParts and copyFromParts.
66
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -promote-elements -mattr=+sse41 | FileCheck %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -mattr=+sse41 | FileCheck %s
11
22
33 ; In this test we check that sign-extend of the mask bit is performed by
0 ; Test the basic functionality of integer element promotions of different types.
11 ; This tests checks passing of arguments, loading and storing to memory and
22 ; basic arithmetic.
3 ; RUN: llc -march=x86 -promote-elements < %s
4 ; RUN: llc -march=x86-64 -promote-elements < %s
3 ; RUN: llc -march=x86 < %s
4 ; RUN: llc -march=x86-64 < %s
55
66 define <1 x i8> @test_1xi8(<1 x i8> %x, <1 x i8>* %b) {
77 %bb = load <1 x i8>* %b
None ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux < %s -promote-elements -mattr=+sse2,+sse41 | FileCheck %s
0 ; RUN: llc -mcpu=corei7 -mtriple=x86_64-linux < %s -mattr=+sse2,+sse41 | FileCheck %s
11
22 ; CHECK: func_4_8
33 ; A single memory write
None ; RUN: llc -promote-elements < %s -march=x86-64
0 ; RUN: llc < %s -march=x86-64
11
22 define<4 x i8> @func_8_64() {
33 %F = load <4 x i64>* undef
None ; RUN: llc < %s -march=x86-64 -mcpu=nehalem -asm-verbose=false -promote-elements | FileCheck %s
1 ; RUN: llc < %s -march=x86-64 -mcpu=nehalem -asm-verbose=false -enable-unsafe-fp-math -enable-no-nans-fp-math -promote-elements | FileCheck -check-prefix=UNSAFE %s
2 ; RUN: llc < %s -march=x86-64 -mcpu=nehalem -asm-verbose=false -enable-no-nans-fp-math -promote-elements | FileCheck -check-prefix=FINITE %s
0 ; RUN: llc < %s -march=x86-64 -mcpu=nehalem -asm-verbose=false | FileCheck %s
1 ; RUN: llc < %s -march=x86-64 -mcpu=nehalem -asm-verbose=false -enable-unsafe-fp-math -enable-no-nans-fp-math | FileCheck -check-prefix=UNSAFE %s
2 ; RUN: llc < %s -march=x86-64 -mcpu=nehalem -asm-verbose=false -enable-no-nans-fp-math | FileCheck -check-prefix=FINITE %s
33
44 ; Some of these patterns can be matched as SSE min or max. Some of
55 ; then can be matched provided that the operands are swapped.
None ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -promote-elements -mattr=+sse41 | FileCheck %s
0 ; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=corei7 -mattr=+sse41 | FileCheck %s
11
22 ;CHECK: vsel_float
33 ;CHECK: blendvps
None ; RUN: llc < %s -march=x86-64 -mcpu=corei7 -promote-elements -mattr=+sse41 | FileCheck %s
0 ; RUN: llc < %s -march=x86-64 -mcpu=corei7 -mattr=+sse41 | FileCheck %s
11
22 ;CHECK: load_2_i8
33 ; A single 16-bit load