diff options
Diffstat (limited to 'llvm/test/Transforms/ConstantHoisting/ARM')
8 files changed, 0 insertions, 517 deletions
diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/bad-cases.ll b/llvm/test/Transforms/ConstantHoisting/ARM/bad-cases.ll deleted file mode 100644 index 315e69998c6..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/bad-cases.ll +++ /dev/null @@ -1,140 +0,0 @@ -; RUN: opt -consthoist -S < %s | FileCheck %s -target triple = "thumbv6m-none-eabi" - -; Allocas in the entry block get handled (for free) by -; prologue/epilogue. Elsewhere they're fair game though. -define void @avoid_allocas() { -; CHECK-LABEL: @avoid_allocas -; CHECK: %addr1 = alloca i8, i32 1000 -; CHECK: %addr2 = alloca i8, i32 1020 - - %addr1 = alloca i8, i32 1000 - %addr2 = alloca i8, i32 1020 - br label %elsewhere - -elsewhere: -; CHECK: [[BASE:%.*]] = bitcast i32 1000 to i32 -; CHECK: alloca i8, i32 [[BASE]] -; CHECK: [[NEXT:%.*]] = add i32 [[BASE]], 20 -; CHECK: alloca i8, i32 [[NEXT]] - - %addr3 = alloca i8, i32 1000 - %addr4 = alloca i8, i32 1020 - - ret void -} - -; The case values of switch instructions are required to be constants. -define void @avoid_switch(i32 %in) { -; CHECK-LABEL: @avoid_switch -; CHECK: switch i32 %in, label %default [ -; CHECK: i32 1000, label %bb1 -; CHECK: i32 1020, label %bb2 -; CHECK: ] - - switch i32 %in, label %default - [ i32 1000, label %bb1 - i32 1020, label %bb2 ] - -bb1: - ret void - -bb2: - ret void - -default: - ret void -} - -; We don't want to convert constant divides because the benefit from converting -; them to a mul in the backend is larget than constant materialization savings. -define void @signed_const_division(i32 %in1, i32 %in2, i32* %addr) { -; CHECK-LABEL: @signed_const_division -; CHECK: %res1 = sdiv i32 %l1, 1000000000 -; CHECK: %res2 = srem i32 %l2, 1000000000 -entry: - br label %loop - -loop: - %l1 = phi i32 [%res1, %loop], [%in1, %entry] - %l2 = phi i32 [%res2, %loop], [%in2, %entry] - %res1 = sdiv i32 %l1, 1000000000 - store volatile i32 %res1, i32* %addr - %res2 = srem i32 %l2, 1000000000 - store volatile i32 %res2, i32* %addr - %again = icmp eq i32 %res1, %res2 - br i1 %again, label %loop, label %end - -end: - ret void -} - -define void @unsigned_const_division(i32 %in1, i32 %in2, i32* %addr) { -; CHECK-LABEL: @unsigned_const_division -; CHECK: %res1 = udiv i32 %l1, 1000000000 -; CHECK: %res2 = urem i32 %l2, 1000000000 - -entry: - br label %loop - -loop: - %l1 = phi i32 [%res1, %loop], [%in1, %entry] - %l2 = phi i32 [%res2, %loop], [%in2, %entry] - %res1 = udiv i32 %l1, 1000000000 - store volatile i32 %res1, i32* %addr - %res2 = urem i32 %l2, 1000000000 - store volatile i32 %res2, i32* %addr - %again = icmp eq i32 %res1, %res2 - br i1 %again, label %loop, label %end - -end: - ret void -} - -;PR 28282: even when data type is larger than 64-bit, the bit width of the -;constant operand could be smaller than 64-bit. In this case, there is no -;benefit to hoist the constant. -define i32 @struct_type_test(i96 %a0, i96 %a1) { -;CHECK-LABEL: @struct_type_test -entry: -;CHECK-NOT: %const = bitcast i96 32 to i96 -;CHECK: lshr0 = lshr i96 %a0, 32 - %lshr0 = lshr i96 %a0, 32 - %cast0 = trunc i96 %lshr0 to i32 -;CHECK: lshr1 = lshr i96 %a1, 32 - %lshr1 = lshr i96 %a1, 32 - %cast1 = trunc i96 %lshr1 to i32 - %ret = add i32 %cast0, %cast1 - ret i32 %ret -} - -@exception_type = external global i8 - -; Constants in inline ASM should not be hoisted. -define i32 @inline_asm_invoke() personality i8* null { -;CHECK-LABEL: @inline_asm_invoke -;CHECK-NOT: %const = 214672 -;CHECK: %X = invoke i32 asm "bswap $0", "=r,r"(i32 214672) - %X = invoke i32 asm "bswap $0", "=r,r"(i32 214672) - to label %L unwind label %lpad -;CHECK: %Y = invoke i32 asm "bswap $0", "=r,r"(i32 214672) - %Y = invoke i32 asm "bswap $0", "=r,r"(i32 214672) - to label %L unwind label %lpad -L: - ret i32 %X -lpad: - %lp = landingpad i32 - cleanup - catch i8* @exception_type - ret i32 1 -} - -define i32 @inline_asm_call() { -;CHECK-LABEL: @inline_asm_call -;CHECK-NOT: %const = 214672 -;CHECK: %X = call i32 asm "bswap $0", "=r,r"(i32 214672) - %X = call i32 asm "bswap $0", "=r,r"(i32 214672) -;CHECK: %Y = call i32 asm "bswap $0", "=r,r"(i32 214672) - %Y = call i32 asm "bswap $0", "=r,r"(i32 214672) - ret i32 %X -} diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/const-addr-no-neg-offset.ll b/llvm/test/Transforms/ConstantHoisting/ARM/const-addr-no-neg-offset.ll deleted file mode 100644 index 80428ad1cde..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/const-addr-no-neg-offset.ll +++ /dev/null @@ -1,101 +0,0 @@ -; RUN: opt -mtriple=arm-arm-none-eabi -consthoist -S < %s | FileCheck %s -; RUN: opt -mtriple=arm-arm-none-eabi -consthoist -pgso -S < %s | FileCheck %s -check-prefix=PGSO -; RUN: opt -mtriple=arm-arm-none-eabi -consthoist -pgso=false -S < %s | FileCheck %s -check-prefix=NPGSO - -; There are different candidates here for the base constant: 1073876992 and -; 1073876996. But we don't want to see the latter because it results in -; negative offsets. - -define void @foo() #0 { -entry: -; CHECK-LABEL: @foo -; CHECK-NOT: [[CONST1:%const_mat[0-9]*]] = add i32 %const, -4 -; CHECK-LABEL: @foo_pgso - %0 = load volatile i32, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %or = or i32 %0, 1 - store volatile i32 %or, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %1 = load volatile i32, i32* inttoptr (i32 1073876996 to i32*), align 4 - %and = and i32 %1, -117506048 - store volatile i32 %and, i32* inttoptr (i32 1073876996 to i32*), align 4 - %2 = load volatile i32, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %and1 = and i32 %2, -17367041 - store volatile i32 %and1, i32* inttoptr (i32 1073876996 to i32*), align 4096 - %3 = load volatile i32, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %and2 = and i32 %3, -262145 - store volatile i32 %and2, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %4 = load volatile i32, i32* inttoptr (i32 1073876996 to i32*), align 4 - %and3 = and i32 %4, -8323073 - store volatile i32 %and3, i32* inttoptr (i32 1073876996 to i32*), align 4 - store volatile i32 10420224, i32* inttoptr (i32 1073877000 to i32*), align 8 - %5 = load volatile i32, i32* inttoptr (i32 1073876996 to i32*), align 4096 - %or4 = or i32 %5, 65536 - store volatile i32 %or4, i32* inttoptr (i32 1073876996 to i32*), align 4096 - %6 = load volatile i32, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %or6.i.i = or i32 %6, 16 - store volatile i32 %or6.i.i, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %7 = load volatile i32, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %and7.i.i = and i32 %7, -4 - store volatile i32 %and7.i.i, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %8 = load volatile i32, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %or8.i.i = or i32 %8, 2 - store volatile i32 %or8.i.i, i32* inttoptr (i32 1073881088 to i32*), align 8192 - ret void -} - -attributes #0 = { minsize norecurse nounwind optsize readnone uwtable } - -define void @foo_pgso() #1 !prof !14 { -entry: -; PGSO-LABEL: @foo_pgso -; PGSO-NOT: [[CONST2:%const_mat[0-9]*]] = add i32 %const, -4 -; NPGSO-LABEL: @foo_pgso -; NPGSO: [[CONST2:%const_mat[0-9]*]] = add i32 %const, -4 - %0 = load volatile i32, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %or = or i32 %0, 1 - store volatile i32 %or, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %1 = load volatile i32, i32* inttoptr (i32 1073876996 to i32*), align 4 - %and = and i32 %1, -117506048 - store volatile i32 %and, i32* inttoptr (i32 1073876996 to i32*), align 4 - %2 = load volatile i32, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %and1 = and i32 %2, -17367041 - store volatile i32 %and1, i32* inttoptr (i32 1073876996 to i32*), align 4096 - %3 = load volatile i32, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %and2 = and i32 %3, -262145 - store volatile i32 %and2, i32* inttoptr (i32 1073876992 to i32*), align 4096 - %4 = load volatile i32, i32* inttoptr (i32 1073876996 to i32*), align 4 - %and3 = and i32 %4, -8323073 - store volatile i32 %and3, i32* inttoptr (i32 1073876996 to i32*), align 4 - store volatile i32 10420224, i32* inttoptr (i32 1073877000 to i32*), align 8 - %5 = load volatile i32, i32* inttoptr (i32 1073876996 to i32*), align 4096 - %or4 = or i32 %5, 65536 - store volatile i32 %or4, i32* inttoptr (i32 1073876996 to i32*), align 4096 - %6 = load volatile i32, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %or6.i.i = or i32 %6, 16 - store volatile i32 %or6.i.i, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %7 = load volatile i32, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %and7.i.i = and i32 %7, -4 - store volatile i32 %and7.i.i, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %8 = load volatile i32, i32* inttoptr (i32 1073881088 to i32*), align 8192 - %or8.i.i = or i32 %8, 2 - store volatile i32 %or8.i.i, i32* inttoptr (i32 1073881088 to i32*), align 8192 - ret void -} - -attributes #1 = { norecurse nounwind readnone uwtable } ; no optsize or minsize - -!llvm.module.flags = !{!0} -!0 = !{i32 1, !"ProfileSummary", !1} -!1 = !{!2, !3, !4, !5, !6, !7, !8, !9} -!2 = !{!"ProfileFormat", !"InstrProf"} -!3 = !{!"TotalCount", i64 10000} -!4 = !{!"MaxCount", i64 10} -!5 = !{!"MaxInternalCount", i64 1} -!6 = !{!"MaxFunctionCount", i64 1000} -!7 = !{!"NumCounts", i64 3} -!8 = !{!"NumFunctions", i64 3} -!9 = !{!"DetailedSummary", !10} -!10 = !{!11, !12, !13} -!11 = !{i32 10000, i64 100, i32 1} -!12 = !{i32 999000, i64 100, i32 1} -!13 = !{i32 999999, i64 1, i32 2} -!14 = !{!"function_entry_count", i64 0} diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll b/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll deleted file mode 100644 index b7ae1ee122b..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/const-hoist-gep.ll +++ /dev/null @@ -1,42 +0,0 @@ -; RUN: opt -consthoist -consthoist-gep -S -o - %s | FileCheck %s - -target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "thumbv6m-none--musleabi" - -; Check that constant GEP expressions are rewritten to one-dimensional -; (single-index) GEPs, whose base poiner is a multi-dimensional GEP. -; CHECK-DAG: %[[C1:const[0-9]?]] = bitcast i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 11, i32 0) to i32* -; CHECK-DAG: %[[C2:const[0-9]?]] = bitcast i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 0, i32 0) to i32* - -; CHECK: store i32 undef, i32* %[[C2]], align 4 -; CHECK-NEXT: %[[BC1:[a-z0-9_]+]] = bitcast i32* %[[C2]] to i8* -; CHECK-NEXT: %[[M1:[a-z0-9_]+]] = getelementptr i8, i8* %[[BC1]], i32 4 -; CHECK-NEXT: %[[BC2:[a-z0-9_]+]] = bitcast i8* %[[M1]] to i32* -; CHECK-NEXT: store i32 undef, i32* %[[BC2]], align 4 - -; CHECK-NEXT: store i32 undef, i32* %[[C1]], align 4 -; CHECK-NEXT: %[[BC3:[a-z0-9_]+]] = bitcast i32* %[[C1]] to i8* -; CHECK-NEXT: %[[M2:[a-z0-9_]+]] = getelementptr i8, i8* %[[BC3]], i32 4 -; CHECK-NEXT: %[[BC4:[a-z0-9_]+]] = bitcast i8* %[[M2]] to i32* -; CHECK-NEXT: store i32 undef, i32* %[[BC4]], align 4 - -%0 = type { %1, %2, [9 x i16], %6, %7 } -%1 = type { i32, i32, i32, i32, i32, i32, i16, i16, i8, i8, i16, i32, i32, i16, i8, i8 } -%2 = type { i32, %3, i8, i8, i8, i8, i32, %4, %5, [16 x i8], i16, i16, i8, i8, i8, i8, i32, i32, i32 } -%3 = type { i16, i8, i8 } -%4 = type { i16, i8, i8 } -%5 = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 } -%6 = type { i8, i8 } -%7 = type { [5 x i32], [3 x i32], [6 x i32], [3 x i32], [2 x i32], [4 x i32], [3 x i32], [2 x i32], [4 x i32], [5 x i32], [3 x i32], [6 x i32], [1 x i32], i32, i32, i32, i32, i32, i32 } - -@global = external dso_local local_unnamed_addr global %0, align 4 - -define dso_local void @zot() { -bb: - store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 0, i32 0), align 4 - store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 0, i32 1), align 4 - store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 11, i32 0), align 4 - store i32 undef, i32* getelementptr inbounds (%0, %0* @global, i32 0, i32 4, i32 11, i32 1), align 4 - ret void -} - diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/gep-struct-index.ll b/llvm/test/Transforms/ConstantHoisting/ARM/gep-struct-index.ll deleted file mode 100644 index 45f4500b37c..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/gep-struct-index.ll +++ /dev/null @@ -1,37 +0,0 @@ -; RUN: opt -consthoist -S < %s | FileCheck %s -target triple = "thumbv6m-none-eabi" - -%T = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32 } - -; Indices for GEPs that index into a struct type should not be hoisted. -define i32 @test1(%T* %P) nounwind { -; CHECK-LABEL: @test1 -; CHECK: %const = bitcast i32 256 to i32 -; CHECK: %addr1 = getelementptr %T, %T* %P, i32 %const, i32 256 -; CHECK: %addr2 = getelementptr %T, %T* %P, i32 %const, i32 256 -; The first index into the pointer is hoisted, but the second one into the -; struct isn't. - %addr1 = getelementptr %T, %T* %P, i32 256, i32 256 - %tmp1 = load i32, i32* %addr1 - %addr2 = getelementptr %T, %T* %P, i32 256, i32 256 - %tmp2 = load i32, i32* %addr2 - %tmp4 = add i32 %tmp1, %tmp2 - ret i32 %tmp4 -} - diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/insertvalue.ll b/llvm/test/Transforms/ConstantHoisting/ARM/insertvalue.ll deleted file mode 100644 index 99fe7fbe22a..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/insertvalue.ll +++ /dev/null @@ -1,31 +0,0 @@ -; RUN: opt -consthoist -S < %s | FileCheck %s -target triple = "thumbv6m-none-eabi" - -%T = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, -i32, i32, i32, i32, i32, i32 } - -; The second operand of insertvalue is able to be hoisted. -define void @test1(%T %P) { -; CHECK-LABEL: @test1 -; CHECK: %const = bitcast i32 256 to i32 -; CHECK: %1 = insertvalue %T %P, i32 %const, 256 -; CHECK: %2 = insertvalue %T %P, i32 %const, 256 - %1 = insertvalue %T %P, i32 256, 256 - %2 = insertvalue %T %P, i32 256, 256 - ret void -} diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/is-legal-addressing-imm.ll b/llvm/test/Transforms/ConstantHoisting/ARM/is-legal-addressing-imm.ll deleted file mode 100644 index d9482d9a25c..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/is-legal-addressing-imm.ll +++ /dev/null @@ -1,120 +0,0 @@ -; RUN: opt -consthoist -S -o - %s | FileCheck %s -target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "thumbv6m-none--musleabi" - -; Check that for i8 type, the maximum legal offset is 31. -; Also check that an constant used as value to be stored rather than -; pointer in a store instruction is hoisted. -; CHECK: foo_i8 -; CHECK-DAG: %[[C1:const[0-9]?]] = bitcast i32 805874720 to i32 -; CHECK-DAG: %[[C2:const[0-9]?]] = bitcast i32 805874688 to i32 -; CHECK-DAG: %[[C3:const[0-9]?]] = bitcast i32 805873720 to i32 -; CHECK-DAG: %[[C4:const[0-9]?]] = bitcast i32 805873688 to i32 -; CHECK: %0 = inttoptr i32 %[[C2]] to i8* -; CHECK-NEXT: %1 = load volatile i8, i8* %0 -; CHECK-NEXT: %[[M1:const_mat[0-9]?]] = add i32 %[[C2]], 4 -; CHECK-NEXT: %2 = inttoptr i32 %[[M1]] to i8* -; CHECK-NEXT: %3 = load volatile i8, i8* %2 -; CHECK-NEXT: %[[M2:const_mat[0-9]?]] = add i32 %[[C2]], 31 -; CHECK-NEXT: %4 = inttoptr i32 %[[M2]] to i8* -; CHECK-NEXT: %5 = load volatile i8, i8* %4 -; CHECK-NEXT: %6 = inttoptr i32 %[[C1]] to i8* -; CHECK-NEXT: %7 = load volatile i8, i8* %6 -; CHECK-NEXT: %[[M3:const_mat[0-9]?]] = add i32 %[[C1]], 7 -; CHECK-NEXT: %8 = inttoptr i32 %[[M3]] to i8* -; CHECK-NEXT: %9 = load volatile i8, i8* %8 -; CHECK-NEXT: %10 = inttoptr i32 %[[C4]] to i8* -; CHECK-NEXT: store i8 %9, i8* %10 -; CHECK-NEXT: %[[M4:const_mat[0-9]?]] = add i32 %[[C4]], 31 -; CHECK-NEXT: %11 = inttoptr i32 %[[M4]] to i8* -; CHECK-NEXT: store i8 %7, i8* %11 -; CHECK-NEXT: %12 = inttoptr i32 %[[C3]] to i8* -; CHECK-NEXT: store i8 %5, i8* %12 -; CHECK-NEXT: %[[M5:const_mat[0-9]?]] = add i32 %[[C3]], 7 -; CHECK-NEXT: %13 = inttoptr i32 %[[M5]] to i8* -; CHECK-NEXT: store i8 %3, i8* %13 -; CHECK-NEXT: %[[M6:const_mat[0-9]?]] = add i32 %[[C1]], 80 -; CHECK-NEXT: %14 = inttoptr i32 %[[M6]] to i8* -; CHECK-NEXT: store i8* %14, i8** @goo - -@goo = global i8* undef - -define void @foo_i8() { -entry: - %0 = load volatile i8, i8* inttoptr (i32 805874688 to i8*) - %1 = load volatile i8, i8* inttoptr (i32 805874692 to i8*) - %2 = load volatile i8, i8* inttoptr (i32 805874719 to i8*) - %3 = load volatile i8, i8* inttoptr (i32 805874720 to i8*) - %4 = load volatile i8, i8* inttoptr (i32 805874727 to i8*) - store i8 %4, i8* inttoptr(i32 805873688 to i8*) - store i8 %3, i8* inttoptr(i32 805873719 to i8*) - store i8 %2, i8* inttoptr(i32 805873720 to i8*) - store i8 %1, i8* inttoptr(i32 805873727 to i8*) - store i8* inttoptr(i32 805874800 to i8*), i8** @goo - ret void -} - -; Check that for i16 type, the maximum legal offset is 62. -; CHECK: foo_i16 -; CHECK-DAG: %[[C1:const[0-9]?]] = bitcast i32 805874752 to i32 -; CHECK-DAG: %[[C2:const[0-9]?]] = bitcast i32 805874688 to i32 -; CHECK: %0 = inttoptr i32 %[[C2]] to i16* -; CHECK-NEXT: %1 = load volatile i16, i16* %0, align 2 -; CHECK-NEXT: %[[M1:const_mat[0-9]?]] = add i32 %[[C2]], 4 -; CHECK-NEXT: %2 = inttoptr i32 %[[M1]] to i16* -; CHECK-NEXT: %3 = load volatile i16, i16* %2, align 2 -; CHECK-NEXT: %[[M2:const_mat[0-9]?]] = add i32 %[[C2]], 32 -; CHECK-NEXT: %4 = inttoptr i32 %[[M2]] to i16* -; CHECK-NEXT: %5 = load volatile i16, i16* %4, align 2 -; CHECK-NEXT: %[[M3:const_mat[0-9]?]] = add i32 %[[C2]], 62 -; CHECK-NEXT: %6 = inttoptr i32 %[[M3]] to i16* -; CHECK-NEXT: %7 = load volatile i16, i16* %6, align 2 -; CHECK-NEXT: %8 = inttoptr i32 %[[C1]] to i16* -; CHECK-NEXT: %9 = load volatile i16, i16* %8, align 2 -; CHECK-NEXT: %[[M4:const_mat[0-9]?]] = add i32 %[[C1]], 22 -; CHECK-NEXT: %10 = inttoptr i32 %[[M4]] to i16* -; CHECK-NEXT: %11 = load volatile i16, i16* %10, align 2 - -define void @foo_i16() { -entry: - %0 = load volatile i16, i16* inttoptr (i32 805874688 to i16*), align 2 - %1 = load volatile i16, i16* inttoptr (i32 805874692 to i16*), align 2 - %2 = load volatile i16, i16* inttoptr (i32 805874720 to i16*), align 2 - %3 = load volatile i16, i16* inttoptr (i32 805874750 to i16*), align 2 - %4 = load volatile i16, i16* inttoptr (i32 805874752 to i16*), align 2 - %5 = load volatile i16, i16* inttoptr (i32 805874774 to i16*), align 2 - ret void -} - -; Check that for i32 type, the maximum legal offset is 124. -; CHECK: foo_i32 -; CHECK-DAG: %[[C1:const[0-9]?]] = bitcast i32 805874816 to i32 -; CHECK-DAG: %[[C2:const[0-9]?]] = bitcast i32 805874688 to i32 -; CHECK: %0 = inttoptr i32 %[[C2]] to i32* -; CHECK-NEXT: %1 = load volatile i32, i32* %0, align 4 -; CHECK-NEXT: %[[M1:const_mat[0-9]?]] = add i32 %[[C2]], 4 -; CHECK-NEXT: %2 = inttoptr i32 %[[M1]] to i32* -; CHECK-NEXT: %3 = load volatile i32, i32* %2, align 4 -; CHECK-NEXT: %[[M2:const_mat[0-9]?]] = add i32 %[[C2]], 124 -; CHECK-NEXT: %4 = inttoptr i32 %[[M2]] to i32* -; CHECK-NEXT: %5 = load volatile i32, i32* %4, align 4 -; CHECK-NEXT: %6 = inttoptr i32 %[[C1]] to i32* -; CHECK-NEXT: %7 = load volatile i32, i32* %6, align 4 -; CHECK-NEXT: %[[M3:const_mat[0-9]?]] = add i32 %[[C1]], 8 -; CHECK-NEXT: %8 = inttoptr i32 %[[M3]] to i32* -; CHECK-NEXT: %9 = load volatile i32, i32* %8, align 4 -; CHECK-NEXT: %[[M4:const_mat[0-9]?]] = add i32 %[[C1]], 12 -; CHECK-NEXT: %10 = inttoptr i32 %[[M4]] to i32* -; CHECK-NEXT: %11 = load volatile i32, i32* %10, align 4 - -define void @foo_i32() { -entry: - %0 = load volatile i32, i32* inttoptr (i32 805874688 to i32*), align 4 - %1 = load volatile i32, i32* inttoptr (i32 805874692 to i32*), align 4 - %2 = load volatile i32, i32* inttoptr (i32 805874812 to i32*), align 4 - %3 = load volatile i32, i32* inttoptr (i32 805874816 to i32*), align 4 - %4 = load volatile i32, i32* inttoptr (i32 805874824 to i32*), align 4 - %5 = load volatile i32, i32* inttoptr (i32 805874828 to i32*), align 4 - ret void -} - diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/lit.local.cfg b/llvm/test/Transforms/ConstantHoisting/ARM/lit.local.cfg deleted file mode 100644 index 236e1d34416..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/lit.local.cfg +++ /dev/null @@ -1,2 +0,0 @@ -if not 'ARM' in config.root.targets: - config.unsupported = True diff --git a/llvm/test/Transforms/ConstantHoisting/ARM/same-offset-multi-types.ll b/llvm/test/Transforms/ConstantHoisting/ARM/same-offset-multi-types.ll deleted file mode 100644 index 8102af329b7..00000000000 --- a/llvm/test/Transforms/ConstantHoisting/ARM/same-offset-multi-types.ll +++ /dev/null @@ -1,44 +0,0 @@ -; RUN: opt -consthoist -consthoist-gep -S -o - %s | FileCheck %s - -target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64" -target triple = "thumbv6m-none--musleabi" - -; Check that for the same offset from the base constant, different types are materialized separately. -; CHECK: %const = bitcast %5** getelementptr inbounds (%0, %0* @global, i32 0, i32 2, i32 0) to %5** -; CHECK: %tmp = load %5*, %5** %const, align 4 -; CHECK: %base_bitcast = bitcast %5** %const to i8* -; CHECK: %mat_gep = getelementptr i8, i8* %base_bitcast, i32 0 -; CHECK: %mat_bitcast = bitcast i8* %mat_gep to %4* -; CHECK: tail call void undef(%5* nonnull %tmp, %4* %mat_bitcast) - -%0 = type { [16 x %1], %2, %4, [16 x %5], %6, %7, i32, [4 x i32], [8 x %3], i8, i8, i8, i8, i8, i8, i8, %8, %11, %11*, i32, i16, i8, i8, i8, i8, i8, i8, [15 x i16], i8, i8, [23 x %12], i8, i8*, i8, %13, i8, i8 } -%1 = type { i32, i32, i8, i8, i8, i8, i8, i8, i8, i8 } -%2 = type { %3*, i16, i16, i16 } -%3 = type { [4 x i32] } -%4 = type { %5*, %5*, i8 } -%5 = type { [4 x i32], i8*, i8, i8 } -%6 = type { i8, [4 x i32] } -%7 = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 } -%8 = type { [16 x %9], %9*, %9*, %9*, %9*, %11, %11, %11, i8, i8, i8, i8 } -%9 = type { %1, %11, %11, %9*, %9*, %10, i8, i8, i8, i8 } -%10 = type { i32, i16 } -%11 = type { %11*, %11* } -%12 = type { i8, i16, i32 } -%13 = type { i32, i32, i8 } - -@global = external dso_local global %0, align 4 - -; Function Attrs: nounwind optsize ssp -define dso_local void @zot() { -bb: - br i1 undef, label %bb2, label %bb1 - -bb1: ; preds = %bb - %tmp = load %5*, %5** getelementptr inbounds (%0, %0* @global, i32 0, i32 2, i32 0), align 4 - tail call void undef(%5* nonnull %tmp, %4* getelementptr inbounds (%0, %0* @global, i32 0, i32 2)) - unreachable - -bb2: ; preds = %bb - ret void -} - |