aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms
diff options
context:
space:
mode:
Diffstat (limited to 'test/Transforms')
-rw-r--r--test/Transforms/ArgumentPromotion/variadic.ll2
-rw-r--r--test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll18
-rw-r--r--test/Transforms/CodeGenPrepare/overflow-intrinsics.ll74
-rw-r--r--test/Transforms/CodeGenPrepare/statepoint-relocate.ll24
-rw-r--r--test/Transforms/ConstantHoisting/X86/stackmap.ll4
-rw-r--r--test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll2
-rw-r--r--test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll2
-rw-r--r--test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll2
-rw-r--r--test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll20
-rw-r--r--test/Transforms/DeadArgElim/2013-05-17-VarargsAndBlockAddress.ll2
-rw-r--r--test/Transforms/DeadArgElim/dbginfo.ll2
-rw-r--r--test/Transforms/DeadArgElim/dead_vaargs.ll14
-rw-r--r--test/Transforms/DeadArgElim/variadic_safety.ll8
-rw-r--r--test/Transforms/DeadStoreElimination/inst-limits.ll2
-rw-r--r--test/Transforms/DeadStoreElimination/simple.ll4
-rw-r--r--test/Transforms/Float2Int/basic.ll256
-rw-r--r--test/Transforms/Float2Int/float2int-optnone.ll17
-rw-r--r--test/Transforms/Float2Int/toolarge.ll16
-rw-r--r--test/Transforms/FunctionAttrs/nocapture.ll2
-rw-r--r--test/Transforms/FunctionAttrs/readattrs.ll2
-rw-r--r--test/Transforms/GCOVProfiling/linkagename.ll2
-rw-r--r--test/Transforms/GCOVProfiling/return-block.ll4
-rw-r--r--test/Transforms/GVN/2007-07-31-NoDomInherit.ll10
-rw-r--r--test/Transforms/GVN/2008-02-12-UndefLoad.ll2
-rw-r--r--test/Transforms/GVN/2009-02-17-LoadPRECrash.ll2
-rw-r--r--test/Transforms/GVN/invariant-load.ll2
-rw-r--r--test/Transforms/GVN/pre-basic-add.ll2
-rw-r--r--test/Transforms/GVN/pre-compare.ll2
-rw-r--r--test/Transforms/GVN/rle-must-alias.ll6
-rw-r--r--test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll2
-rw-r--r--test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll2
-rw-r--r--test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll4
-rw-r--r--test/Transforms/GlobalOpt/blockaddress.ll3
-rw-r--r--test/Transforms/GlobalOpt/constantexpr-dangle.ll2
-rw-r--r--test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll12
-rw-r--r--test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll2
-rw-r--r--test/Transforms/IndVarSimplify/eliminate-max.ll2
-rw-r--r--test/Transforms/IndVarSimplify/lftr-udiv-tripcount.ll29
-rw-r--r--test/Transforms/IndVarSimplify/sink-alloca.ll4
-rw-r--r--test/Transforms/IndVarSimplify/udiv.ll2
-rw-r--r--test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll2
-rw-r--r--test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll2
-rw-r--r--test/Transforms/Inline/alloca-dbgdeclare.ll2
-rw-r--r--test/Transforms/Inline/attributes.ll50
-rw-r--r--test/Transforms/Inline/devirtualize-2.ll2
-rw-r--r--test/Transforms/Inline/frameescape.ll44
-rw-r--r--test/Transforms/Inline/ignore-debug-info.ll14
-rw-r--r--test/Transforms/Inline/inline-musttail-varargs.ll6
-rw-r--r--test/Transforms/Inline/inline_dbg_declare.ll2
-rw-r--r--test/Transforms/Inline/inline_ssp.ll8
-rw-r--r--test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll2
-rw-r--r--test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll2
-rw-r--r--test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll30
-rw-r--r--test/Transforms/InstCombine/2007-02-07-PointerCast.ll2
-rw-r--r--test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll2
-rw-r--r--test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll2
-rw-r--r--test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll2
-rw-r--r--test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll2
-rw-r--r--test/Transforms/InstCombine/2008-05-08-StrLenSink.ll2
-rw-r--r--test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll16
-rw-r--r--test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll2
-rw-r--r--test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll32
-rw-r--r--test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll2
-rw-r--r--test/Transforms/InstCombine/2012-02-13-FCmp.ll4
-rw-r--r--test/Transforms/InstCombine/alloca.ll12
-rw-r--r--test/Transforms/InstCombine/call-intrinsics.ll12
-rw-r--r--test/Transforms/InstCombine/call.ll2
-rw-r--r--test/Transforms/InstCombine/call2.ll2
-rw-r--r--test/Transforms/InstCombine/cast.ll4
-rw-r--r--test/Transforms/InstCombine/debug-line.ll4
-rw-r--r--test/Transforms/InstCombine/debuginfo.ll2
-rw-r--r--test/Transforms/InstCombine/err-rep-cold.ll4
-rw-r--r--test/Transforms/InstCombine/fprintf-1.ll22
-rw-r--r--test/Transforms/InstCombine/gc.relocate.ll6
-rw-r--r--test/Transforms/InstCombine/getelementptr.ll6
-rw-r--r--test/Transforms/InstCombine/intrinsics.ll10
-rw-r--r--test/Transforms/InstCombine/objsize-noverify.ll43
-rw-r--r--test/Transforms/InstCombine/objsize.ll37
-rw-r--r--test/Transforms/InstCombine/osx-names.ll4
-rw-r--r--test/Transforms/InstCombine/overflow.ll33
-rw-r--r--test/Transforms/InstCombine/pr2996.ll2
-rw-r--r--test/Transforms/InstCombine/pr8547.ll2
-rw-r--r--test/Transforms/InstCombine/printf-1.ll28
-rw-r--r--test/Transforms/InstCombine/printf-2.ll6
-rw-r--r--test/Transforms/InstCombine/select-crash-noverify.ll19
-rw-r--r--test/Transforms/InstCombine/select-crash.ll17
-rw-r--r--test/Transforms/InstCombine/select.ll6
-rw-r--r--test/Transforms/InstCombine/simplify-libcalls.ll2
-rw-r--r--test/Transforms/InstCombine/sprintf-1.ll22
-rw-r--r--test/Transforms/InstCombine/sqrt.ll2
-rw-r--r--test/Transforms/InstCombine/srem1.ll2
-rw-r--r--test/Transforms/InstCombine/statepoint.ll16
-rw-r--r--test/Transforms/InstCombine/urem-simplify-bug.ll2
-rw-r--r--test/Transforms/InstCombine/vec_demanded_elts.ll12
-rw-r--r--test/Transforms/InstCombine/vec_shuffle.ll8
-rw-r--r--test/Transforms/InstCombine/x86-insertps.ll117
-rw-r--r--test/Transforms/InstSimplify/undef.ll2
-rw-r--r--test/Transforms/JumpThreading/2010-08-26-and.ll2
-rw-r--r--test/Transforms/JumpThreading/assume.ll8
-rw-r--r--test/Transforms/JumpThreading/indirectbr.ll6
-rw-r--r--test/Transforms/JumpThreading/thread-loads.ll8
-rw-r--r--test/Transforms/LICM/2011-04-09-RAUW-AST.ll2
-rw-r--r--test/Transforms/LoopIdiom/debug-line.ll2
-rw-r--r--test/Transforms/LoopInterchange/interchange.ll2
-rw-r--r--test/Transforms/LoopRotate/PhiRename-1.ll2
-rw-r--r--test/Transforms/LoopRotate/dbgvalue.ll2
-rw-r--r--test/Transforms/LoopSimplify/dup-preds.ll2
-rw-r--r--test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll2
-rw-r--r--test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll2
-rw-r--r--test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll2
-rw-r--r--test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll14
-rw-r--r--test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll4
-rw-r--r--test/Transforms/LoopStrengthReduce/X86/pr17473.ll2
-rw-r--r--test/Transforms/LoopStrengthReduce/different-type-ivs.ll2
-rw-r--r--test/Transforms/LoopStrengthReduce/pr12018.ll4
-rw-r--r--test/Transforms/LoopStrengthReduce/pr18165.ll2
-rw-r--r--test/Transforms/LoopUnroll/high-cost-trip-count-computation.ll27
-rw-r--r--test/Transforms/LoopUnroll/runtime-loop.ll2
-rw-r--r--test/Transforms/LoopUnroll/runtime-loop4.ll3
-rw-r--r--test/Transforms/LoopUnroll/runtime-loop5.ll45
-rw-r--r--test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll2
-rw-r--r--test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll2
-rw-r--r--test/Transforms/LoopVectorize/dbg.value.ll2
-rw-r--r--test/Transforms/LoopVectorize/debugloc.ll2
-rw-r--r--test/Transforms/LowerExpectIntrinsic/basic.ll14
-rw-r--r--test/Transforms/LowerInvoke/2003-12-10-Crash.ll3
-rw-r--r--test/Transforms/Mem2Reg/ConvertDebugInfo.ll2
-rw-r--r--test/Transforms/Mem2Reg/ConvertDebugInfo2.ll2
-rw-r--r--test/Transforms/MemCpyOpt/form-memset.ll2
-rw-r--r--test/Transforms/NaryReassociate/nary-add.ll198
-rw-r--r--test/Transforms/ObjCARC/basic.ll44
-rw-r--r--test/Transforms/ObjCARC/contract.ll2
-rw-r--r--test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll14
-rw-r--r--test/Transforms/ObjCARC/intrinsic-use-isolated.ll2
-rw-r--r--test/Transforms/ObjCARC/intrinsic-use.ll16
-rw-r--r--test/Transforms/ObjCARC/move-and-merge-autorelease.ll2
-rw-r--r--test/Transforms/PhaseOrdering/PR6627.ll4
-rw-r--r--test/Transforms/PlaceSafepoints/basic.ll2
-rw-r--r--test/Transforms/Reassociate/looptest.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll8
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/base-pointers.ll10
-rw-r--r--test/Transforms/RewriteStatepointsForGC/basics.ll16
-rw-r--r--test/Transforms/RewriteStatepointsForGC/live-vector.ll87
-rw-r--r--test/Transforms/RewriteStatepointsForGC/liveness-basics.ll158
-rw-r--r--test/Transforms/RewriteStatepointsForGC/preprocess.ll65
-rw-r--r--test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll2
-rw-r--r--test/Transforms/RewriteStatepointsForGC/relocation.ll34
-rw-r--r--test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll2
-rw-r--r--test/Transforms/SCCP/retvalue-undef.ll2
-rw-r--r--test/Transforms/SLPVectorizer/X86/barriercall.ll2
-rw-r--r--test/Transforms/SLPVectorizer/X86/compare-reduce.ll2
-rw-r--r--test/Transforms/SLPVectorizer/X86/cross_block_slp.ll2
-rw-r--r--test/Transforms/SLPVectorizer/X86/debug_info.ll2
-rw-r--r--test/Transforms/SLPVectorizer/X86/in-tree-user.ll2
-rw-r--r--test/Transforms/SLPVectorizer/X86/multi_block.ll2
-rw-r--r--test/Transforms/SLPVectorizer/X86/pr16628.ll2
-rw-r--r--test/Transforms/SROA/ppcf128-no-fold.ll36
-rw-r--r--test/Transforms/SampleProfile/branch.ll4
-rw-r--r--test/Transforms/SampleProfile/calls.ll2
-rw-r--r--test/Transforms/SampleProfile/fnptr.ll2
-rw-r--r--test/Transforms/SampleProfile/propagate.ll2
-rw-r--r--test/Transforms/ScalarRepl/debuginfo-preserved.ll2
-rw-r--r--test/Transforms/ScalarRepl/inline-vector.ll2
-rw-r--r--test/Transforms/ScalarRepl/only-memcpy-uses.ll2
-rw-r--r--test/Transforms/ScalarRepl/phi-cycle.ll4
-rw-r--r--test/Transforms/Scalarizer/dbginfo.ll2
-rw-r--r--test/Transforms/SimplifyCFG/2007-12-21-Crash.ll4
-rw-r--r--test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll2
-rw-r--r--test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll8
-rw-r--r--test/Transforms/SimplifyCFG/UnreachableEliminate.ll4
-rw-r--r--test/Transforms/SimplifyCFG/common-dest-folding.ll4
-rw-r--r--test/Transforms/SimplifyCFG/hoist-dbgvalue.ll6
-rw-r--r--test/Transforms/SimplifyCFG/trap-debugloc.ll2
-rw-r--r--test/Transforms/SimplifyCFG/volatile-phioper.ll4
-rw-r--r--test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll18
-rw-r--r--test/Transforms/StraightLineStrengthReduce/slsr-add.ll101
-rw-r--r--test/Transforms/StraightLineStrengthReduce/slsr-gep.ll113
-rw-r--r--test/Transforms/StraightLineStrengthReduce/slsr-mul.ll92
-rw-r--r--test/Transforms/StripSymbols/2010-08-25-crash.ll2
-rw-r--r--test/Transforms/StripSymbols/strip-dead-debug-info.ll2
-rw-r--r--test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll2
191 files changed, 1989 insertions, 586 deletions
diff --git a/test/Transforms/ArgumentPromotion/variadic.ll b/test/Transforms/ArgumentPromotion/variadic.ll
index 0ae52b3..0e03882 100644
--- a/test/Transforms/ArgumentPromotion/variadic.ll
+++ b/test/Transforms/ArgumentPromotion/variadic.ll
@@ -15,7 +15,7 @@ target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind uwtable
define i32 @main(i32 %argc, i8** nocapture readnone %argv) #0 {
entry:
- tail call void (i8*, i8*, i8*, i8*, i8*, ...)* @callee_t0f(i8* undef, i8* undef, i8* undef, i8* undef, i8* undef, %struct.tt0* byval align 8 @t45)
+ tail call void (i8*, i8*, i8*, i8*, i8*, ...) @callee_t0f(i8* undef, i8* undef, i8* undef, i8* undef, i8* undef, %struct.tt0* byval align 8 @t45)
ret i32 0
}
diff --git a/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll b/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll
new file mode 100644
index 0000000..1e12c01
--- /dev/null
+++ b/test/Transforms/CodeGenPrepare/X86/memset_chk-simplify-nobuiltin.ll
@@ -0,0 +1,18 @@
+; RUN: opt -S -disable-simplify-libcalls -codegenprepare < %s | FileCheck %s
+target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
+
+; This is a workaround for PR23093: when building with -mkernel/-fno-builtin,
+; we still generate fortified library calls.
+
+; Check that we ignore two things:
+; - attribute nobuiltin
+; - TLI::has (always returns false thanks to -disable-simplify-libcalls)
+
+; CHECK-NOT: _chk
+; CHECK: call void @llvm.memset.p0i8.i64(i8* %dst, i8 0, i64 %len, i32 1, i1 false)
+define void @test_nobuiltin(i8* %dst, i64 %len) {
+ call i8* @__memset_chk(i8* %dst, i32 0, i64 %len, i64 -1) nobuiltin
+ ret void
+}
+
+declare i8* @__memset_chk(i8*, i32, i64, i64)
diff --git a/test/Transforms/CodeGenPrepare/overflow-intrinsics.ll b/test/Transforms/CodeGenPrepare/overflow-intrinsics.ll
new file mode 100644
index 0000000..1e41319
--- /dev/null
+++ b/test/Transforms/CodeGenPrepare/overflow-intrinsics.ll
@@ -0,0 +1,74 @@
+; RUN: opt -codegenprepare -S < %s | FileCheck %s
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
+target triple = "x86_64-apple-darwin10.0.0"
+
+; CHECK-LABEL: @test1(
+; CHECK: llvm.uadd.with.overflow
+; CHECK: ret i64
+define i64 @test1(i64 %a, i64 %b) nounwind ssp {
+entry:
+ %add = add i64 %b, %a
+ %cmp = icmp ult i64 %add, %a
+ %Q = select i1 %cmp, i64 %b, i64 42
+ ret i64 %Q
+}
+
+; CHECK-LABEL: @test2(
+; CHECK: llvm.uadd.with.overflow
+; CHECK: ret i64
+define i64 @test2(i64 %a, i64 %b) nounwind ssp {
+entry:
+ %add = add i64 %b, %a
+ %cmp = icmp ult i64 %add, %b
+ %Q = select i1 %cmp, i64 %b, i64 42
+ ret i64 %Q
+}
+
+; CHECK-LABEL: @test3(
+; CHECK: llvm.uadd.with.overflow
+; CHECK: ret i64
+define i64 @test3(i64 %a, i64 %b) nounwind ssp {
+entry:
+ %add = add i64 %b, %a
+ %cmp = icmp ugt i64 %b, %add
+ %Q = select i1 %cmp, i64 %b, i64 42
+ ret i64 %Q
+}
+
+; CHECK-LABEL: @test4(
+; CHECK: llvm.uadd.with.overflow
+; CHECK: extractvalue
+; CHECK: extractvalue
+; CHECK: select
+define i64 @test4(i64 %a, i64 %b, i1 %c) nounwind ssp {
+entry:
+ %add = add i64 %b, %a
+ %cmp = icmp ugt i64 %b, %add
+ br i1 %c, label %next, label %exit
+
+ next:
+ %Q = select i1 %cmp, i64 %b, i64 42
+ ret i64 %Q
+
+ exit:
+ ret i64 0
+}
+
+; CHECK-LABEL: @test5(
+; CHECK-NOT: llvm.uadd.with.overflow
+; CHECK: next
+define i64 @test5(i64 %a, i64 %b, i64* %ptr, i1 %c) nounwind ssp {
+entry:
+ %add = add i64 %b, %a
+ store i64 %add, i64* %ptr
+ %cmp = icmp ugt i64 %b, %add
+ br i1 %c, label %next, label %exit
+
+ next:
+ %Q = select i1 %cmp, i64 %b, i64 42
+ ret i64 %Q
+
+ exit:
+ ret i64 0
+}
diff --git a/test/Transforms/CodeGenPrepare/statepoint-relocate.ll b/test/Transforms/CodeGenPrepare/statepoint-relocate.ll
index 7aa526f..1baf4ab 100644
--- a/test/Transforms/CodeGenPrepare/statepoint-relocate.ll
+++ b/test/Transforms/CodeGenPrepare/statepoint-relocate.ll
@@ -5,19 +5,19 @@ target triple = "x86_64-pc-linux-gnu"
declare zeroext i1 @return_i1()
-define i32 @test_sor_basic(i32* %base) {
+define i32 @test_sor_basic(i32* %base) gc "statepoint-example" {
; CHECK: getelementptr i32, i32* %base, i32 15
; CHECK: getelementptr i32, i32* %base-new, i32 15
entry:
%ptr = getelementptr i32, i32* %base, i32 15
- %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr)
+ %tok = call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr)
%base-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4)
%ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5)
%ret = load i32, i32* %ptr-new
ret i32 %ret
}
-define i32 @test_sor_two_derived(i32* %base) {
+define i32 @test_sor_two_derived(i32* %base) gc "statepoint-example" {
; CHECK: getelementptr i32, i32* %base, i32 15
; CHECK: getelementptr i32, i32* %base, i32 12
; CHECK: getelementptr i32, i32* %base-new, i32 15
@@ -25,7 +25,7 @@ define i32 @test_sor_two_derived(i32* %base) {
entry:
%ptr = getelementptr i32, i32* %base, i32 15
%ptr2 = getelementptr i32, i32* %base, i32 12
- %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr, i32* %ptr2)
+ %tok = call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr, i32* %ptr2)
%base-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4)
%ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5)
%ptr2-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 6)
@@ -33,50 +33,50 @@ entry:
ret i32 %ret
}
-define i32 @test_sor_ooo(i32* %base) {
+define i32 @test_sor_ooo(i32* %base) gc "statepoint-example" {
; CHECK: getelementptr i32, i32* %base, i32 15
; CHECK: getelementptr i32, i32* %base-new, i32 15
entry:
%ptr = getelementptr i32, i32* %base, i32 15
- %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr)
+ %tok = call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr)
%ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5)
%base-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4)
%ret = load i32, i32* %ptr-new
ret i32 %ret
}
-define i32 @test_sor_gep_smallint([3 x i32]* %base) {
+define i32 @test_sor_gep_smallint([3 x i32]* %base) gc "statepoint-example" {
; CHECK: getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 2
; CHECK: getelementptr [3 x i32], [3 x i32]* %base-new, i32 0, i32 2
entry:
%ptr = getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 2
- %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %base, i32* %ptr)
+ %tok = call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %base, i32* %ptr)
%base-new = call [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32 %tok, i32 4, i32 4)
%ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5)
%ret = load i32, i32* %ptr-new
ret i32 %ret
}
-define i32 @test_sor_gep_largeint([3 x i32]* %base) {
+define i32 @test_sor_gep_largeint([3 x i32]* %base) gc "statepoint-example" {
; CHECK: getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 21
; CHECK-NOT: getelementptr [3 x i32], [3 x i32]* %base-new, i32 0, i32 21
entry:
%ptr = getelementptr [3 x i32], [3 x i32]* %base, i32 0, i32 21
- %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %base, i32* %ptr)
+ %tok = call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %base, i32* %ptr)
%base-new = call [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32 %tok, i32 4, i32 4)
%ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5)
%ret = load i32, i32* %ptr-new
ret i32 %ret
}
-define i32 @test_sor_noop(i32* %base) {
+define i32 @test_sor_noop(i32* %base) gc "statepoint-example" {
; CHECK: getelementptr i32, i32* %base, i32 15
; CHECK: call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5)
; CHECK: call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 6)
entry:
%ptr = getelementptr i32, i32* %base, i32 15
%ptr2 = getelementptr i32, i32* %base, i32 12
- %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr, i32* %ptr2)
+ %tok = call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %base, i32* %ptr, i32* %ptr2)
%ptr-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 5)
%ptr2-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 6)
%ret = load i32, i32* %ptr-new
diff --git a/test/Transforms/ConstantHoisting/X86/stackmap.ll b/test/Transforms/ConstantHoisting/X86/stackmap.ll
index 9df4417..b9aee6b 100644
--- a/test/Transforms/ConstantHoisting/X86/stackmap.ll
+++ b/test/Transforms/ConstantHoisting/X86/stackmap.ll
@@ -7,10 +7,10 @@ target triple = "x86_64-apple-macosx10.9.0"
define i128 @test1(i128 %a) {
; CHECK-LABEL: @test1
; CHECK: %const = bitcast i128 134646182756734033220 to i128
-; CHECK: tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 24, i128 %const)
+; CHECK: tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 1, i32 24, i128 %const)
entry:
%0 = add i128 %a, 134646182756734033220
- tail call void (i64, i32, ...)* @llvm.experimental.stackmap(i64 1, i32 24, i128 134646182756734033220)
+ tail call void (i64, i32, ...) @llvm.experimental.stackmap(i64 1, i32 24, i128 134646182756734033220)
ret i128 %0
}
diff --git a/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll b/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll
index cdd893f..9bbc275 100644
--- a/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll
+++ b/test/Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll
@@ -6,7 +6,7 @@ define internal i32 @test(i32 %A, ...) {
}
define i32 @foo() {
- %A = call i32(i32, ...)* @test(i32 1)
+ %A = call i32(i32, ...) @test(i32 1)
ret i32 %A
}
diff --git a/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll
index f049265..ab378e9 100644
--- a/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll
+++ b/test/Transforms/DeadArgElim/2007-12-20-ParamAttrs.ll
@@ -13,7 +13,7 @@ define internal zeroext i8 @foo(i8* inreg %p, i8 signext %y, ... ) nounwind {
define i32 @bar() {
; CHECK: call void @foo(i8 signext 1) [[NUW]]
- %A = call zeroext i8(i8*, i8, ...)* @foo(i8* inreg null, i8 signext 1, %struct* byval null ) nounwind
+ %A = call zeroext i8(i8*, i8, ...) @foo(i8* inreg null, i8 signext 1, %struct* byval null ) nounwind
ret i32 0
}
diff --git a/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll b/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll
index a7cfe68..48e4396 100644
--- a/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll
+++ b/test/Transforms/DeadArgElim/2008-01-16-VarargsParamAttrs.ll
@@ -23,7 +23,7 @@ define i32 @main() {
entry:
%"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
%tmp = getelementptr [4 x %struct.point], [4 x %struct.point]* @pts, i32 0, i32 0 ; <%struct.point*> [#uses=1]
- %tmp1 = call i32 (i32, ...)* @va1( i32 1, %struct.point* byval %tmp ) nounwind ; <i32> [#uses=0]
+ %tmp1 = call i32 (i32, ...) @va1( i32 1, %struct.point* byval %tmp ) nounwind ; <i32> [#uses=0]
call void @exit( i32 0 ) noreturn nounwind
unreachable
}
diff --git a/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll b/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
index 730a3f3..b834a75 100644
--- a/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
+++ b/test/Transforms/DeadArgElim/2010-04-30-DbgInfo.ll
@@ -4,10 +4,10 @@
define i8* @vfs_addname(i8* %name, i32 %len, i32 %hash, i32 %flags) nounwind ssp {
entry:
- call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !0, metadata !MDExpression())
- call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !10, metadata !MDExpression())
- call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !11, metadata !MDExpression())
- call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !12, metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !0, metadata !MDExpression()), !dbg !MDLocation(scope: !1)
+ call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !10, metadata !MDExpression()), !dbg !MDLocation(scope: !1)
+ call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !11, metadata !MDExpression()), !dbg !MDLocation(scope: !1)
+ call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !12, metadata !MDExpression()), !dbg !MDLocation(scope: !1)
; CHECK: call fastcc i8* @add_name_internal(i8* %name, i32 %hash) [[NUW:#[0-9]+]], !dbg !{{[0-9]+}}
%0 = call fastcc i8* @add_name_internal(i8* %name, i32 %len, i32 %hash, i8 zeroext 0, i32 %flags) nounwind, !dbg !13 ; <i8*> [#uses=1]
ret i8* %0, !dbg !13
@@ -17,11 +17,11 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
define internal fastcc i8* @add_name_internal(i8* %name, i32 %len, i32 %hash, i8 zeroext %extra, i32 %flags) noinline nounwind ssp {
entry:
- call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !15, metadata !MDExpression())
- call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !20, metadata !MDExpression())
- call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !21, metadata !MDExpression())
- call void @llvm.dbg.value(metadata i8 %extra, i64 0, metadata !22, metadata !MDExpression())
- call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !23, metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i8* %name, i64 0, metadata !15, metadata !MDExpression()), !dbg !MDLocation(scope: !16)
+ call void @llvm.dbg.value(metadata i32 %len, i64 0, metadata !20, metadata !MDExpression()), !dbg !MDLocation(scope: !16)
+ call void @llvm.dbg.value(metadata i32 %hash, i64 0, metadata !21, metadata !MDExpression()), !dbg !MDLocation(scope: !16)
+ call void @llvm.dbg.value(metadata i8 %extra, i64 0, metadata !22, metadata !MDExpression()), !dbg !MDLocation(scope: !16)
+ call void @llvm.dbg.value(metadata i32 %flags, i64 0, metadata !23, metadata !MDExpression()), !dbg !MDLocation(scope: !16)
%0 = icmp eq i32 %hash, 0, !dbg !24 ; <i1> [#uses=1]
br i1 %0, label %bb, label %bb1, !dbg !24
@@ -74,5 +74,5 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon
!26 = !MDLocation(line: 24, scope: !25)
!27 = !MDLocation(line: 26, scope: !25)
!28 = !MDFile(filename: "tail.c", directory: "/Users/echeng/LLVM/radars/r7927803/")
-!29 = !{i32 0}
+!29 = !{}
!30 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/test/Transforms/DeadArgElim/2013-05-17-VarargsAndBlockAddress.ll b/test/Transforms/DeadArgElim/2013-05-17-VarargsAndBlockAddress.ll
index 2321603..7552a12 100644
--- a/test/Transforms/DeadArgElim/2013-05-17-VarargsAndBlockAddress.ll
+++ b/test/Transforms/DeadArgElim/2013-05-17-VarargsAndBlockAddress.ll
@@ -19,7 +19,7 @@ l2:
; CHECK: define internal i32 @varargs_func(i8* %addr) {
define i32 @caller(i8* %addr) {
- %r = call i32 (i8*, ...)* @varargs_func(i8* %addr)
+ %r = call i32 (i8*, ...) @varargs_func(i8* %addr)
ret i32 %r
}
; CHECK: %r = call i32 @varargs_func(i8* %addr)
diff --git a/test/Transforms/DeadArgElim/dbginfo.ll b/test/Transforms/DeadArgElim/dbginfo.ll
index 462ae91..95e18e1 100644
--- a/test/Transforms/DeadArgElim/dbginfo.ll
+++ b/test/Transforms/DeadArgElim/dbginfo.ll
@@ -22,7 +22,7 @@
; Function Attrs: uwtable
define void @_Z2f2v() #0 {
entry:
- call void (i32, ...)* @_ZL2f1iz(i32 1), !dbg !15
+ call void (i32, ...) @_ZL2f1iz(i32 1), !dbg !15
ret void, !dbg !16
}
diff --git a/test/Transforms/DeadArgElim/dead_vaargs.ll b/test/Transforms/DeadArgElim/dead_vaargs.ll
index c8189c6..3754159 100644
--- a/test/Transforms/DeadArgElim/dead_vaargs.ll
+++ b/test/Transforms/DeadArgElim/dead_vaargs.ll
@@ -1,25 +1,25 @@
; RUN: opt < %s -deadargelim -S | FileCheck %s
define i32 @bar(i32 %A) {
- call void (i32, ...)* @thunk(i32 %A, i64 47, double 1.000000e+00)
- %a = call i32 (i32, ...)* @has_vastart(i32 %A, i64 47, double 1.000000e+00)
- %b = call i32 (i32, ...)* @no_vastart( i32 %A, i32 %A, i32 %A, i32 %A, i64 47, double 1.000000e+00 )
+ call void (i32, ...) @thunk(i32 %A, i64 47, double 1.000000e+00)
+ %a = call i32 (i32, ...) @has_vastart(i32 %A, i64 47, double 1.000000e+00)
+ %b = call i32 (i32, ...) @no_vastart( i32 %A, i32 %A, i32 %A, i32 %A, i64 47, double 1.000000e+00 )
%c = add i32 %a, %b
ret i32 %c
}
; CHECK-LABEL: define i32 @bar
-; CHECK: call void (i32, ...)* @thunk(i32 %A, i64 47, double 1.000000e+00)
-; CHECK: call i32 (i32, ...)* @has_vastart(i32 %A, i64 47, double 1.000000e+00)
+; CHECK: call void (i32, ...) @thunk(i32 %A, i64 47, double 1.000000e+00)
+; CHECK: call i32 (i32, ...) @has_vastart(i32 %A, i64 47, double 1.000000e+00)
; CHECK: call i32 @no_vastart(i32 %A)
declare void @thunk_target(i32 %X, ...)
define internal void @thunk(i32 %X, ...) {
- musttail call void(i32, ...)* @thunk_target(i32 %X, ...)
+ musttail call void(i32, ...) @thunk_target(i32 %X, ...)
ret void
}
; CHECK-LABEL: define internal void @thunk(i32 %X, ...)
-; CHECK: musttail call void (i32, ...)* @thunk_target(i32 %X, ...)
+; CHECK: musttail call void (i32, ...) @thunk_target(i32 %X, ...)
define internal i32 @has_vastart(i32 %X, ...) {
%valist = alloca i8
diff --git a/test/Transforms/DeadArgElim/variadic_safety.ll b/test/Transforms/DeadArgElim/variadic_safety.ll
index 15f57bc..2dac2f9 100644
--- a/test/Transforms/DeadArgElim/variadic_safety.ll
+++ b/test/Transforms/DeadArgElim/variadic_safety.ll
@@ -17,9 +17,9 @@ define internal i32 @va_func(i32 %a, i32 %b, ...) {
define i32 @call_va(i32 %in) {
%stacked = alloca i32
store i32 42, i32* %stacked
- %res = call i32(i32, i32, ...)* @va_func(i32 %in, i32 %in, [6 x i32] undef, i32* byval %stacked)
+ %res = call i32(i32, i32, ...) @va_func(i32 %in, i32 %in, [6 x i32] undef, i32* byval %stacked)
ret i32 %res
-; CHECK: call i32 (i32, i32, ...)* @va_func(i32 undef, i32 %in, [6 x i32] undef, i32* byval %stacked)
+; CHECK: call i32 (i32, i32, ...) @va_func(i32 undef, i32 %in, [6 x i32] undef, i32* byval %stacked)
}
define internal i32 @va_deadret_func(i32 %a, i32 %b, ...) {
@@ -32,7 +32,7 @@ define internal i32 @va_deadret_func(i32 %a, i32 %b, ...) {
define void @call_deadret(i32 %in) {
%stacked = alloca i32
store i32 42, i32* %stacked
- call i32 (i32, i32, ...)* @va_deadret_func(i32 undef, i32 %in, [6 x i32] undef, i32* byval %stacked)
+ call i32 (i32, i32, ...) @va_deadret_func(i32 undef, i32 %in, [6 x i32] undef, i32* byval %stacked)
ret void
-; CHECK: call void (i32, i32, ...)* @va_deadret_func(i32 undef, i32 undef, [6 x i32] undef, i32* byval %stacked)
+; CHECK: call void (i32, i32, ...) @va_deadret_func(i32 undef, i32 undef, [6 x i32] undef, i32* byval %stacked)
}
diff --git a/test/Transforms/DeadStoreElimination/inst-limits.ll b/test/Transforms/DeadStoreElimination/inst-limits.ll
index a7b0aeb..87de2ae 100644
--- a/test/Transforms/DeadStoreElimination/inst-limits.ll
+++ b/test/Transforms/DeadStoreElimination/inst-limits.ll
@@ -118,7 +118,7 @@ entry:
; Insert a meaningless dbg.value intrinsic; it should have no
; effect on the working of DSE in any way.
- call void @llvm.dbg.value(metadata i32* undef, i64 0, metadata !10, metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i32* undef, i64 0, metadata !10, metadata !MDExpression()), !dbg !MDLocation(scope: !4)
; CHECK: store i32 -1, i32* @x, align 4
store i32 -1, i32* @x, align 4
diff --git a/test/Transforms/DeadStoreElimination/simple.ll b/test/Transforms/DeadStoreElimination/simple.ll
index dd1443e..2ffe053 100644
--- a/test/Transforms/DeadStoreElimination/simple.ll
+++ b/test/Transforms/DeadStoreElimination/simple.ll
@@ -3,7 +3,7 @@ target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:1
declare void @llvm.memset.p0i8.i64(i8* nocapture, i8, i64, i32, i1) nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind
-declare i8* @llvm.init.trampoline(i8*, i8*, i8*)
+declare void @llvm.init.trampoline(i8*, i8*, i8*)
define void @test1(i32* %Q, i32* %P) {
%DEAD = load i32, i32* %Q
@@ -132,7 +132,7 @@ define void @test11() {
%storage = alloca [10 x i8], align 16 ; <[10 x i8]*> [#uses=1]
; CHECK-NOT: alloca
%cast = getelementptr [10 x i8], [10 x i8]* %storage, i32 0, i32 0 ; <i8*> [#uses=1]
- %tramp = call i8* @llvm.init.trampoline( i8* %cast, i8* bitcast (void ()* @test11f to i8*), i8* null ) ; <i8*> [#uses=1]
+ call void @llvm.init.trampoline( i8* %cast, i8* bitcast (void ()* @test11f to i8*), i8* null ) ; <i8*> [#uses=1]
; CHECK-NOT: trampoline
ret void
; CHECK: ret void
diff --git a/test/Transforms/Float2Int/basic.ll b/test/Transforms/Float2Int/basic.ll
new file mode 100644
index 0000000..f4d9469
--- /dev/null
+++ b/test/Transforms/Float2Int/basic.ll
@@ -0,0 +1,256 @@
+; RUN: opt < %s -float2int -S | FileCheck %s
+
+;
+; Positive tests
+;
+
+; CHECK-LABEL: @simple1
+; CHECK: %1 = zext i8 %a to i32
+; CHECK: %2 = add i32 %1, 1
+; CHECK: %3 = trunc i32 %2 to i16
+; CHECK: ret i16 %3
+define i16 @simple1(i8 %a) {
+ %1 = uitofp i8 %a to float
+ %2 = fadd float %1, 1.0
+ %3 = fptoui float %2 to i16
+ ret i16 %3
+}
+
+; CHECK-LABEL: @simple2
+; CHECK: %1 = zext i8 %a to i32
+; CHECK: %2 = sub i32 %1, 1
+; CHECK: %3 = trunc i32 %2 to i8
+; CHECK: ret i8 %3
+define i8 @simple2(i8 %a) {
+ %1 = uitofp i8 %a to float
+ %2 = fsub float %1, 1.0
+ %3 = fptoui float %2 to i8
+ ret i8 %3
+}
+
+; CHECK-LABEL: @simple3
+; CHECK: %1 = zext i8 %a to i32
+; CHECK: %2 = sub i32 %1, 1
+; CHECK: ret i32 %2
+define i32 @simple3(i8 %a) {
+ %1 = uitofp i8 %a to float
+ %2 = fsub float %1, 1.0
+ %3 = fptoui float %2 to i32
+ ret i32 %3
+}
+
+; CHECK-LABEL: @cmp
+; CHECK: %1 = zext i8 %a to i32
+; CHECK: %2 = zext i8 %b to i32
+; CHECK: %3 = icmp slt i32 %1, %2
+; CHECK: ret i1 %3
+define i1 @cmp(i8 %a, i8 %b) {
+ %1 = uitofp i8 %a to float
+ %2 = uitofp i8 %b to float
+ %3 = fcmp ult float %1, %2
+ ret i1 %3
+}
+
+; CHECK-LABEL: @simple4
+; CHECK: %1 = zext i32 %a to i64
+; CHECK: %2 = add i64 %1, 1
+; CHECK: %3 = trunc i64 %2 to i32
+; CHECK: ret i32 %3
+define i32 @simple4(i32 %a) {
+ %1 = uitofp i32 %a to double
+ %2 = fadd double %1, 1.0
+ %3 = fptoui double %2 to i32
+ ret i32 %3
+}
+
+; CHECK-LABEL: @simple5
+; CHECK: %1 = zext i8 %a to i32
+; CHECK: %2 = zext i8 %b to i32
+; CHECK: %3 = add i32 %1, 1
+; CHECK: %4 = mul i32 %3, %2
+; CHECK: ret i32 %4
+define i32 @simple5(i8 %a, i8 %b) {
+ %1 = uitofp i8 %a to float
+ %2 = uitofp i8 %b to float
+ %3 = fadd float %1, 1.0
+ %4 = fmul float %3, %2
+ %5 = fptoui float %4 to i32
+ ret i32 %5
+}
+
+; The two chains don't interact - failure of one shouldn't
+; cause failure of the other.
+
+; CHECK-LABEL: @multi1
+; CHECK: %1 = zext i8 %a to i32
+; CHECK: %2 = zext i8 %b to i32
+; CHECK: %fc = uitofp i8 %c to float
+; CHECK: %x1 = add i32 %1, %2
+; CHECK: %z = fadd float %fc, %d
+; CHECK: %w = fptoui float %z to i32
+; CHECK: %r = add i32 %x1, %w
+; CHECK: ret i32 %r
+define i32 @multi1(i8 %a, i8 %b, i8 %c, float %d) {
+ %fa = uitofp i8 %a to float
+ %fb = uitofp i8 %b to float
+ %fc = uitofp i8 %c to float
+ %x = fadd float %fa, %fb
+ %y = fptoui float %x to i32
+ %z = fadd float %fc, %d
+ %w = fptoui float %z to i32
+ %r = add i32 %y, %w
+ ret i32 %r
+}
+
+; CHECK-LABEL: @simple_negzero
+; CHECK: %1 = zext i8 %a to i32
+; CHECK: %2 = add i32 %1, 0
+; CHECK: %3 = trunc i32 %2 to i16
+; CHECK: ret i16 %3
+define i16 @simple_negzero(i8 %a) {
+ %1 = uitofp i8 %a to float
+ %2 = fadd fast float %1, -0.0
+ %3 = fptoui float %2 to i16
+ ret i16 %3
+}
+
+; CHECK-LABEL: @simple_negative
+; CHECK: %1 = sext i8 %call to i32
+; CHECK: %mul1 = mul i32 %1, -3
+; CHECK: %2 = trunc i32 %mul1 to i8
+; CHECK: %conv3 = sext i8 %2 to i32
+; CHECK: ret i32 %conv3
+define i32 @simple_negative(i8 %call) {
+ %conv1 = sitofp i8 %call to float
+ %mul = fmul float %conv1, -3.000000e+00
+ %conv2 = fptosi float %mul to i8
+ %conv3 = sext i8 %conv2 to i32
+ ret i32 %conv3
+}
+
+;
+; Negative tests
+;
+
+; CHECK-LABEL: @neg_multi1
+; CHECK: %fa = uitofp i8 %a to float
+; CHECK: %fc = uitofp i8 %c to float
+; CHECK: %x = fadd float %fa, %fc
+; CHECK: %y = fptoui float %x to i32
+; CHECK: %z = fadd float %fc, %d
+; CHECK: %w = fptoui float %z to i32
+; CHECK: %r = add i32 %y, %w
+; CHECK: ret i32 %r
+; The two chains intersect, which means because one fails, no
+; transform can occur.
+define i32 @neg_multi1(i8 %a, i8 %b, i8 %c, float %d) {
+ %fa = uitofp i8 %a to float
+ %fc = uitofp i8 %c to float
+ %x = fadd float %fa, %fc
+ %y = fptoui float %x to i32
+ %z = fadd float %fc, %d
+ %w = fptoui float %z to i32
+ %r = add i32 %y, %w
+ ret i32 %r
+}
+
+; CHECK-LABEL: @neg_muld
+; CHECK: %fa = uitofp i32 %a to double
+; CHECK: %fb = uitofp i32 %b to double
+; CHECK: %mul = fmul double %fa, %fb
+; CHECK: %r = fptoui double %mul to i64
+; CHECK: ret i64 %r
+; The i32 * i32 = i64, which has 64 bits, which is greater than the 52 bits
+; that can be exactly represented in a double.
+define i64 @neg_muld(i32 %a, i32 %b) {
+ %fa = uitofp i32 %a to double
+ %fb = uitofp i32 %b to double
+ %mul = fmul double %fa, %fb
+ %r = fptoui double %mul to i64
+ ret i64 %r
+}
+
+; CHECK-LABEL: @neg_mulf
+; CHECK: %fa = uitofp i16 %a to float
+; CHECK: %fb = uitofp i16 %b to float
+; CHECK: %mul = fmul float %fa, %fb
+; CHECK: %r = fptoui float %mul to i32
+; CHECK: ret i32 %r
+; The i16 * i16 = i32, which can't be represented in a float, but can in a
+; double. This should fail, as the written code uses floats, not doubles so
+; the original result may be inaccurate.
+define i32 @neg_mulf(i16 %a, i16 %b) {
+ %fa = uitofp i16 %a to float
+ %fb = uitofp i16 %b to float
+ %mul = fmul float %fa, %fb
+ %r = fptoui float %mul to i32
+ ret i32 %r
+}
+
+; CHECK-LABEL: @neg_cmp
+; CHECK: %1 = uitofp i8 %a to float
+; CHECK: %2 = uitofp i8 %b to float
+; CHECK: %3 = fcmp false float %1, %2
+; CHECK: ret i1 %3
+; "false" doesn't have an icmp equivalent.
+define i1 @neg_cmp(i8 %a, i8 %b) {
+ %1 = uitofp i8 %a to float
+ %2 = uitofp i8 %b to float
+ %3 = fcmp false float %1, %2
+ ret i1 %3
+}
+
+; CHECK-LABEL: @neg_div
+; CHECK: %1 = uitofp i8 %a to float
+; CHECK: %2 = fdiv float %1, 1.0
+; CHECK: %3 = fptoui float %2 to i16
+; CHECK: ret i16 %3
+; Division isn't a supported operator.
+define i16 @neg_div(i8 %a) {
+ %1 = uitofp i8 %a to float
+ %2 = fdiv float %1, 1.0
+ %3 = fptoui float %2 to i16
+ ret i16 %3
+}
+
+; CHECK-LABEL: @neg_remainder
+; CHECK: %1 = uitofp i8 %a to float
+; CHECK: %2 = fadd float %1, 1.2
+; CHECK: %3 = fptoui float %2 to i16
+; CHECK: ret i16 %3
+; 1.2 is not an integer.
+define i16 @neg_remainder(i8 %a) {
+ %1 = uitofp i8 %a to float
+ %2 = fadd float %1, 1.25
+ %3 = fptoui float %2 to i16
+ ret i16 %3
+}
+
+; CHECK-LABEL: @neg_toolarge
+; CHECK: %1 = uitofp i80 %a to fp128
+; CHECK: %2 = fadd fp128 %1, %1
+; CHECK: %3 = fptoui fp128 %2 to i80
+; CHECK: ret i80 %3
+; i80 > i64, which is the largest bitwidth handleable by default.
+define i80 @neg_toolarge(i80 %a) {
+ %1 = uitofp i80 %a to fp128
+ %2 = fadd fp128 %1, %1
+ %3 = fptoui fp128 %2 to i80
+ ret i80 %3
+}
+
+; CHECK-LABEL: @neg_calluser
+; CHECK: sitofp
+; CHECK: fcmp
+; The sequence %1..%3 cannot be converted because %4 uses %2.
+define i32 @neg_calluser(i32 %value) {
+ %1 = sitofp i32 %value to double
+ %2 = fadd double %1, 1.0
+ %3 = fcmp olt double %2, 0.000000e+00
+ %4 = tail call double @g(double %2)
+ %5 = fptosi double %4 to i32
+ %6 = zext i1 %3 to i32
+ %7 = add i32 %6, %5
+ ret i32 %7
+}
+declare double @g(double)
diff --git a/test/Transforms/Float2Int/float2int-optnone.ll b/test/Transforms/Float2Int/float2int-optnone.ll
new file mode 100644
index 0000000..c1eeea7
--- /dev/null
+++ b/test/Transforms/Float2Int/float2int-optnone.ll
@@ -0,0 +1,17 @@
+; RUN: opt < %s -float2int -S | FileCheck %s
+;
+; Verify that pass float2int is not run on optnone functions.
+
+define i16 @simple1(i8 %a) #0 {
+; CHECK-LABEL: @simple1
+; CHECK: %1 = uitofp i8 %a to float
+; CHECK-NEXT: %2 = fadd float %1, 1.0
+; CHECK-NEXT: %3 = fptoui float %2 to i16
+; CHECK-NEXT: ret i16 %3
+ %1 = uitofp i8 %a to float
+ %2 = fadd float %1, 1.0
+ %3 = fptoui float %2 to i16
+ ret i16 %3
+}
+
+attributes #0 = { noinline optnone }
diff --git a/test/Transforms/Float2Int/toolarge.ll b/test/Transforms/Float2Int/toolarge.ll
new file mode 100644
index 0000000..b5d7781
--- /dev/null
+++ b/test/Transforms/Float2Int/toolarge.ll
@@ -0,0 +1,16 @@
+; RUN: opt < %s -float2int -float2int-max-integer-bw=256 -S | FileCheck %s
+
+; CHECK-LABEL: @neg_toolarge
+; CHECK: %1 = uitofp i80 %a to fp128
+; CHECK: %2 = fadd fp128 %1, %1
+; CHECK: %3 = fptoui fp128 %2 to i80
+; CHECK: ret i80 %3
+; fp128 has a 112-bit mantissa, which can hold an i80. But we only support
+; up to i64, so it should fail (even though the max integer bitwidth is 256).
+define i80 @neg_toolarge(i80 %a) {
+ %1 = uitofp i80 %a to fp128
+ %2 = fadd fp128 %1, %1
+ %3 = fptoui fp128 %2 to i80
+ ret i80 %3
+}
+
diff --git a/test/Transforms/FunctionAttrs/nocapture.ll b/test/Transforms/FunctionAttrs/nocapture.ll
index 23cbc85..55a3dc4 100644
--- a/test/Transforms/FunctionAttrs/nocapture.ll
+++ b/test/Transforms/FunctionAttrs/nocapture.ll
@@ -188,7 +188,7 @@ declare void @test6_1(i8* %x6_1, i8* nocapture %y6_1, ...)
; CHECK: define void @test6_2(i8* %x6_2, i8* nocapture %y6_2, i8* %z6_2)
define void @test6_2(i8* %x6_2, i8* %y6_2, i8* %z6_2) {
- call void (i8*, i8*, ...)* @test6_1(i8* %x6_2, i8* %y6_2, i8* %z6_2)
+ call void (i8*, i8*, ...) @test6_1(i8* %x6_2, i8* %y6_2, i8* %z6_2)
store i32* null, i32** @g
ret void
}
diff --git a/test/Transforms/FunctionAttrs/readattrs.ll b/test/Transforms/FunctionAttrs/readattrs.ll
index b4e904c..7f22e6f 100644
--- a/test/Transforms/FunctionAttrs/readattrs.ll
+++ b/test/Transforms/FunctionAttrs/readattrs.ll
@@ -5,7 +5,7 @@ declare void @test1_1(i8* %x1_1, i8* readonly %y1_1, ...)
; CHECK: define void @test1_2(i8* %x1_2, i8* readonly %y1_2, i8* %z1_2)
define void @test1_2(i8* %x1_2, i8* %y1_2, i8* %z1_2) {
- call void (i8*, i8*, ...)* @test1_1(i8* %x1_2, i8* %y1_2, i8* %z1_2)
+ call void (i8*, i8*, ...) @test1_1(i8* %x1_2, i8* %y1_2, i8* %z1_2)
store i32 0, i32* @x
ret void
}
diff --git a/test/Transforms/GCOVProfiling/linkagename.ll b/test/Transforms/GCOVProfiling/linkagename.ll
index 99ef08a..2244261 100644
--- a/test/Transforms/GCOVProfiling/linkagename.ll
+++ b/test/Transforms/GCOVProfiling/linkagename.ll
@@ -16,7 +16,7 @@ entry:
!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.3 (trunk 177323)", isOptimized: false, emissionKind: 0, file: !2, enums: !3, retainedTypes: !3, subprograms: !4, globals: !3, imports: !3)
!1 = !MDFile(filename: "hello.cc", directory: "/home/nlewycky")
!2 = !MDFile(filename: "hello.cc", directory: "/home/nlewycky")
-!3 = !{i32 0}
+!3 = !{}
!4 = !{!5}
!5 = !MDSubprogram(name: "foo", linkageName: "_Z3foov", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 1, file: !1, scope: !1, type: !6, function: void ()* @_Z3foov, variables: !3)
!6 = !MDSubroutineType(types: !7)
diff --git a/test/Transforms/GCOVProfiling/return-block.ll b/test/Transforms/GCOVProfiling/return-block.ll
index 0fafc55..1f1933c 100644
--- a/test/Transforms/GCOVProfiling/return-block.ll
+++ b/test/Transforms/GCOVProfiling/return-block.ll
@@ -18,13 +18,13 @@ target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind uwtable
define void @test() #0 {
entry:
- tail call void (...)* @f() #2, !dbg !14
+ tail call void (...) @f() #2, !dbg !14
%0 = load i32, i32* @A, align 4, !dbg !15
%tobool = icmp eq i32 %0, 0, !dbg !15
br i1 %tobool, label %if.end, label %if.then, !dbg !15
if.then: ; preds = %entry
- tail call void (...)* @g() #2, !dbg !16
+ tail call void (...) @g() #2, !dbg !16
br label %if.end, !dbg !16
if.end: ; preds = %entry, %if.then
diff --git a/test/Transforms/GVN/2007-07-31-NoDomInherit.ll b/test/Transforms/GVN/2007-07-31-NoDomInherit.ll
index c30a283..b2e4c64 100644
--- a/test/Transforms/GVN/2007-07-31-NoDomInherit.ll
+++ b/test/Transforms/GVN/2007-07-31-NoDomInherit.ll
@@ -151,7 +151,7 @@ entry:
bb: ; preds = %cond_next97
%tmp1 = load i32, i32* @numi ; <i32> [#uses=1]
%tmp2 = getelementptr [44 x i8], [44 x i8]* @.str43, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp3 = call i32 (i8*, ...)* @printf( i8* %tmp2, i32 %tmp1 ) ; <i32> [#uses=0]
+ %tmp3 = call i32 (i8*, ...) @printf( i8* %tmp2, i32 %tmp1 ) ; <i32> [#uses=0]
store i32 0, i32* %i
br label %bb13
@@ -231,7 +231,7 @@ bb55: ; preds = %bb49
store i32 %tmp56, i32* %num_sol
%tmp57 = getelementptr [21 x i8], [21 x i8]* @.str44, i32 0, i32 0 ; <i8*> [#uses=1]
%tmp58 = load i32, i32* %num_sol ; <i32> [#uses=1]
- %tmp59 = call i32 (i8*, ...)* @printf( i8* %tmp57, i32 %tmp58 ) ; <i32> [#uses=0]
+ %tmp59 = call i32 (i8*, ...) @printf( i8* %tmp57, i32 %tmp58 ) ; <i32> [#uses=0]
%tmp60 = load i32, i32* @counters ; <i32> [#uses=1]
%tmp61 = icmp ne i32 %tmp60, 0 ; <i1> [#uses=1]
%tmp6162 = zext i1 %tmp61 to i32 ; <i32> [#uses=1]
@@ -241,7 +241,7 @@ bb55: ; preds = %bb49
cond_true: ; preds = %bb55
store i32 0, i32* %total
%tmp64 = getelementptr [12 x i8], [12 x i8]* @.str45, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp65 = call i32 (i8*, ...)* @printf( i8* %tmp64 ) ; <i32> [#uses=0]
+ %tmp65 = call i32 (i8*, ...) @printf( i8* %tmp64 ) ; <i32> [#uses=0]
store i32 0, i32* %i
br label %bb79
@@ -250,7 +250,7 @@ bb66: ; preds = %bb79
%tmp68 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp67 ; <i32*> [#uses=1]
%tmp69 = load i32, i32* %tmp68 ; <i32> [#uses=1]
%tmp70 = getelementptr [5 x i8], [5 x i8]* @.str46, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp71 = call i32 (i8*, ...)* @printf( i8* %tmp70, i32 %tmp69 ) ; <i32> [#uses=0]
+ %tmp71 = call i32 (i8*, ...) @printf( i8* %tmp70, i32 %tmp69 ) ; <i32> [#uses=0]
%tmp72 = load i32, i32* %i ; <i32> [#uses=1]
%tmp73 = getelementptr [5 x i32], [5 x i32]* @counter, i32 0, i32 %tmp72 ; <i32*> [#uses=1]
%tmp74 = load i32, i32* %tmp73 ; <i32> [#uses=1]
@@ -273,7 +273,7 @@ bb79: ; preds = %bb66, %cond_true
bb85: ; preds = %bb79
%tmp86 = getelementptr [12 x i8], [12 x i8]* @.str47, i32 0, i32 0 ; <i8*> [#uses=1]
%tmp87 = load i32, i32* %total ; <i32> [#uses=1]
- %tmp88 = call i32 (i8*, ...)* @printf( i8* %tmp86, i32 %tmp87 ) ; <i32> [#uses=0]
+ %tmp88 = call i32 (i8*, ...) @printf( i8* %tmp86, i32 %tmp87 ) ; <i32> [#uses=0]
br label %cond_next
cond_next: ; preds = %bb85, %bb55
diff --git a/test/Transforms/GVN/2008-02-12-UndefLoad.ll b/test/Transforms/GVN/2008-02-12-UndefLoad.ll
index 8ebeb14..a1aed86 100644
--- a/test/Transforms/GVN/2008-02-12-UndefLoad.ll
+++ b/test/Transforms/GVN/2008-02-12-UndefLoad.ll
@@ -12,7 +12,7 @@ entry:
%tmp3 = or i32 %tmp2, 11 ; <i32> [#uses=1]
%tmp4 = and i32 %tmp3, -21 ; <i32> [#uses=1]
store i32 %tmp4, i32* %tmp1, align 4
- %call = call i32 (...)* @x( %struct.anon* %c ) ; <i32> [#uses=0]
+ %call = call i32 (...) @x( %struct.anon* %c ) ; <i32> [#uses=0]
ret i32 undef
}
diff --git a/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll b/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll
index 378d7e7..808f28c 100644
--- a/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll
+++ b/test/Transforms/GVN/2009-02-17-LoadPRECrash.ll
@@ -163,7 +163,7 @@ bb180: ; preds = %bb179, %bb178
br label %bb181
bb181: ; preds = %bb180, %bb170
- %13 = call %struct.rtvec_def* (i32, ...)* @gen_rtvec(i32 1, %struct.rtx_def* null) nounwind ; <%struct.rtvec_def*> [#uses=0]
+ %13 = call %struct.rtvec_def* (i32, ...) @gen_rtvec(i32 1, %struct.rtx_def* null) nounwind ; <%struct.rtvec_def*> [#uses=0]
unreachable
bb211: ; preds = %bb168, %bb167
diff --git a/test/Transforms/GVN/invariant-load.ll b/test/Transforms/GVN/invariant-load.ll
index f126458..982da8c 100644
--- a/test/Transforms/GVN/invariant-load.ll
+++ b/test/Transforms/GVN/invariant-load.ll
@@ -108,7 +108,7 @@ define i32 @test7(i1 %cnd, i32* %p) {
; CHECK-NEXT: ret i32 0
entry:
%v1 = load i32, i32* %p, !invariant.load !0
- call i32* (...)* @bar(i32* %p)
+ call i32* (...) @bar(i32* %p)
%v2 = load i32, i32* %p, !invariant.load !0
%res = sub i32 %v1, %v2
ret i32 %res
diff --git a/test/Transforms/GVN/pre-basic-add.ll b/test/Transforms/GVN/pre-basic-add.ll
index 460d1f9..fa4e2e3 100644
--- a/test/Transforms/GVN/pre-basic-add.ll
+++ b/test/Transforms/GVN/pre-basic-add.ll
@@ -6,7 +6,7 @@
define i32 @test() nounwind {
entry:
%0 = load i32, i32* @H, align 4 ; <i32> [#uses=2]
- %1 = call i32 (...)* @foo() nounwind ; <i32> [#uses=1]
+ %1 = call i32 (...) @foo() nounwind ; <i32> [#uses=1]
%2 = icmp ne i32 %1, 0 ; <i1> [#uses=1]
br i1 %2, label %bb, label %bb1
diff --git a/test/Transforms/GVN/pre-compare.ll b/test/Transforms/GVN/pre-compare.ll
index 52c6b0b..a77684a 100644
--- a/test/Transforms/GVN/pre-compare.ll
+++ b/test/Transforms/GVN/pre-compare.ll
@@ -56,7 +56,7 @@ for.cond: ; preds = %for.cond.backedge,
br i1 %cmp3, label %for.cond.backedge, label %if.end5
if.end5: ; preds = %for.cond
- %call6 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str3, i64 0, i64 0), i32 %x) nounwind
+ %call6 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str3, i64 0, i64 0), i32 %x) nounwind
br label %for.cond.backedge
for.cond.backedge: ; preds = %if.end5, %for.cond
diff --git a/test/Transforms/GVN/rle-must-alias.ll b/test/Transforms/GVN/rle-must-alias.ll
index 0d181dd..bf8b139 100644
--- a/test/Transforms/GVN/rle-must-alias.ll
+++ b/test/Transforms/GVN/rle-must-alias.ll
@@ -11,19 +11,19 @@ target triple = "i386-apple-darwin7"
define i32 @test(i32 %i) nounwind {
entry:
- %0 = tail call i32 (...)* @foo() nounwind ; <i32> [#uses=1]
+ %0 = tail call i32 (...) @foo() nounwind ; <i32> [#uses=1]
%1 = icmp eq i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %bb1, label %bb
bb: ; preds = %entry
- %2 = tail call i32 (...)* @bar() nounwind ; <i32> [#uses=0]
+ %2 = tail call i32 (...) @bar() nounwind ; <i32> [#uses=0]
%3 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
%4 = load i32, i32* %3, align 4 ; <i32> [#uses=1]
store i32 %4, i32* @G, align 4
br label %bb3
bb1: ; preds = %entry
- %5 = tail call i32 (...)* @baz() nounwind ; <i32> [#uses=0]
+ %5 = tail call i32 (...) @baz() nounwind ; <i32> [#uses=0]
%6 = getelementptr [100 x i32], [100 x i32]* @H, i32 0, i32 %i ; <i32*> [#uses=1]
%7 = load i32, i32* %6, align 4 ; <i32> [#uses=2]
store i32 %7, i32* @G, align 4
diff --git a/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll b/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
index 738ec43..781c57e 100644
--- a/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
+++ b/test/Transforms/GlobalDCE/2003-07-01-SelfReference.ll
@@ -4,7 +4,7 @@
declare i1 ()* @getfunc()
define internal i1 @testfunc() {
- %F = call i1 ()* ()* @getfunc( ) ; <i1 ()*> [#uses=1]
+ %F = call i1 ()* () @getfunc( ) ; <i1 ()*> [#uses=1]
%c = icmp eq i1 ()* %F, @testfunc ; <i1> [#uses=1]
ret i1 %c
}
diff --git a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
index cbc9c75..7a2de55 100644
--- a/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
+++ b/test/Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll
@@ -11,7 +11,7 @@ define i8 @func() {
entry:
%tmp10 = getelementptr [2 x i32], [2 x i32]* getelementptr ([6 x [2 x i32]], [6 x [2 x i32]]* @aaui1, i32 0, i32 0), i32 5, i32 1 ; <i32*> [#uses=1]
%tmp11 = load i32, i32* %tmp10, align 4 ; <i32> [#uses=1]
- %tmp12 = call i32 (...)* @func3( i32* null, i32 0, i32 %tmp11 ) ; <i32> [#uses=0]
+ %tmp12 = call i32 (...) @func3( i32* null, i32 0, i32 %tmp11 ) ; <i32> [#uses=0]
ret i8 undef
}
diff --git a/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll b/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll
index 8efd018..6933d4a 100644
--- a/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll
+++ b/test/Transforms/GlobalOpt/2009-02-15-ResolveAlias.ll
@@ -9,7 +9,7 @@ define internal void @f() {
@a = alias void ()* @f
define void @g() {
- call void()* @a()
+ call void() @a()
ret void
}
@@ -17,7 +17,7 @@ define void @g() {
; CHECK-NOT: @b
define void @h() {
- call void()* @b()
+ call void() @b()
; CHECK: call void @g
ret void
}
diff --git a/test/Transforms/GlobalOpt/blockaddress.ll b/test/Transforms/GlobalOpt/blockaddress.ll
index f7f8308..12e09fc 100644
--- a/test/Transforms/GlobalOpt/blockaddress.ll
+++ b/test/Transforms/GlobalOpt/blockaddress.ll
@@ -13,6 +13,9 @@ define void @f() {
}
define void @g() {
+entry:
+ br label %here
+
; CHECK-LABEL: @g(
here:
diff --git a/test/Transforms/GlobalOpt/constantexpr-dangle.ll b/test/Transforms/GlobalOpt/constantexpr-dangle.ll
index be13a98..fbbfe69 100644
--- a/test/Transforms/GlobalOpt/constantexpr-dangle.ll
+++ b/test/Transforms/GlobalOpt/constantexpr-dangle.ll
@@ -6,7 +6,7 @@ define internal float @foo() {
}
define float @bar() {
- %tmp1 = call float (...)* bitcast (float ()* @foo to float (...)*)( )
+ %tmp1 = call float (...) bitcast (float ()* @foo to float (...)*)( )
%tmp2 = fmul float %tmp1, 1.000000e+01 ; <float> [#uses=1]
ret float %tmp2
}
diff --git a/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll b/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
index a0b1e84..402ae8c 100644
--- a/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
+++ b/test/Transforms/IndVarSimplify/2011-11-01-lftrptr.ll
@@ -31,7 +31,8 @@ loop:
br i1 %cmp, label %loop, label %exit
exit:
- ret i8 %snext
+ %ret = phi i8 [0, %loopguard], [%snext, %loop]
+ ret i8 %ret
}
; CHECK-LABEL: @testptrptr(
@@ -56,7 +57,8 @@ loop:
br i1 %cmp, label %loop, label %exit
exit:
- ret i8 %snext
+ %ret = phi i8 [0, %loopguard], [%snext, %loop]
+ ret i8 %ret
}
; CHECK-LABEL: @testnullptrint(
@@ -86,7 +88,8 @@ loop:
br i1 %cmp, label %loop, label %exit
exit:
- ret i8 %snext
+ %ret = phi i8 [0, %loopguard], [%snext, %loop]
+ ret i8 %ret
}
; CHECK-LABEL: @testptrint(
@@ -116,7 +119,8 @@ loop:
br i1 %cmp, label %loop, label %exit
exit:
- ret i8 %snext
+ %ret = phi i8 [0, %loopguard], [%snext, %loop]
+ ret i8 %ret
}
; IV and BECount have two different pointer types here.
diff --git a/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll b/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll
index 9fb281f..faecbfb 100644
--- a/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll
+++ b/test/Transforms/IndVarSimplify/2012-07-17-lftr-undef.ll
@@ -13,7 +13,7 @@ block9: ; preds = %block9,%func_start
%undef = phi i64 [ %next_undef, %block9 ], [ undef, %func_start ]
%iter = phi i64 [ %next_iter, %block9 ], [ 1, %func_start ]
%next_iter = add nsw i64 %iter, 1
- %0 = tail call i32 (i8*, ...)* @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef)
+ %0 = tail call i32 (i8*, ...) @printf(i8* noalias nocapture getelementptr inbounds ([6 x i8], [6 x i8]* @.str3, i64 0, i64 0), i64 %next_iter, i64 %undef)
%next_undef = add nsw i64 %undef, 1
%_tmp_3 = icmp slt i64 %next_iter, 100
br i1 %_tmp_3, label %block9, label %exit
diff --git a/test/Transforms/IndVarSimplify/eliminate-max.ll b/test/Transforms/IndVarSimplify/eliminate-max.ll
index 125ed74..5831b93 100644
--- a/test/Transforms/IndVarSimplify/eliminate-max.ll
+++ b/test/Transforms/IndVarSimplify/eliminate-max.ll
@@ -45,7 +45,7 @@ bb14: ; preds = %bb11, %bb7
br i1 %t20, label %bb1, label %bb21
bb21: ; preds = %bb14
- %t22 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind
+ %t22 = call i32 (i8*, ...) @printf(i8* noalias getelementptr inbounds ([4 x i8], [4 x i8]* @0, i32 0, i32 0), i32 %t18) nounwind
ret i32 0
}
diff --git a/test/Transforms/IndVarSimplify/lftr-udiv-tripcount.ll b/test/Transforms/IndVarSimplify/lftr-udiv-tripcount.ll
new file mode 100644
index 0000000..8a1bb07
--- /dev/null
+++ b/test/Transforms/IndVarSimplify/lftr-udiv-tripcount.ll
@@ -0,0 +1,29 @@
+; RUN: opt < %s -indvars -S | FileCheck %s
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+
+; It is okay to do LFTR on this loop even though the trip count is a
+; division because in this case the division can be optimized to a
+; shift.
+
+define void @foo(i8* %a, i8 %n) nounwind uwtable ssp {
+; CHECK-LABEL: @foo(
+ entry:
+ %e = icmp sgt i8 %n, 3
+ br i1 %e, label %loop, label %exit
+
+ loop:
+; CHECK-LABEL: loop:
+ %i = phi i8 [ 0, %entry ], [ %i.inc, %loop ]
+ %i1 = phi i8 [ 0, %entry ], [ %i1.inc, %loop ]
+ %i.inc = add nsw i8 %i, 4
+ %i1.inc = add i8 %i1, 1
+ store volatile i8 0, i8* %a
+ %c = icmp slt i8 %i, %n
+; CHECK-LABEL: %exitcond = icmp ne i8 %i1.inc
+ br i1 %c, label %loop, label %exit
+
+ exit:
+; CHECK-LABEL: exit:
+ ret void
+}
diff --git a/test/Transforms/IndVarSimplify/sink-alloca.ll b/test/Transforms/IndVarSimplify/sink-alloca.ll
index 8179470..38c2d31 100644
--- a/test/Transforms/IndVarSimplify/sink-alloca.ll
+++ b/test/Transforms/IndVarSimplify/sink-alloca.ll
@@ -42,7 +42,7 @@ entry:
for.body.i:
%indvars.iv37.i = phi i64 [ %indvars.iv.next38.i, %for.body.i ], [ 0, %entry ]
- %call.i = call i8* (...)* @a() nounwind
+ %call.i = call i8* (...) @a() nounwind
%arrayidx.i = getelementptr inbounds i8*, i8** %vla.i, i64 %indvars.iv37.i
store i8* %call.i, i8** %arrayidx.i, align 8
%indvars.iv.next38.i = add i64 %indvars.iv37.i, 1
@@ -51,6 +51,6 @@ for.body.i:
g.exit:
call void @llvm.stackrestore(i8* %savedstack) nounwind
- %call1 = call i8* (...)* @a(i8** %vla) nounwind
+ %call1 = call i8* (...) @a(i8** %vla) nounwind
ret void
}
diff --git a/test/Transforms/IndVarSimplify/udiv.ll b/test/Transforms/IndVarSimplify/udiv.ll
index 11c5e16..45c703c 100644
--- a/test/Transforms/IndVarSimplify/udiv.ll
+++ b/test/Transforms/IndVarSimplify/udiv.ll
@@ -119,7 +119,7 @@ for.inc35: ; preds = %for.body15, %for.en
while.end: ; preds = %while.cond.while.end_crit_edge, %while.cond.preheader
%count.0.lcssa = phi i32 [ %count.2.lcssa.lcssa, %while.cond.while.end_crit_edge ], [ 0, %while.cond.preheader ] ; <i32> [#uses=1]
- %call40 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0]
+ %call40 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %count.0.lcssa) nounwind ; <i32> [#uses=0]
ret i32 0
}
diff --git a/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll b/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll
index b8ca560..df0b472 100644
--- a/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll
+++ b/test/Transforms/Inline/2003-09-22-PHINodeInlineFail.ll
@@ -9,7 +9,7 @@ LongJmpBlkPost:
ret i32 0
LongJmpBlkPre:
- %i.3 = phi i32 [ 0, %entry ], [ 0, %entry ] ; <i32> [#uses=0]
+ %i.3 = phi i32 [ 0, %entry ]
%exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
cleanup
ret i32 0
diff --git a/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll b/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll
index 9af9332..d5416a2 100644
--- a/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll
+++ b/test/Transforms/Inline/2003-09-22-PHINodesInExceptionDest.ll
@@ -9,7 +9,7 @@ Call2Invoke: ; preds = %entry
br label %exit
LongJmpBlkPre: ; preds = %Call2Invoke, %entry
- %i.3 = phi i32 [ 0, %entry ], [ 0, %Call2Invoke ] ; <i32> [#uses=0]
+ %i.3 = phi i32 [ 0, %entry ]
%exn = landingpad {i8*, i32} personality i32 (...)* @__gxx_personality_v0
cleanup
br label %exit
diff --git a/test/Transforms/Inline/alloca-dbgdeclare.ll b/test/Transforms/Inline/alloca-dbgdeclare.ll
index eb912f5..7e649a2 100644
--- a/test/Transforms/Inline/alloca-dbgdeclare.ll
+++ b/test/Transforms/Inline/alloca-dbgdeclare.ll
@@ -128,7 +128,7 @@ attributes #3 = { noreturn nounwind }
!43 = !{!37, !37, i64 0}
!44 = !{!38, !38, i64 0}
!45 = !MDLocation(line: 9, scope: !15)
-!46 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 6, arg: 1, scope: !15, file: !16, type: !"_ZTS1A", inlinedAt: !47)
+!46 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 6, arg: 1, scope: !15, file: !16, type: !"_ZTS1A")
!47 = distinct !MDLocation(line: 11, scope: !21)
!48 = !MDExpression(DW_OP_bit_piece, 32, 160)
!49 = !MDLocation(line: 6, scope: !15, inlinedAt: !47)
diff --git a/test/Transforms/Inline/attributes.ll b/test/Transforms/Inline/attributes.ll
index 53fb13f..a97e6a6 100644
--- a/test/Transforms/Inline/attributes.ll
+++ b/test/Transforms/Inline/attributes.ll
@@ -110,3 +110,53 @@ define i32 @test_sanitize_thread(i32 %arg) sanitize_thread {
; CHECK-NEXT: @noattr_callee
; CHECK-NEXT: ret i32
}
+
+; Check that a function doesn't get inlined if target-cpu strings don't match
+; exactly.
+define i32 @test_target_cpu_callee0(i32 %i) "target-cpu"="corei7" {
+ ret i32 %i
+}
+
+define i32 @test_target_cpu0(i32 %i) "target-cpu"="corei7" {
+ %1 = call i32 @test_target_cpu_callee0(i32 %i)
+ ret i32 %1
+; CHECK-LABEL: @test_target_cpu0(
+; CHECK-NOT: @test_target_cpu_callee0
+}
+
+define i32 @test_target_cpu_callee1(i32 %i) "target-cpu"="x86-64" {
+ ret i32 %i
+}
+
+define i32 @test_target_cpu1(i32 %i) "target-cpu"="corei7" {
+ %1 = call i32 @test_target_cpu_callee1(i32 %i)
+ ret i32 %1
+; CHECK-LABEL: @test_target_cpu1(
+; CHECK-NEXT: @test_target_cpu_callee1
+; CHECK-NEXT: ret i32
+}
+
+; Check that a function doesn't get inlined if target-features strings don't
+; match exactly.
+define i32 @test_target_features_callee0(i32 %i) "target-features"="+sse4.2" {
+ ret i32 %i
+}
+
+define i32 @test_target_features0(i32 %i) "target-features"="+sse4.2" {
+ %1 = call i32 @test_target_features_callee0(i32 %i)
+ ret i32 %1
+; CHECK-LABEL: @test_target_features0(
+; CHECK-NOT: @test_target_features_callee0
+}
+
+define i32 @test_target_features_callee1(i32 %i) "target-features"="+avx2" {
+ ret i32 %i
+}
+
+define i32 @test_target_features1(i32 %i) "target-features"="+sse4.2" {
+ %1 = call i32 @test_target_features_callee1(i32 %i)
+ ret i32 %1
+; CHECK-LABEL: @test_target_features1(
+; CHECK-NEXT: @test_target_features_callee1
+; CHECK-NEXT: ret i32
+}
diff --git a/test/Transforms/Inline/devirtualize-2.ll b/test/Transforms/Inline/devirtualize-2.ll
index b7eb1be..cca4e75 100644
--- a/test/Transforms/Inline/devirtualize-2.ll
+++ b/test/Transforms/Inline/devirtualize-2.ll
@@ -2,7 +2,7 @@
; PR4834
define i32 @test1() {
- %funcall1_ = call fastcc i32 ()* ()* @f1()
+ %funcall1_ = call fastcc i32 ()* () @f1()
%executecommandptr1_ = call i32 %funcall1_()
ret i32 %executecommandptr1_
}
diff --git a/test/Transforms/Inline/frameescape.ll b/test/Transforms/Inline/frameescape.ll
new file mode 100644
index 0000000..fb33602
--- /dev/null
+++ b/test/Transforms/Inline/frameescape.ll
@@ -0,0 +1,44 @@
+; RUN: opt -inline -S < %s | FileCheck %s
+
+; PR23216: We can't inline functions using llvm.frameescape.
+
+declare void @llvm.frameescape(...)
+declare i8* @llvm.frameaddress(i32)
+declare i8* @llvm.framerecover(i8*, i8*, i32)
+
+define internal void @foo(i8* %fp) {
+ %a.i8 = call i8* @llvm.framerecover(i8* bitcast (i32 ()* @bar to i8*), i8* %fp, i32 0)
+ %a = bitcast i8* %a.i8 to i32*
+ store i32 42, i32* %a
+ ret void
+}
+
+define internal i32 @bar() {
+entry:
+ %a = alloca i32
+ call void (...) @llvm.frameescape(i32* %a)
+ %fp = call i8* @llvm.frameaddress(i32 0)
+ tail call void @foo(i8* %fp)
+ %r = load i32, i32* %a
+ ret i32 %r
+}
+
+; We even bail when someone marks it alwaysinline.
+define internal i32 @bar_alwaysinline() alwaysinline {
+entry:
+ %a = alloca i32
+ call void (...) @llvm.frameescape(i32* %a)
+ tail call void @foo(i8* null)
+ ret i32 0
+}
+
+define i32 @bazz() {
+entry:
+ %r = tail call i32 @bar()
+ %r1 = tail call i32 @bar_alwaysinline()
+ ret i32 %r
+}
+
+; CHECK: define i32 @bazz()
+; CHECK: call i32 @bar()
+; CHECK: call i32 @bar_alwaysinline()
diff --git a/test/Transforms/Inline/ignore-debug-info.ll b/test/Transforms/Inline/ignore-debug-info.ll
index 3e83229..4cbd2fa 100644
--- a/test/Transforms/Inline/ignore-debug-info.ll
+++ b/test/Transforms/Inline/ignore-debug-info.ll
@@ -12,11 +12,11 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1
define <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b) {
entry:
- call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()), !dbg !MDLocation(scope: !6)
%mul = fmul <4 x float> %a, <float 3.000000e+00, float 3.000000e+00, float 3.000000e+00, float 3.000000e+00>
- call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()), !dbg !MDLocation(scope: !6)
%mul1 = fmul <4 x float> %b, <float 5.000000e+00, float 5.000000e+00, float 5.000000e+00, float 5.000000e+00>
- call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()), !dbg !MDLocation(scope: !6)
%add = fadd <4 x float> %mul, %mul1
ret <4 x float> %add
}
@@ -27,10 +27,10 @@ define float @outer_vectors(<4 x float> %a, <4 x float> %b) {
; CHECK: ret float
entry:
- call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
- call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()), !dbg !MDLocation(scope: !6)
+ call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()), !dbg !MDLocation(scope: !6)
%call = call <4 x float> @inner_vectors(<4 x float> %a, <4 x float> %b)
- call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression())
+ call void @llvm.dbg.value(metadata i32 undef, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !6), metadata !MDExpression()), !dbg !MDLocation(scope: !6)
%vecext = extractelement <4 x float> %call, i32 0
%vecext1 = extractelement <4 x float> %call, i32 1
%add = fadd float %vecext, %vecext1
@@ -47,7 +47,7 @@ attributes #0 = { nounwind readnone }
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
-!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !6, globals: !2, imports: !2)
+!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, isOptimized: false, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !{!6}, globals: !2, imports: !2)
!1 = !MDFile(filename: "test.c", directory: "")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
diff --git a/test/Transforms/Inline/inline-musttail-varargs.ll b/test/Transforms/Inline/inline-musttail-varargs.ll
index e9ce660..e93ef76 100644
--- a/test/Transforms/Inline/inline-musttail-varargs.ll
+++ b/test/Transforms/Inline/inline-musttail-varargs.ll
@@ -7,16 +7,16 @@ declare void @ext_method(i8*, i32)
define linkonce_odr void @thunk(i8* %this, ...) {
%this_adj = getelementptr i8, i8* %this, i32 4
- musttail call void (i8*, ...)* bitcast (void (i8*, i32)* @ext_method to void (i8*, ...)*)(i8* %this_adj, ...)
+ musttail call void (i8*, ...) bitcast (void (i8*, i32)* @ext_method to void (i8*, ...)*)(i8* %this_adj, ...)
ret void
}
define void @thunk_caller(i8* %p) {
- call void (i8*, ...)* @thunk(i8* %p, i32 42)
+ call void (i8*, ...) @thunk(i8* %p, i32 42)
ret void
}
; CHECK-LABEL: define void @thunk_caller(i8* %p)
-; CHECK: call void (i8*, ...)* @thunk(i8* %p, i32 42)
+; CHECK: call void (i8*, ...) @thunk(i8* %p, i32 42)
; FIXME: Inline the thunk. This should be significantly easier than inlining
; general varargs functions.
diff --git a/test/Transforms/Inline/inline_dbg_declare.ll b/test/Transforms/Inline/inline_dbg_declare.ll
index 4dc1028..e34a43b 100644
--- a/test/Transforms/Inline/inline_dbg_declare.ll
+++ b/test/Transforms/Inline/inline_dbg_declare.ll
@@ -94,6 +94,6 @@ attributes #1 = { nounwind readnone }
; CHECK: [[FOO:![0-9]+]] = !MDSubprogram(name: "foo",
; CHECK: [[BAR:![0-9]+]] = !MDSubprogram(name: "bar",
+; CHECK: [[m23]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1, scope: [[FOO]]
; CHECK: [[CALL_SITE:![0-9]+]] = distinct !MDLocation(line: 8, column: 14, scope: [[BAR]])
-; CHECK: [[m23]] = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "x", arg: 1, scope: [[FOO]],{{.*}} inlinedAt: [[CALL_SITE]])
; CHECK: [[m24]] = !MDLocation(line: 1, column: 17, scope: [[FOO]], inlinedAt: [[CALL_SITE]])
diff --git a/test/Transforms/Inline/inline_ssp.ll b/test/Transforms/Inline/inline_ssp.ll
index c9675ab..1a07723 100644
--- a/test/Transforms/Inline/inline_ssp.ll
+++ b/test/Transforms/Inline/inline_ssp.ll
@@ -13,25 +13,25 @@
; sspreq > sspstrong > ssp > [no ssp]
define internal void @fun_sspreq() nounwind sspreq uwtable {
entry:
- %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str3, i32 0, i32 0))
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str3, i32 0, i32 0))
ret void
}
define internal void @fun_sspstrong() nounwind sspstrong uwtable {
entry:
- %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str2, i32 0, i32 0))
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str2, i32 0, i32 0))
ret void
}
define internal void @fun_ssp() nounwind ssp uwtable {
entry:
- %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i32 0, i32 0))
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str1, i32 0, i32 0))
ret void
}
define internal void @fun_nossp() nounwind uwtable {
entry:
- %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0))
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0))
ret void
}
diff --git a/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
index bb9a818..50b9fdb 100644
--- a/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
+++ b/test/Transforms/InstCombine/2003-08-12-AllocaNonNull.ll
@@ -12,7 +12,7 @@ entry:
br i1 %tmp.1, label %then, label %UnifiedExitNode
then: ; preds = %entry
- %tmp.4 = call i32 (...)* @bitmap_clear( i32* %live_head ) ; <i32> [#uses=0]
+ %tmp.4 = call i32 (...) @bitmap_clear( i32* %live_head ) ; <i32> [#uses=0]
br label %UnifiedExitNode
UnifiedExitNode: ; preds = %then, %entry
diff --git a/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll b/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll
index c1692f7..aff39f8 100644
--- a/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll
+++ b/test/Transforms/InstCombine/2003-11-03-VarargsCallBug.ll
@@ -7,7 +7,7 @@ declare void @foo(...)
define void @test(i64 %X) {
%Y = inttoptr i64 %X to i32* ; <i32*> [#uses=1]
- call void (...)* @foo( i32* %Y )
+ call void (...) @foo( i32* %Y )
ret void
}
diff --git a/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll b/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll
index 20bbd28..113ada3 100644
--- a/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll
+++ b/test/Transforms/InstCombine/2007-02-01-LoadSinkAlloca.ll
@@ -10,7 +10,7 @@ define i32 @test2(i32 %C) {
entry:
%A = alloca i32
%B = alloca i32
- %tmp = call i32 (...)* @bar( i32* %A ) ; <i32> [#uses=0]
+ %tmp = call i32 (...) @bar( i32* %A ) ; <i32> [#uses=0]
%T = load i32, i32* %A ; <i32> [#uses=1]
%tmp2 = icmp eq i32 %C, 0 ; <i1> [#uses=1]
br i1 %tmp2, label %cond_next, label %cond_true
@@ -23,20 +23,20 @@ cond_true: ; preds = %entry
cond_next: ; preds = %cond_true, %entry
%tmp1.0 = phi i32 [ %T1, %cond_true ], [ %T, %entry ] ; <i32> [#uses=1]
- %tmp7 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp8 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp9 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp10 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp11 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp12 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp13 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp14 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp15 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp16 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp17 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp18 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp19 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
- %tmp20 = call i32 (...)* @baq( ) ; <i32> [#uses=0]
+ %tmp7 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp8 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp9 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp10 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp11 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp12 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp13 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp14 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp15 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp16 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp17 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp18 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp19 = call i32 (...) @baq( ) ; <i32> [#uses=0]
+ %tmp20 = call i32 (...) @baq( ) ; <i32> [#uses=0]
ret i32 %tmp1.0
}
diff --git a/test/Transforms/InstCombine/2007-02-07-PointerCast.ll b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
index 760b6dc..ddc1e03 100644
--- a/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
+++ b/test/Transforms/InstCombine/2007-02-07-PointerCast.ll
@@ -16,7 +16,7 @@ entry:
%tmp1 = load i8*, i8** %a ; <i8*> [#uses=1]
%tmp2 = ptrtoint i8* %tmp1 to i32 ; <i32> [#uses=1]
%tmp3 = zext i32 %tmp2 to i64 ; <i64> [#uses=1]
- %tmp.upgrd.1 = call i32 (i8*, ...)* @printf( i8* %tmp, i64 %tmp3 ) ; <i32> [#uses=0]
+ %tmp.upgrd.1 = call i32 (i8*, ...) @printf( i8* %tmp, i64 %tmp3 ) ; <i32> [#uses=0]
ret i32 0
}
diff --git a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll
index 04a5aaa..1232005 100644
--- a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll
+++ b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll
@@ -5,7 +5,7 @@
define i32 @main(i32 %argc, i8** %argv) {
entry:
- %tmp32 = tail call i32 (i8* , ...) * bitcast (i32 (i8*, ...) * @printf to i32 (i8* , ...) *)( i8* getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0) , i32 0 ) nounwind ; <i32> [#uses=0]
+ %tmp32 = tail call i32 (i8* , ...) bitcast (i32 (i8*, ...) * @printf to i32 (i8* , ...) *)( i8* getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0) , i32 0 ) nounwind ; <i32> [#uses=0]
ret i32 undef
}
diff --git a/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll b/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll
index 46d0694..b111b85 100644
--- a/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll
+++ b/test/Transforms/InstCombine/2008-01-14-VarArgTrampoline.ll
@@ -21,6 +21,6 @@ entry:
%tmp7 = getelementptr %struct.FRAME.nest, %struct.FRAME.nest* %FRAME.0, i32 0, i32 1 ; <i32 (...)**> [#uses=1]
%tmp89 = bitcast i8* %tramp to i32 (...)* ; <i32 (...)*> [#uses=2]
store i32 (...)* %tmp89, i32 (...)** %tmp7, align 8
- %tmp2.i = call i32 (...)* %tmp89( i32 zeroext 0 ) ; <i32> [#uses=1]
+ %tmp2.i = call i32 (...) %tmp89( i32 zeroext 0 ) ; <i32> [#uses=1]
ret i32 %tmp2.i
}
diff --git a/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll b/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
index aa38065..1ea0998 100644
--- a/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
+++ b/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
@@ -8,7 +8,7 @@ target triple = "i386-apple-darwin9"
define void @foo(i8* %context) nounwind {
entry:
%tmp1 = bitcast i8* %context to %struct.NSRect* ; <%struct.NSRect*> [#uses=1]
- call void (i32, ...)* @bar( i32 3, %struct.NSRect* byval align 4 %tmp1 ) nounwind
+ call void (i32, ...) @bar( i32 3, %struct.NSRect* byval align 4 %tmp1 ) nounwind
ret void
}
diff --git a/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll b/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll
index e007e6f..9073820 100644
--- a/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll
+++ b/test/Transforms/InstCombine/2008-05-08-LiveStoreDelete.ll
@@ -14,7 +14,7 @@ entry:
%tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1]
%tmp9 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1]
store i8 0, i8* %tmp9, align 1
- %tmp11 = call i32 (...)* @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
+ %tmp11 = call i32 (...) @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
ret i32 %tmp7
}
diff --git a/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll b/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll
index af0ffeb..ce19233 100644
--- a/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll
+++ b/test/Transforms/InstCombine/2008-05-08-StrLenSink.ll
@@ -18,7 +18,7 @@ entry:
%tmp7 = call i32 @strlen( i8* %tmp1 ) nounwind readonly ; <i32> [#uses=1]
%tmp9 = getelementptr i8, i8* %tmp1, i32 0 ; <i8*> [#uses=1]
store i8 0, i8* %tmp9, align 1
- %tmp11 = call i32 (...)* @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
+ %tmp11 = call i32 (...) @b( i8* %tmp1 ) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
diff --git a/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll b/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll
index ec94623..7e8341b 100644
--- a/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll
+++ b/test/Transforms/InstCombine/2008-06-08-ICmpPHI.ll
@@ -7,28 +7,28 @@ entry:
bb: ; preds = %bb16, %entry
%i.0 = phi i32 [ 0, %entry ], [ %indvar.next, %somebb ] ; <i32> [#uses=1]
%x.0 = phi i32 [ 37, %entry ], [ %tmp17, %somebb ] ; <i32> [#uses=1]
- %tmp = tail call i32 (...)* @bork( ) nounwind ; <i32> [#uses=0]
- %tmp1 = tail call i32 (...)* @bork( ) nounwind ; <i32> [#uses=0]
- %tmp2 = tail call i32 (...)* @bork( ) nounwind ; <i32> [#uses=1]
+ %tmp = tail call i32 (...) @bork( ) nounwind ; <i32> [#uses=0]
+ %tmp1 = tail call i32 (...) @bork( ) nounwind ; <i32> [#uses=0]
+ %tmp2 = tail call i32 (...) @bork( ) nounwind ; <i32> [#uses=1]
%tmp3 = icmp eq i32 %tmp2, 0 ; <i1> [#uses=1]
br i1 %tmp3, label %bb7, label %bb5
bb5: ; preds = %bb
- %tmp6 = tail call i32 (...)* @bork( ) nounwind ; <i32> [#uses=0]
+ %tmp6 = tail call i32 (...) @bork( ) nounwind ; <i32> [#uses=0]
br label %bb7
bb7: ; preds = %bb5, %bb
- %tmp8 = tail call i32 (...)* @bork( ) nounwind ; <i32> [#uses=0]
- %tmp9 = tail call i32 (...)* @bork( ) nounwind ; <i32> [#uses=0]
+ %tmp8 = tail call i32 (...) @bork( ) nounwind ; <i32> [#uses=0]
+ %tmp9 = tail call i32 (...) @bork( ) nounwind ; <i32> [#uses=0]
%tmp11 = icmp eq i32 %x.0, 37 ; <i1> [#uses=1]
br i1 %tmp11, label %bb14, label %bb16
bb14: ; preds = %bb7
- %tmp15 = tail call i32 (...)* @bar( ) nounwind ; <i32> [#uses=0]
+ %tmp15 = tail call i32 (...) @bar( ) nounwind ; <i32> [#uses=0]
br label %bb16
bb16: ; preds = %bb14, %bb7
- %tmp17 = tail call i32 (...)* @zap( ) nounwind ; <i32> [#uses=1]
+ %tmp17 = tail call i32 (...) @zap( ) nounwind ; <i32> [#uses=1]
%indvar.next = add i32 %i.0, 1 ; <i32> [#uses=2]
%exitcond = icmp eq i32 %indvar.next, 42 ; <i1> [#uses=1]
br i1 %exitcond, label %return, label %somebb
diff --git a/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll b/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll
index 23ed5aa..9994b58 100644
--- a/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll
+++ b/test/Transforms/InstCombine/2009-01-08-AlignAlloca.ll
@@ -20,7 +20,7 @@ entry:
%3 = getelementptr %struct.Key, %struct.Key* %iospec, i32 0, i32 0 ; <{ i32, i32 }*> [#uses=1]
%4 = bitcast { i32, i32 }* %3 to i64* ; <i64*> [#uses=1]
store i64 %key_token2, i64* %4, align 4
- %5 = call i32 (...)* @foo(%struct.Key* byval align 4 %iospec, i32* %ret) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (...) @foo(%struct.Key* byval align 4 %iospec, i32* %ret) nounwind ; <i32> [#uses=0]
%6 = load i32, i32* %ret, align 4 ; <i32> [#uses=1]
ret i32 %6
}
diff --git a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll
index cb7431b..b9aa0a2 100644
--- a/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll
+++ b/test/Transforms/InstCombine/2009-01-19-fmod-constant-float-specials.ll
@@ -20,7 +20,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -41,7 +41,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -60,7 +60,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -79,7 +79,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -98,7 +98,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -117,7 +117,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -136,7 +136,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -155,7 +155,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -174,7 +174,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -193,7 +193,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -212,7 +212,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -231,7 +231,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -250,7 +250,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -269,7 +269,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -288,7 +288,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
@@ -307,7 +307,7 @@ entry:
%2 = load float, float* %x, align 4 ; <float> [#uses=1]
%3 = fpext float %2 to double ; <double> [#uses=1]
%4 = frem double %3, %1 ; <double> [#uses=1]
- %5 = call i32 (i8*, ...)* @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
+ %5 = call i32 (i8*, ...) @printf(i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), double %4) nounwind ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
diff --git a/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll b/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll
index 29ceb6d..5161069 100644
--- a/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll
+++ b/test/Transforms/InstCombine/2010-05-30-memcpy-Struct.ll
@@ -10,7 +10,7 @@ target triple = "x86_64-unknown-linux-gnu"
define void @CopyEventArg(%union.anon* %ev) nounwind {
entry:
- %call = call i32 (i8*, i8*, ...)* @sprintf(i8* undef, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %union.anon* %ev) nounwind
+ %call = call i32 (i8*, i8*, ...) @sprintf(i8* undef, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), %union.anon* %ev) nounwind
; CHECK: bitcast %union.anon* %ev to i8*
; CHECK: call void @llvm.memcpy.p0i8.p0i8.i64
ret void
diff --git a/test/Transforms/InstCombine/2012-02-13-FCmp.ll b/test/Transforms/InstCombine/2012-02-13-FCmp.ll
index 3c4c6de..586f86d 100644
--- a/test/Transforms/InstCombine/2012-02-13-FCmp.ll
+++ b/test/Transforms/InstCombine/2012-02-13-FCmp.ll
@@ -6,9 +6,9 @@
declare i32 @printf(i8*, ...)
define i64 @_Z8tempCastj(i32 %val) uwtable ssp {
entry:
- %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str1, i64 0, i64 0), i32 %val)
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str1, i64 0, i64 0), i32 %val)
%conv = uitofp i32 %val to double
- %call.i = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %conv)
+ %call.i = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), double %conv)
%cmp.i = fcmp oge double %conv, -1.000000e+00
br i1 %cmp.i, label %land.rhs.i, label %if.end.critedge
; CHECK: br i1 true, label %land.rhs.i, label %if.end.critedge
diff --git a/test/Transforms/InstCombine/alloca.ll b/test/Transforms/InstCombine/alloca.ll
index 81e2083..b61b75e 100644
--- a/test/Transforms/InstCombine/alloca.ll
+++ b/test/Transforms/InstCombine/alloca.ll
@@ -13,14 +13,14 @@ declare void @use(...)
; CHECK-NOT: alloca
define void @test() {
%X = alloca [0 x i32] ; <[0 x i32]*> [#uses=1]
- call void (...)* @use( [0 x i32]* %X )
+ call void (...) @use( [0 x i32]* %X )
%Y = alloca i32, i32 0 ; <i32*> [#uses=1]
- call void (...)* @use( i32* %Y )
+ call void (...) @use( i32* %Y )
%Z = alloca { } ; <{ }*> [#uses=1]
- call void (...)* @use( { }* %Z )
+ call void (...) @use( { }* %Z )
%size = load i32, i32* @int
%A = alloca {{}}, i32 %size
- call void (...)* @use( {{}}* %A )
+ call void (...) @use( {{}}* %A )
ret void
}
@@ -126,7 +126,7 @@ define void @test8() {
; NODL: alloca [100 x i32]
; NODL: getelementptr inbounds [100 x i32], [100 x i32]* %x1, i64 0, i64 0
%x = alloca i32, i32 100
- call void (...)* @use(i32* %x)
+ call void (...) @use(i32* %x)
ret void
}
@@ -160,6 +160,6 @@ entry:
%v32 = alloca i1, align 8
%v64 = alloca i1, i64 1, align 8
%v33 = alloca i1, i33 1, align 8
- call void (...)* @use(i1* %v32, i1* %v64, i1* %v33)
+ call void (...) @use(i1* %v32, i1* %v64, i1* %v33)
ret void
}
diff --git a/test/Transforms/InstCombine/call-intrinsics.ll b/test/Transforms/InstCombine/call-intrinsics.ll
index f9d1080..3e37a71 100644
--- a/test/Transforms/InstCombine/call-intrinsics.ll
+++ b/test/Transforms/InstCombine/call-intrinsics.ll
@@ -3,17 +3,17 @@
@X = global i8 0 ; <i8*> [#uses=3]
@Y = global i8 12 ; <i8*> [#uses=2]
-declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
+declare void @llvm.memmove.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
-declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
+declare void @llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
-declare void @llvm.memset.i32(i8*, i8, i32, i32)
+declare void @llvm.memset.p0i8.i32(i8*, i8, i32, i32, i1)
define void @zero_byte_test() {
; These process zero bytes, so they are a noop.
- call void @llvm.memmove.i32( i8* @X, i8* @Y, i32 0, i32 100 )
- call void @llvm.memcpy.i32( i8* @X, i8* @Y, i32 0, i32 100 )
- call void @llvm.memset.i32( i8* @X, i8 123, i32 0, i32 100 )
+ call void @llvm.memmove.p0i8.p0i8.i32( i8* @X, i8* @Y, i32 0, i32 128, i1 false )
+ call void @llvm.memcpy.p0i8.p0i8.i32( i8* @X, i8* @Y, i32 0, i32 128, i1 false )
+ call void @llvm.memset.p0i8.i32( i8* @X, i8 123, i32 0, i32 128, i1 false )
ret void
}
diff --git a/test/Transforms/InstCombine/call.ll b/test/Transforms/InstCombine/call.ll
index e68c0ad..47ae71f 100644
--- a/test/Transforms/InstCombine/call.ll
+++ b/test/Transforms/InstCombine/call.ll
@@ -61,7 +61,7 @@ define void @test3a(i8, ...) {unreachable }
define void @test3(i8 %A, i8 %B) {
; CHECK-LABEL: @test3(
; CHECK: %1 = zext i8 %B to i32
-; CHECK: call void (i8, ...)* @test3a(i8 %A, i32 %1)
+; CHECK: call void (i8, ...) @test3a(i8 %A, i32 %1)
; CHECK: ret void
call void bitcast (void (i8, ...)* @test3a to void (i8, i8)*)( i8 %A, i8 %B)
ret void
diff --git a/test/Transforms/InstCombine/call2.ll b/test/Transforms/InstCombine/call2.ll
index 467eb07..70a5b3c 100644
--- a/test/Transforms/InstCombine/call2.ll
+++ b/test/Transforms/InstCombine/call2.ll
@@ -4,7 +4,7 @@
define i32 @bar() {
entry:
%retval = alloca i32, align 4 ; <i32*> [#uses=1]
- %tmp = call i32 (...)* bitcast (i32 (i8*)* @f to i32 (...)*)( double 3.000000e+00 ) ; <i32> [#uses=0]
+ %tmp = call i32 (...) bitcast (i32 (i8*)* @f to i32 (...)*)( double 3.000000e+00 ) ; <i32> [#uses=0]
br label %return
return: ; preds = %entry
diff --git a/test/Transforms/InstCombine/cast.ll b/test/Transforms/InstCombine/cast.ll
index c577501..c96140e 100644
--- a/test/Transforms/InstCombine/cast.ll
+++ b/test/Transforms/InstCombine/cast.ll
@@ -93,9 +93,9 @@ declare void @varargs(i32, ...)
define void @test11(i32* %P) {
%c = bitcast i32* %P to i16* ; <i16*> [#uses=1]
- call void (i32, ...)* @varargs( i32 5, i16* %c )
+ call void (i32, ...) @varargs( i32 5, i16* %c )
ret void
-; CHECK: call void (i32, ...)* @varargs(i32 5, i32* %P)
+; CHECK: call void (i32, ...) @varargs(i32 5, i32* %P)
; CHECK: ret void
}
diff --git a/test/Transforms/InstCombine/debug-line.ll b/test/Transforms/InstCombine/debug-line.ll
index a36487a..8e335b8 100644
--- a/test/Transforms/InstCombine/debug-line.ll
+++ b/test/Transforms/InstCombine/debug-line.ll
@@ -5,7 +5,7 @@
define void @foo() nounwind ssp {
;CHECK: call i32 @putchar{{.+}} !dbg
- %1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i32 97), !dbg !5
+ %1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i32 97), !dbg !5
ret void, !dbg !7
}
@@ -17,7 +17,7 @@ declare i32 @printf(i8*, ...)
!0 = !MDSubprogram(name: "foo", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !1, type: !3, function: void ()* @foo)
!1 = !MDFile(filename: "m.c", directory: "/private/tmp")
-!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: 0, file: !8, enums: !4, retainedTypes: !4, subprograms: !9)
+!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang", isOptimized: true, emissionKind: 0, file: !8, enums: !{}, retainedTypes: !{}, subprograms: !9)
!3 = !MDSubroutineType(types: !4)
!4 = !{null}
!5 = !MDLocation(line: 5, column: 2, scope: !6)
diff --git a/test/Transforms/InstCombine/debuginfo.ll b/test/Transforms/InstCombine/debuginfo.ll
index ee02c89..0a2ea0e 100644
--- a/test/Transforms/InstCombine/debuginfo.ll
+++ b/test/Transforms/InstCombine/debuginfo.ll
@@ -55,5 +55,5 @@ entry:
!26 = !MDFile(filename: "bits.c", directory: "Game")
!27 = !MDFile(filename: "string.h", directory: "Game")
!28 = !MDFile(filename: "bits.c", directory: "Game")
-!29 = !{i32 0}
+!29 = !{}
!30 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/test/Transforms/InstCombine/err-rep-cold.ll b/test/Transforms/InstCombine/err-rep-cold.ll
index e4399ab..6c4e4e1 100644
--- a/test/Transforms/InstCombine/err-rep-cold.ll
+++ b/test/Transforms/InstCombine/err-rep-cold.ll
@@ -19,10 +19,10 @@ entry:
if.then: ; preds = %entry
%0 = load %struct._IO_FILE*, %struct._IO_FILE** @stderr, align 8
- %call = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %a) #1
+ %call = tail call i32 (%struct._IO_FILE*, i8*, ...) @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %a) #1
br label %return
-; CHECK: %call = tail call i32 (%struct._IO_FILE*, i8*, ...)* @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %a) #[[AT1:[0-9]+]]
+; CHECK: %call = tail call i32 (%struct._IO_FILE*, i8*, ...) @fprintf(%struct._IO_FILE* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %a) #[[AT1:[0-9]+]]
return: ; preds = %entry, %if.then
%retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ]
diff --git a/test/Transforms/InstCombine/fprintf-1.ll b/test/Transforms/InstCombine/fprintf-1.ll
index 32203b2..6d21f39 100644
--- a/test/Transforms/InstCombine/fprintf-1.ll
+++ b/test/Transforms/InstCombine/fprintf-1.ll
@@ -20,7 +20,7 @@ declare i32 @fprintf(%FILE*, i8*, ...)
define void @test_simplify1(%FILE* %fp) {
; CHECK-LABEL: @test_simplify1(
%fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt)
+ call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt)
; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 12, i32 1, %FILE* %fp)
ret void
; CHECK-NEXT: ret void
@@ -31,7 +31,7 @@ define void @test_simplify1(%FILE* %fp) {
define void @test_simplify2(%FILE* %fp) {
; CHECK-LABEL: @test_simplify2(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_c, i32 0, i32 0
- call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i8 104)
+ call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt, i8 104)
; CHECK-NEXT: call i32 @fputc(i32 104, %FILE* %fp)
ret void
; CHECK-NEXT: ret void
@@ -44,7 +44,7 @@ define void @test_simplify3(%FILE* %fp) {
; CHECK-LABEL: @test_simplify3(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0
%str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i8* %str)
+ call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt, i8* %str)
; CHECK-NEXT: call i32 @fwrite(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 12, i32 1, %FILE* %fp)
ret void
; CHECK-NEXT: ret void
@@ -55,8 +55,8 @@ define void @test_simplify3(%FILE* %fp) {
define void @test_simplify4(%FILE* %fp) {
; CHECK-IPRINTF-LABEL: @test_simplify4(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_d, i32 0, i32 0
- call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, i32 187)
-; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...)* @fiprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187)
+ call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt, i32 187)
+; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...) @fiprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187)
ret void
; CHECK-IPRINTF-NEXT: ret void
}
@@ -64,8 +64,8 @@ define void @test_simplify4(%FILE* %fp) {
define void @test_no_simplify1(%FILE* %fp) {
; CHECK-IPRINTF-LABEL: @test_no_simplify1(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0
- call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, double 1.87)
-; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00)
+ call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt, double 1.87)
+; CHECK-IPRINTF-NEXT: call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00)
ret void
; CHECK-IPRINTF-NEXT: ret void
}
@@ -73,8 +73,8 @@ define void @test_no_simplify1(%FILE* %fp) {
define void @test_no_simplify2(%FILE* %fp, double %d) {
; CHECK-LABEL: @test_no_simplify2(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0
- call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt, double %d)
-; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double %d)
+ call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt, double %d)
+; CHECK-NEXT: call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double %d)
ret void
; CHECK-NEXT: ret void
}
@@ -82,8 +82,8 @@ define void @test_no_simplify2(%FILE* %fp, double %d) {
define i32 @test_no_simplify3(%FILE* %fp) {
; CHECK-LABEL: @test_no_simplify3(
%fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- %1 = call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* %fmt)
-; CHECK-NEXT: call i32 (%FILE*, i8*, ...)* @fprintf(%FILE* %fp, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0))
+ %1 = call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* %fmt)
+; CHECK-NEXT: call i32 (%FILE*, i8*, ...) @fprintf(%FILE* %fp, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0))
ret i32 %1
; CHECK-NEXT: ret i32 %1
}
diff --git a/test/Transforms/InstCombine/gc.relocate.ll b/test/Transforms/InstCombine/gc.relocate.ll
index 4a7ea2c..5ecde19 100644
--- a/test/Transforms/InstCombine/gc.relocate.ll
+++ b/test/Transforms/InstCombine/gc.relocate.ll
@@ -9,13 +9,13 @@ declare zeroext i1 @return_i1()
declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...)
declare i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32, i32, i32)
-define i32 addrspace(1)* @deref(i32 addrspace(1)* dereferenceable(8) %dparam) {
+define i32 addrspace(1)* @deref(i32 addrspace(1)* dereferenceable(8) %dparam) gc "statepoint-example" {
; Checks that a dereferenceabler pointer
; CHECK-LABEL: @deref
; CHECK: call dereferenceable(8)
entry:
%load = load i32, i32 addrspace(1)* %dparam
- %tok = tail call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam)
+ %tok = tail call i32 (i1 ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32 addrspace(1)* %dparam)
%relocate = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %tok, i32 4, i32 4)
ret i32 addrspace(1)* %relocate
-} \ No newline at end of file
+}
diff --git a/test/Transforms/InstCombine/getelementptr.ll b/test/Transforms/InstCombine/getelementptr.ll
index 2e605fb..9bb1b12 100644
--- a/test/Transforms/InstCombine/getelementptr.ll
+++ b/test/Transforms/InstCombine/getelementptr.ll
@@ -460,7 +460,7 @@ bb10:
%tmp.0.reg2mem.0.rec = mul i32 %indvar, -1
%tmp12.rec = add i32 %tmp.0.reg2mem.0.rec, -1
%tmp12 = getelementptr inbounds %struct.x, %struct.x* %tmp45, i32 %tmp12.rec
- %tmp16 = call i32 (i8*, ...)* @printf( i8* getelementptr ([12 x i8], [12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind
+ %tmp16 = call i32 (i8*, ...) @printf( i8* getelementptr ([12 x i8], [12 x i8]* @.str1, i32 0, i32 0), %struct.x* %tmp12 ) nounwind
%tmp84 = icmp eq %struct.x* %tmp12, %orientations62
%indvar.next = add i32 %indvar, 1
br i1 %tmp84, label %bb17, label %bb10
@@ -617,11 +617,11 @@ entry:
; Instcombine should be able to fold this getelementptr.
define i32 @test35() nounwind {
- call i32 (i8*, ...)* @printf(i8* getelementptr ([17 x i8], [17 x i8]* @"\01LC8", i32 0, i32 0),
+ call i32 (i8*, ...) @printf(i8* getelementptr ([17 x i8], [17 x i8]* @"\01LC8", i32 0, i32 0),
i8* getelementptr (%t1, %t1* bitcast (%t0* @s to %t1*), i32 0, i32 1, i32 0)) nounwind
ret i32 0
; CHECK-LABEL: @test35(
-; CHECK: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @"\01LC8", i64 0, i64 0), i8* getelementptr inbounds (%t0, %t0* @s, i64 0, i32 1, i64 0)) [[NUW:#[0-9]+]]
+; CHECK: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @"\01LC8", i64 0, i64 0), i8* getelementptr inbounds (%t0, %t0* @s, i64 0, i32 1, i64 0)) [[NUW:#[0-9]+]]
}
; Instcombine should constant-fold the GEP so that indices that have
diff --git a/test/Transforms/InstCombine/intrinsics.ll b/test/Transforms/InstCombine/intrinsics.ll
index 539628a..f9ccf51 100644
--- a/test/Transforms/InstCombine/intrinsics.ll
+++ b/test/Transforms/InstCombine/intrinsics.ll
@@ -407,3 +407,13 @@ entry:
%obit = extractvalue %ov.result.32 %t, 1
ret i1 %obit
}
+
+define %ov.result.32 @ssubtest_reorder(i8 %a) {
+ %A = sext i8 %a to i32
+ %x = call %ov.result.32 @llvm.ssub.with.overflow.i32(i32 0, i32 %A)
+ ret %ov.result.32 %x
+; CHECK-LABEL: @ssubtest_reorder
+; CHECK: %x = sub nsw i32 0, %A
+; CHECK-NEXT: %1 = insertvalue %ov.result.32 { i32 undef, i1 false }, i32 %x, 0
+; CHECK-NEXT: ret %ov.result.32 %1
+}
diff --git a/test/Transforms/InstCombine/objsize-noverify.ll b/test/Transforms/InstCombine/objsize-noverify.ll
new file mode 100644
index 0000000..7e469bd
--- /dev/null
+++ b/test/Transforms/InstCombine/objsize-noverify.ll
@@ -0,0 +1,43 @@
+; Test objectsize bounds checking that won't verify until after -instcombine.
+; RUN: opt < %s -disable-verify -instcombine -S | opt -S | FileCheck %s
+; We need target data to get the sizes of the arrays and structures.
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
+
+declare i32 @llvm.objectsize.i32.p0i8(i8*, i1) nounwind readonly
+
+; CHECK-LABEL: @PR13390(
+define i32 @PR13390(i1 %bool, i8* %a) {
+entry:
+ %cond = or i1 %bool, true
+ br i1 %cond, label %return, label %xpto
+
+xpto:
+ %select = select i1 %bool, i8* %select, i8* %a
+ %select2 = select i1 %bool, i8* %a, i8* %select2
+ %0 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select, i1 true)
+ %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select2, i1 true)
+ %2 = add i32 %0, %1
+; CHECK: ret i32 undef
+ ret i32 %2
+
+return:
+ ret i32 42
+}
+
+; CHECK-LABEL: @PR13621(
+define i32 @PR13621(i1 %bool) nounwind {
+entry:
+ %cond = or i1 %bool, true
+ br i1 %cond, label %return, label %xpto
+
+; technically reachable, but this malformed IR may appear as a result of constant propagation
+xpto:
+ %gep2 = getelementptr i8, i8* %gep, i32 1
+ %gep = getelementptr i8, i8* %gep2, i32 1
+ %o = call i32 @llvm.objectsize.i32.p0i8(i8* %gep, i1 true)
+; CHECK: ret i32 undef
+ ret i32 %o
+
+return:
+ ret i32 7
+}
diff --git a/test/Transforms/InstCombine/objsize.ll b/test/Transforms/InstCombine/objsize.ll
index 3125458..335a816 100644
--- a/test/Transforms/InstCombine/objsize.ll
+++ b/test/Transforms/InstCombine/objsize.ll
@@ -219,43 +219,6 @@ define i32 @test13(i8** %esc) {
ret i32 %1
}
-; CHECK-LABEL: @PR13390(
-define i32 @PR13390(i1 %bool, i8* %a) {
-entry:
- %cond = or i1 %bool, true
- br i1 %cond, label %return, label %xpto
-
-xpto:
- %select = select i1 %bool, i8* %select, i8* %a
- %select2 = select i1 %bool, i8* %a, i8* %select2
- %0 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select, i1 true)
- %1 = tail call i32 @llvm.objectsize.i32.p0i8(i8* %select2, i1 true)
- %2 = add i32 %0, %1
-; CHECK: ret i32 undef
- ret i32 %2
-
-return:
- ret i32 42
-}
-
-; CHECK-LABEL: @PR13621(
-define i32 @PR13621(i1 %bool) nounwind {
-entry:
- %cond = or i1 %bool, true
- br i1 %cond, label %return, label %xpto
-
-; technically reachable, but this malformed IR may appear as a result of constant propagation
-xpto:
- %gep2 = getelementptr i8, i8* %gep, i32 1
- %gep = getelementptr i8, i8* %gep2, i32 1
- %o = call i32 @llvm.objectsize.i32.p0i8(i8* %gep, i1 true)
-; CHECK: ret i32 undef
- ret i32 %o
-
-return:
- ret i32 7
-}
-
@globalalias = internal alias [60 x i8]* @a
; CHECK-LABEL: @test18(
diff --git a/test/Transforms/InstCombine/osx-names.ll b/test/Transforms/InstCombine/osx-names.ll
index ed379c5..04d842d 100644
--- a/test/Transforms/InstCombine/osx-names.ll
+++ b/test/Transforms/InstCombine/osx-names.ll
@@ -16,14 +16,14 @@ target triple = "i386-apple-macosx10.7.2"
define void @test1(%struct.__sFILE* %stream) nounwind {
; CHECK-LABEL: define void @test1(
; CHECK: call i32 @"fwrite$UNIX2003"
- %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0)) nounwind
+ %call = tail call i32 (%struct.__sFILE*, i8*, ...) @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i32 0, i32 0)) nounwind
ret void
}
define void @test2(%struct.__sFILE* %stream, i8* %str) nounwind ssp {
; CHECK-LABEL: define void @test2(
; CHECK: call i32 @"fputs$UNIX2003"
- %call = tail call i32 (%struct.__sFILE*, i8*, ...)* @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str2, i32 0, i32 0), i8* %str) nounwind
+ %call = tail call i32 (%struct.__sFILE*, i8*, ...) @fprintf(%struct.__sFILE* %stream, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str2, i32 0, i32 0), i8* %str) nounwind
ret void
}
diff --git a/test/Transforms/InstCombine/overflow.ll b/test/Transforms/InstCombine/overflow.ll
index 3eddc80..4c0a8a2 100644
--- a/test/Transforms/InstCombine/overflow.ll
+++ b/test/Transforms/InstCombine/overflow.ll
@@ -97,39 +97,6 @@ if.end: ; preds = %entry
; CHECK: ret i8
}
-; CHECK-LABEL: @test5(
-; CHECK: llvm.uadd.with.overflow
-; CHECK: ret i64
-define i64 @test5(i64 %a, i64 %b) nounwind ssp {
-entry:
- %add = add i64 %b, %a
- %cmp = icmp ult i64 %add, %a
- %Q = select i1 %cmp, i64 %b, i64 42
- ret i64 %Q
-}
-
-; CHECK-LABEL: @test6(
-; CHECK: llvm.uadd.with.overflow
-; CHECK: ret i64
-define i64 @test6(i64 %a, i64 %b) nounwind ssp {
-entry:
- %add = add i64 %b, %a
- %cmp = icmp ult i64 %add, %b
- %Q = select i1 %cmp, i64 %b, i64 42
- ret i64 %Q
-}
-
-; CHECK-LABEL: @test7(
-; CHECK: llvm.uadd.with.overflow
-; CHECK: ret i64
-define i64 @test7(i64 %a, i64 %b) nounwind ssp {
-entry:
- %add = add i64 %b, %a
- %cmp = icmp ugt i64 %b, %add
- %Q = select i1 %cmp, i64 %b, i64 42
- ret i64 %Q
-}
-
; CHECK-LABEL: @test8(
; PR11438
; This is @test1, but the operands are not sign-extended. Make sure
diff --git a/test/Transforms/InstCombine/pr2996.ll b/test/Transforms/InstCombine/pr2996.ll
index ff3245d..f5e1df4 100644
--- a/test/Transforms/InstCombine/pr2996.ll
+++ b/test/Transforms/InstCombine/pr2996.ll
@@ -5,7 +5,7 @@ define void @func_53(i16 signext %p_56) nounwind {
entry:
%0 = icmp sgt i16 %p_56, -1 ; <i1> [#uses=1]
%iftmp.0.0 = select i1 %0, i32 -1, i32 0 ; <i32> [#uses=1]
- %1 = call i32 (...)* @func_4(i32 %iftmp.0.0) nounwind ; <i32> [#uses=0]
+ %1 = call i32 (...) @func_4(i32 %iftmp.0.0) nounwind ; <i32> [#uses=0]
ret void
}
diff --git a/test/Transforms/InstCombine/pr8547.ll b/test/Transforms/InstCombine/pr8547.ll
index f6b3374..6d74b40 100644
--- a/test/Transforms/InstCombine/pr8547.ll
+++ b/test/Transforms/InstCombine/pr8547.ll
@@ -21,6 +21,6 @@ for.cond: ; preds = %for.cond, %codeRepl
br i1 %tobool, label %for.cond, label %codeRepl2
codeRepl2: ; preds = %for.cond
- %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %conv2) nounwind
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %conv2) nounwind
ret i32 0
}
diff --git a/test/Transforms/InstCombine/printf-1.ll b/test/Transforms/InstCombine/printf-1.ll
index 3fe79ac..75e11ce 100644
--- a/test/Transforms/InstCombine/printf-1.ll
+++ b/test/Transforms/InstCombine/printf-1.ll
@@ -22,7 +22,7 @@ declare i32 @printf(i8*, ...)
define void @test_simplify1() {
; CHECK-LABEL: @test_simplify1(
%fmt = getelementptr [1 x i8], [1 x i8]* @empty, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt)
+ call i32 (i8*, ...) @printf(i8* %fmt)
ret void
; CHECK-NEXT: ret void
}
@@ -32,7 +32,7 @@ define void @test_simplify1() {
define void @test_simplify2() {
; CHECK-LABEL: @test_simplify2(
%fmt = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt)
+ call i32 (i8*, ...) @printf(i8* %fmt)
; CHECK-NEXT: call i32 @putchar(i32 104)
ret void
; CHECK-NEXT: ret void
@@ -41,7 +41,7 @@ define void @test_simplify2() {
define void @test_simplify3() {
; CHECK-LABEL: @test_simplify3(
%fmt = getelementptr [2 x i8], [2 x i8]* @percent, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt)
+ call i32 (i8*, ...) @printf(i8* %fmt)
; CHECK-NEXT: call i32 @putchar(i32 37)
ret void
; CHECK-NEXT: ret void
@@ -52,7 +52,7 @@ define void @test_simplify3() {
define void @test_simplify4() {
; CHECK-LABEL: @test_simplify4(
%fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt)
+ call i32 (i8*, ...) @printf(i8* %fmt)
; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* [[STR]], i32 0, i32 0))
ret void
; CHECK-NEXT: ret void
@@ -63,7 +63,7 @@ define void @test_simplify4() {
define void @test_simplify5() {
; CHECK-LABEL: @test_simplify5(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_c, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt, i8 104)
+ call i32 (i8*, ...) @printf(i8* %fmt, i8 104)
; CHECK-NEXT: call i32 @putchar(i32 104)
ret void
; CHECK-NEXT: ret void
@@ -75,7 +75,7 @@ define void @test_simplify6() {
; CHECK-LABEL: @test_simplify6(
%fmt = getelementptr [4 x i8], [4 x i8]* @percent_s, i32 0, i32 0
%str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt, i8* %str)
+ call i32 (i8*, ...) @printf(i8* %fmt, i8* %str)
; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0))
ret void
; CHECK-NEXT: ret void
@@ -86,8 +86,8 @@ define void @test_simplify6() {
define void @test_simplify7() {
; CHECK-IPRINTF-LABEL: @test_simplify7(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_d, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt, i32 187)
-; CHECK-IPRINTF-NEXT: call i32 (i8*, ...)* @iprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187)
+ call i32 (i8*, ...) @printf(i8* %fmt, i32 187)
+; CHECK-IPRINTF-NEXT: call i32 (i8*, ...) @iprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187)
ret void
; CHECK-IPRINTF-NEXT: ret void
}
@@ -95,16 +95,16 @@ define void @test_simplify7() {
define void @test_no_simplify1() {
; CHECK-IPRINTF-LABEL: @test_no_simplify1(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0
- call i32 (i8*, ...)* @printf(i8* %fmt, double 1.87)
-; CHECK-IPRINTF-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00)
+ call i32 (i8*, ...) @printf(i8* %fmt, double 1.87)
+; CHECK-IPRINTF-NEXT: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00)
ret void
; CHECK-IPRINTF-NEXT: ret void
}
define void @test_no_simplify2(i8* %fmt, double %d) {
; CHECK-LABEL: @test_no_simplify2(
- call i32 (i8*, ...)* @printf(i8* %fmt, double %d)
-; CHECK-NEXT: call i32 (i8*, ...)* @printf(i8* %fmt, double %d)
+ call i32 (i8*, ...) @printf(i8* %fmt, double %d)
+; CHECK-NEXT: call i32 (i8*, ...) @printf(i8* %fmt, double %d)
ret void
; CHECK-NEXT: ret void
}
@@ -112,8 +112,8 @@ define void @test_no_simplify2(i8* %fmt, double %d) {
define i32 @test_no_simplify3() {
; CHECK-LABEL: @test_no_simplify3(
%fmt = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0
- %ret = call i32 (i8*, ...)* @printf(i8* %fmt)
-; CHECK-NEXT: call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @h, i32 0, i32 0))
+ %ret = call i32 (i8*, ...) @printf(i8* %fmt)
+; CHECK-NEXT: call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @h, i32 0, i32 0))
ret i32 %ret
; CHECK-NEXT: ret i32 %ret
}
diff --git a/test/Transforms/InstCombine/printf-2.ll b/test/Transforms/InstCombine/printf-2.ll
index d685824..d676985 100644
--- a/test/Transforms/InstCombine/printf-2.ll
+++ b/test/Transforms/InstCombine/printf-2.ll
@@ -15,7 +15,7 @@ declare void @printf(i8*, ...)
define void @test_simplify1() {
; CHECK-LABEL: @test_simplify1(
%fmt = getelementptr [2 x i8], [2 x i8]* @h, i32 0, i32 0
- call void (i8*, ...)* @printf(i8* %fmt)
+ call void (i8*, ...) @printf(i8* %fmt)
; CHECK-NEXT: call i32 @putchar(i32 104)
ret void
; CHECK-NEXT: ret void
@@ -24,7 +24,7 @@ define void @test_simplify1() {
define void @test_simplify2() {
; CHECK-LABEL: @test_simplify2(
%fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call void (i8*, ...)* @printf(i8* %fmt)
+ call void (i8*, ...) @printf(i8* %fmt)
; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i32 0, i32 0))
ret void
; CHECK-NEXT: ret void
@@ -34,7 +34,7 @@ define void @test_simplify6() {
; CHECK-LABEL: @test_simplify6(
%fmt = getelementptr [4 x i8], [4 x i8]* @percent_s, i32 0, i32 0
%str = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call void (i8*, ...)* @printf(i8* %fmt, i8* %str)
+ call void (i8*, ...) @printf(i8* %fmt, i8* %str)
; CHECK-NEXT: call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0))
ret void
; CHECK-NEXT: ret void
diff --git a/test/Transforms/InstCombine/select-crash-noverify.ll b/test/Transforms/InstCombine/select-crash-noverify.ll
new file mode 100644
index 0000000..4a366aa
--- /dev/null
+++ b/test/Transforms/InstCombine/select-crash-noverify.ll
@@ -0,0 +1,19 @@
+; RUN: opt < %s -disable-verify -instcombine -S | opt -S | FileCheck %s
+; Formerly crashed, PR8490.
+
+; CHECK-LABEL: @test3(
+define i32 @test3(i1 %bool, i32 %a) {
+entry:
+ %cond = or i1 %bool, true
+ br i1 %cond, label %return, label %xpto
+
+; technically reachable, but this malformed IR may appear as a result of constant propagation
+xpto:
+ %select = select i1 %bool, i32 %a, i32 %select
+ %select2 = select i1 %bool, i32 %select2, i32 %a
+ %sum = add i32 %select, %select2
+ ret i32 %sum
+
+return:
+ ret i32 7
+}
diff --git a/test/Transforms/InstCombine/select-crash.ll b/test/Transforms/InstCombine/select-crash.ll
index 77446cd..991635b 100644
--- a/test/Transforms/InstCombine/select-crash.ll
+++ b/test/Transforms/InstCombine/select-crash.ll
@@ -30,20 +30,3 @@ define <4 x float> @foo(i1 %b, <4 x float> %x, <4 x float> %y, <4 x float> %z) {
%sel = select i1 %b, <4 x float> %a, <4 x float> %sub
ret <4 x float> %sel
}
-
-; CHECK-LABEL: @test3(
-define i32 @test3(i1 %bool, i32 %a) {
-entry:
- %cond = or i1 %bool, true
- br i1 %cond, label %return, label %xpto
-
-; technically reachable, but this malformed IR may appear as a result of constant propagation
-xpto:
- %select = select i1 %bool, i32 %a, i32 %select
- %select2 = select i1 %bool, i32 %select2, i32 %a
- %sum = add i32 %select, %select2
- ret i32 %sum
-
-return:
- ret i32 7
-}
diff --git a/test/Transforms/InstCombine/select.ll b/test/Transforms/InstCombine/select.ll
index e4cc6f5..ef122c9 100644
--- a/test/Transforms/InstCombine/select.ll
+++ b/test/Transforms/InstCombine/select.ll
@@ -423,11 +423,11 @@ jump:
%c = or i1 false, false
br label %ret
ret:
- %a = phi i1 [true, %jump], [%c, %entry]
- %b = select i1 %a, i32 10, i32 20
+ %a = phi i1 [true, %entry], [%c, %jump]
+ %b = select i1 %a, i32 20, i32 10
ret i32 %b
; CHECK-LABEL: @test26(
-; CHECK: %a = phi i32 [ 10, %jump ], [ 20, %entry ]
+; CHECK: %a = phi i32 [ 20, %entry ], [ 10, %jump ]
; CHECK-NEXT: ret i32 %a
}
diff --git a/test/Transforms/InstCombine/simplify-libcalls.ll b/test/Transforms/InstCombine/simplify-libcalls.ll
index c569cdd..7cc6710 100644
--- a/test/Transforms/InstCombine/simplify-libcalls.ll
+++ b/test/Transforms/InstCombine/simplify-libcalls.ll
@@ -6,7 +6,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
declare i32 @sprintf(i8*, i8*, ...)
define void @foo(i8* %P, i32* %X) {
- call i32 (i8*, i8*, ...)* @sprintf( i8* %P, i8* getelementptr ([3 x i8], [3 x i8]* @G, i32 0, i32 0), i32* %X ) ; <i32>:1 [#uses=0]
+ call i32 (i8*, i8*, ...) @sprintf( i8* %P, i8* getelementptr ([3 x i8], [3 x i8]* @G, i32 0, i32 0), i32* %X ) ; <i32>:1 [#uses=0]
ret void
}
diff --git a/test/Transforms/InstCombine/sprintf-1.ll b/test/Transforms/InstCombine/sprintf-1.ll
index ec188c6..ddf2f2f 100644
--- a/test/Transforms/InstCombine/sprintf-1.ll
+++ b/test/Transforms/InstCombine/sprintf-1.ll
@@ -21,7 +21,7 @@ declare i32 @sprintf(i8*, i8*, ...)
define void @test_simplify1(i8* %dst) {
; CHECK-LABEL: @test_simplify1(
%fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt)
; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 13, i32 1, i1 false)
ret void
; CHECK-NEXT: ret void
@@ -30,7 +30,7 @@ define void @test_simplify1(i8* %dst) {
define void @test_simplify2(i8* %dst) {
; CHECK-LABEL: @test_simplify2(
%fmt = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt)
; CHECK-NEXT: store i8 0, i8* %dst, align 1
ret void
; CHECK-NEXT: ret void
@@ -39,7 +39,7 @@ define void @test_simplify2(i8* %dst) {
define void @test_simplify3(i8* %dst) {
; CHECK-LABEL: @test_simplify3(
%fmt = getelementptr [7 x i8], [7 x i8]* @null_hello, i32 0, i32 0
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt)
; CHECK-NEXT: store i8 0, i8* %dst, align 1
ret void
; CHECK-NEXT: ret void
@@ -50,7 +50,7 @@ define void @test_simplify3(i8* %dst) {
define void @test_simplify4(i8* %dst) {
; CHECK-LABEL: @test_simplify4(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_c, i32 0, i32 0
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i8 104)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt, i8 104)
; CHECK-NEXT: store i8 104, i8* %dst, align 1
; CHECK-NEXT: [[NUL:%[a-z0-9]+]] = getelementptr i8, i8* %dst, i32 1
; CHECK-NEXT: store i8 0, i8* [[NUL]], align 1
@@ -63,7 +63,7 @@ define void @test_simplify4(i8* %dst) {
define void @test_simplify5(i8* %dst, i8* %str) {
; CHECK-LABEL: @test_simplify5(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i8* %str)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt, i8* %str)
; CHECK-NEXT: [[STRLEN:%[a-z0-9]+]] = call i32 @strlen(i8* %str)
; CHECK-NEXT: [[LENINC:%[a-z0-9]+]] = add i32 [[STRLEN]], 1
; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %str, i32 [[LENINC]], i32 1, i1 false)
@@ -76,8 +76,8 @@ define void @test_simplify5(i8* %dst, i8* %str) {
define void @test_simplify6(i8* %dst) {
; CHECK-IPRINTF-LABEL: @test_simplify6(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_d, i32 0, i32 0
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, i32 187)
-; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...)* @siprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt, i32 187)
+; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...) @siprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187)
ret void
; CHECK-IPRINTF-NEXT: ret void
}
@@ -85,16 +85,16 @@ define void @test_simplify6(i8* %dst) {
define void @test_no_simplify1(i8* %dst) {
; CHECK-IPRINTF-LABEL: @test_no_simplify1(
%fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, double 1.87)
-; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt, double 1.87)
+; CHECK-IPRINTF-NEXT: call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00)
ret void
; CHECK-IPRINTF-NEXT: ret void
}
define void @test_no_simplify2(i8* %dst, i8* %fmt, double %d) {
; CHECK-LABEL: @test_no_simplify2(
- call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, double %d)
-; CHECK-NEXT: call i32 (i8*, i8*, ...)* @sprintf(i8* %dst, i8* %fmt, double %d)
+ call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt, double %d)
+; CHECK-NEXT: call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt, double %d)
ret void
; CHECK-NEXT: ret void
}
diff --git a/test/Transforms/InstCombine/sqrt.ll b/test/Transforms/InstCombine/sqrt.ll
index 24c2e00..bf44e4f 100644
--- a/test/Transforms/InstCombine/sqrt.ll
+++ b/test/Transforms/InstCombine/sqrt.ll
@@ -44,7 +44,7 @@ entry:
%add19 = fadd float undef, %mul18
%conv = fpext float %add19 to double
%call34 = call double @sqrt(double %conv) readnone
- %call36 = call i32 (double)* @foo(double %call34) nounwind
+ %call36 = call i32 (double) @foo(double %call34) nounwind
%conv38 = fptrunc double %call34 to float
ret float %conv38
}
diff --git a/test/Transforms/InstCombine/srem1.ll b/test/Transforms/InstCombine/srem1.ll
index f18690c..31452d8 100644
--- a/test/Transforms/InstCombine/srem1.ll
+++ b/test/Transforms/InstCombine/srem1.ll
@@ -5,7 +5,7 @@
define i32 @func_56(i32 %p_58, i32 %p_59, i32 %p_61, i16 signext %p_62) nounwind {
entry:
- %call = call i32 (...)* @rshift_s_s( i32 %p_61, i32 1 ) ; <i32> [#uses=1]
+ %call = call i32 (...) @rshift_s_s( i32 %p_61, i32 1 ) ; <i32> [#uses=1]
%conv = sext i32 %call to i64 ; <i64> [#uses=1]
%or = or i64 -1734012817166602727, %conv ; <i64> [#uses=1]
%rem = srem i64 %or, 1 ; <i64> [#uses=1]
diff --git a/test/Transforms/InstCombine/statepoint.ll b/test/Transforms/InstCombine/statepoint.ll
index bee219d..ec99117 100644
--- a/test/Transforms/InstCombine/statepoint.ll
+++ b/test/Transforms/InstCombine/statepoint.ll
@@ -5,9 +5,9 @@
declare void @func()
-define i1 @test_negative(i32 addrspace(1)* %p) {
+define i1 @test_negative(i32 addrspace(1)* %p) gc "statepoint-example" {
entry:
- %safepoint_token = tail call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* %p)
+ %safepoint_token = tail call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* %p)
%pnew = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 4, i32 4)
%cmp = icmp eq i32 addrspace(1)* %pnew, null
ret i1 %cmp
@@ -16,9 +16,9 @@ entry:
; CHECK: ret i1 %cmp
}
-define i1 @test_nonnull(i32 addrspace(1)* nonnull %p) {
+define i1 @test_nonnull(i32 addrspace(1)* nonnull %p) gc "statepoint-example" {
entry:
- %safepoint_token = tail call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* %p)
+ %safepoint_token = tail call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* %p)
%pnew = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 4, i32 4)
%cmp = icmp eq i32 addrspace(1)* %pnew, null
ret i1 %cmp
@@ -26,9 +26,9 @@ entry:
; CHECK: ret i1 false
}
-define i1 @test_null() {
+define i1 @test_null() gc "statepoint-example" {
entry:
- %safepoint_token = tail call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* null)
+ %safepoint_token = tail call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* null)
%pnew = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 4, i32 4)
%cmp = icmp eq i32 addrspace(1)* %pnew, null
ret i1 %cmp
@@ -37,9 +37,9 @@ entry:
; CHECK: ret i1 true
}
-define i1 @test_undef() {
+define i1 @test_undef() gc "statepoint-example" {
entry:
- %safepoint_token = tail call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* undef)
+ %safepoint_token = tail call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @func, i32 0, i32 0, i32 0, i32 addrspace(1)* undef)
%pnew = call i32 addrspace(1)* @llvm.experimental.gc.relocate.p1i32(i32 %safepoint_token, i32 4, i32 4)
%cmp = icmp eq i32 addrspace(1)* %pnew, null
ret i1 %cmp
diff --git a/test/Transforms/InstCombine/urem-simplify-bug.ll b/test/Transforms/InstCombine/urem-simplify-bug.ll
index 6dd27e9..1220dfd 100644
--- a/test/Transforms/InstCombine/urem-simplify-bug.ll
+++ b/test/Transforms/InstCombine/urem-simplify-bug.ll
@@ -23,7 +23,7 @@ bb14: ; preds = %entry
bb15: ; preds = %bb14, %bb
%iftmp.0.0 = phi i8* [ getelementptr ([5 x i8], [5 x i8]* @.str1, i32 0, i32 0), %bb14 ], [ getelementptr ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), %bb ] ; <i8*> [#uses=1]
- %tmp17 = call i32 (i8*, ...)* @printf( i8* %iftmp.0.0 ) nounwind ; <i32> [#uses=0]
+ %tmp17 = call i32 (i8*, ...) @printf( i8* %iftmp.0.0 ) nounwind ; <i32> [#uses=0]
ret i32 0
}
diff --git a/test/Transforms/InstCombine/vec_demanded_elts.ll b/test/Transforms/InstCombine/vec_demanded_elts.ll
index 8a8b834..4245c7a 100644
--- a/test/Transforms/InstCombine/vec_demanded_elts.ll
+++ b/test/Transforms/InstCombine/vec_demanded_elts.ll
@@ -350,19 +350,19 @@ define <8 x float> @test_vpermilvar_ps_256(<8 x float> %v) {
ret <8 x float> %a
}
-declare <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double>, <2 x i32>)
+declare <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double>, <2 x i64>)
define <2 x double> @test_vpermilvar_pd(<2 x double> %v) {
; CHECK-LABEL: @test_vpermilvar_pd(
; CHECK: shufflevector <2 x double> %v, <2 x double> undef, <2 x i32> <i32 1, i32 0>
- %a = tail call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> %v, <2 x i32> <i32 2, i32 0>)
+ %a = tail call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> %v, <2 x i64> <i64 2, i64 0>)
ret <2 x double> %a
}
-declare <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double>, <4 x i32>)
+declare <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double>, <4 x i64>)
define <4 x double> @test_vpermilvar_pd_256(<4 x double> %v) {
; CHECK-LABEL: @test_vpermilvar_pd_256(
; CHECK: shufflevector <4 x double> %v, <4 x double> undef, <4 x i32> <i32 1, i32 0, i32 3, i32 2>
- %a = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %v, <4 x i32> <i32 3, i32 1, i32 2, i32 0>)
+ %a = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %v, <4 x i64> <i64 3, i64 1, i64 2, i64 0>)
ret <4 x double> %a
}
@@ -383,14 +383,14 @@ define <8 x float> @test_vpermilvar_ps_256_zero(<8 x float> %v) {
define <2 x double> @test_vpermilvar_pd_zero(<2 x double> %v) {
; CHECK-LABEL: @test_vpermilvar_pd_zero(
; CHECK: shufflevector <2 x double> %v, <2 x double> undef, <2 x i32> zeroinitializer
- %a = tail call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> %v, <2 x i32> zeroinitializer)
+ %a = tail call <2 x double> @llvm.x86.avx.vpermilvar.pd(<2 x double> %v, <2 x i64> zeroinitializer)
ret <2 x double> %a
}
define <4 x double> @test_vpermilvar_pd_256_zero(<4 x double> %v) {
; CHECK-LABEL: @test_vpermilvar_pd_256_zero(
; CHECK: shufflevector <4 x double> %v, <4 x double> undef, <4 x i32> <i32 0, i32 0, i32 2, i32 2>
- %a = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %v, <4 x i32> zeroinitializer)
+ %a = tail call <4 x double> @llvm.x86.avx.vpermilvar.pd.256(<4 x double> %v, <4 x i64> zeroinitializer)
ret <4 x double> %a
}
diff --git a/test/Transforms/InstCombine/vec_shuffle.ll b/test/Transforms/InstCombine/vec_shuffle.ll
index 164e315..d4d7f16 100644
--- a/test/Transforms/InstCombine/vec_shuffle.ll
+++ b/test/Transforms/InstCombine/vec_shuffle.ll
@@ -414,3 +414,11 @@ define <4 x i32> @pr20114(<4 x i32> %__mask) {
%masked_new.i.i.i = and <4 x i32> bitcast (<2 x i64> <i64 ptrtoint (<4 x i32> (<4 x i32>)* @pr20114 to i64), i64 ptrtoint (<4 x i32> (<4 x i32>)* @pr20114 to i64)> to <4 x i32>), %mask01.i
ret <4 x i32> %masked_new.i.i.i
}
+
+define <2 x i32*> @pr23113(<4 x i32*> %A) {
+; CHECK-LABEL: @pr23113
+; CHECK: %[[V:.*]] = shufflevector <4 x i32*> %A, <4 x i32*> undef, <2 x i32> <i32 0, i32 1>
+; CHECK-NEXT: ret <2 x i32*> %[[V]]
+ %1 = shufflevector <4 x i32*> %A, <4 x i32*> undef, <2 x i32> <i32 0, i32 1>
+ ret <2 x i32*> %1
+}
diff --git a/test/Transforms/InstCombine/x86-insertps.ll b/test/Transforms/InstCombine/x86-insertps.ll
new file mode 100644
index 0000000..487c727
--- /dev/null
+++ b/test/Transforms/InstCombine/x86-insertps.ll
@@ -0,0 +1,117 @@
+; RUN: opt < %s -instcombine -S | FileCheck %s
+
+declare <4 x float> @llvm.x86.sse41.insertps(<4 x float>, <4 x float>, i8) nounwind readnone
+
+; This should never happen, but make sure we don't crash handling a non-constant immediate byte.
+
+define <4 x float> @insertps_non_const_imm(<4 x float> %v1, <4 x float> %v2, i8 %c) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 %c)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_non_const_imm
+; CHECK-NEXT: call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 %c)
+; CHECK-NEXT: ret <4 x float>
+}
+
+; If all zero mask bits are set, return a zero regardless of the other control bits.
+
+define <4 x float> @insertps_0x0f(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 15)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0x0f
+; CHECK-NEXT: ret <4 x float> zeroinitializer
+}
+define <4 x float> @insertps_0xff(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 255)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0xff
+; CHECK-NEXT: ret <4 x float> zeroinitializer
+}
+
+; If some zero mask bits are set, we do not change anything.
+
+define <4 x float> @insertps_0x03(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 3)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0x03
+; CHECK-NEXT: call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 3)
+; CHECK-NEXT: ret <4 x float>
+}
+
+; If no zero mask bits are set, convert to a shuffle.
+
+define <4 x float> @insertps_0x00(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 0)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0x00
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 4, i32 1, i32 2, i32 3>
+; CHECK-NEXT: ret <4 x float>
+}
+
+define <4 x float> @insertps_0x10(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 16)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0x10
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 0, i32 4, i32 2, i32 3>
+; CHECK-NEXT: ret <4 x float>
+}
+
+define <4 x float> @insertps_0x20(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 32)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0x20
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 0, i32 1, i32 4, i32 3>
+; CHECK-NEXT: ret <4 x float>
+}
+
+define <4 x float> @insertps_0x30(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 48)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0x30
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 0, i32 1, i32 2, i32 4>
+; CHECK-NEXT: ret <4 x float>
+}
+
+define <4 x float> @insertps_0xc0(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 192)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0xc0
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 7, i32 1, i32 2, i32 3>
+; CHECK-NEXT: ret <4 x float>
+}
+
+define <4 x float> @insertps_0xd0(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 208)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0xd0
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 0, i32 7, i32 2, i32 3>
+; CHECK-NEXT: ret <4 x float>
+}
+
+define <4 x float> @insertps_0xe0(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 224)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0xe0
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 0, i32 1, i32 7, i32 3>
+; CHECK-NEXT: ret <4 x float>
+}
+
+define <4 x float> @insertps_0xf0(<4 x float> %v1, <4 x float> %v2) {
+ %res = call <4 x float> @llvm.x86.sse41.insertps(<4 x float> %v1, <4 x float> %v2, i8 240)
+ ret <4 x float> %res
+
+; CHECK-LABEL: @insertps_0xf0
+; CHECK-NEXT: shufflevector <4 x float> %v1, <4 x float> %v2, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
+; CHECK-NEXT: ret <4 x float>
+}
+
diff --git a/test/Transforms/InstSimplify/undef.ll b/test/Transforms/InstSimplify/undef.ll
index e8b49b6..f1f0b03 100644
--- a/test/Transforms/InstSimplify/undef.ll
+++ b/test/Transforms/InstSimplify/undef.ll
@@ -150,7 +150,7 @@ define i64 @test17(i64 %a) {
; @test18
; CHECK: ret i64 undef
define i64 @test18(i64 %a) {
- %r = call i64 (i64)* undef(i64 %a)
+ %r = call i64 (i64) undef(i64 %a)
ret i64 %r
}
diff --git a/test/Transforms/JumpThreading/2010-08-26-and.ll b/test/Transforms/JumpThreading/2010-08-26-and.ll
index c0a6b47..cc56ac9 100644
--- a/test/Transforms/JumpThreading/2010-08-26-and.ll
+++ b/test/Transforms/JumpThreading/2010-08-26-and.ll
@@ -147,7 +147,7 @@ _ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit134: ; preds = %if.the
%tmp7.i138 = and i8 %tmp2.i137, 1 ; <i8> [#uses=1]
%tobool.i139 = icmp eq i8 %tmp7.i138, 0 ; <i1> [#uses=1]
%retval.0.i = select i1 %tobool.i139, i32 0, i32 %retval.0.i.pre ; <i32> [#uses=1]
- %call22 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str7, i64 0, i64 0), i32 %retval.0.i) ; <i32> [#uses=0]
+ %call22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str7, i64 0, i64 0), i32 %retval.0.i) ; <i32> [#uses=0]
%exitcond = icmp eq i64 %tmp146, %tmp145 ; <i1> [#uses=1]
br i1 %exitcond, label %for.end, label %land.lhs.true.i
diff --git a/test/Transforms/JumpThreading/assume.ll b/test/Transforms/JumpThreading/assume.ll
index 89dd0a9..53010b7 100644
--- a/test/Transforms/JumpThreading/assume.ll
+++ b/test/Transforms/JumpThreading/assume.ll
@@ -21,11 +21,11 @@ if.then: ; preds = %entry
br i1 %cmp2, label %if.then3, label %return
if.then3: ; preds = %if.then
- tail call void (...)* @bar() #1
+ tail call void (...) @bar() #1
br label %return
if.else: ; preds = %entry
- tail call void (...)* @car() #1
+ tail call void (...) @car() #1
br label %return
return: ; preds = %if.else, %if.then, %if.then3
@@ -43,12 +43,12 @@ entry:
; CHECK-LABEL: @test2
; CHECK: icmp sgt i32 %a, 5
; CHECK: tail call void @llvm.assume
-; CHECK: tail call void (...)* @bar()
+; CHECK: tail call void (...) @bar()
; CHECK: ret i32 1
if.then: ; preds = %entry
- tail call void (...)* @bar() #1
+ tail call void (...) @bar() #1
br label %return
return: ; preds = %entry, %if.then
diff --git a/test/Transforms/JumpThreading/indirectbr.ll b/test/Transforms/JumpThreading/indirectbr.ll
index 59f393a..197ca30 100644
--- a/test/Transforms/JumpThreading/indirectbr.ll
+++ b/test/Transforms/JumpThreading/indirectbr.ll
@@ -79,15 +79,15 @@ entry:
br label %__here
__here: ; preds = %entry
- %call = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here) to i64)) nounwind noredzone
+ %call = call i32 (...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here) to i64)) nounwind noredzone
br label %__here1
__here1: ; preds = %__here
- %call2 = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here1) to i64)) nounwind noredzone
+ %call2 = call i32 (...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here1) to i64)) nounwind noredzone
br label %__here3
__here3: ; preds = %__here1
- %call4 = call i32 (...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here3) to i64)) nounwind noredzone
+ %call4 = call i32 (...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i64 ptrtoint (i8* blockaddress(@test3, %__here3) to i64)) nounwind noredzone
ret void
}
diff --git a/test/Transforms/JumpThreading/thread-loads.ll b/test/Transforms/JumpThreading/thread-loads.ll
index 008eac7..f76c1ec 100644
--- a/test/Transforms/JumpThreading/thread-loads.ll
+++ b/test/Transforms/JumpThreading/thread-loads.ll
@@ -8,7 +8,7 @@ target triple = "i386-apple-darwin7"
define i32 @test1(i32* %P) nounwind {
; CHECK-LABEL: @test1(
entry:
- %0 = tail call i32 (...)* @f1() nounwind ; <i32> [#uses=1]
+ %0 = tail call i32 (...) @f1() nounwind ; <i32> [#uses=1]
%1 = icmp eq i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %bb1, label %bb
@@ -26,7 +26,7 @@ bb1: ; preds = %entry, %bb
br i1 %3, label %bb3, label %bb2
bb2: ; preds = %bb1
- %4 = tail call i32 (...)* @f2() nounwind ; <i32> [#uses=0]
+ %4 = tail call i32 (...) @f2() nounwind ; <i32> [#uses=0]
ret i32 %res.0
bb3: ; preds = %bb1
@@ -47,7 +47,7 @@ declare i32 @f2(...)
define i32 @test2(i32* %P) nounwind {
; CHECK-LABEL: @test2(
entry:
- %0 = tail call i32 (...)* @f1() nounwind ; <i32> [#uses=1]
+ %0 = tail call i32 (...) @f1() nounwind ; <i32> [#uses=1]
%1 = icmp eq i32 %0, 0 ; <i1> [#uses=1]
br i1 %1, label %bb1, label %bb
@@ -65,7 +65,7 @@ bb1: ; preds = %entry, %bb
br i1 %3, label %bb3, label %bb2
bb2: ; preds = %bb1
- %4 = tail call i32 (...)* @f2() nounwind
+ %4 = tail call i32 (...) @f2() nounwind
ret i32 %res.0
bb3: ; preds = %bb1
diff --git a/test/Transforms/LICM/2011-04-09-RAUW-AST.ll b/test/Transforms/LICM/2011-04-09-RAUW-AST.ll
index f5ef29c..bf069c2 100644
--- a/test/Transforms/LICM/2011-04-09-RAUW-AST.ll
+++ b/test/Transforms/LICM/2011-04-09-RAUW-AST.ll
@@ -41,7 +41,7 @@ for.inc10: ; preds = %for.cond4
for.end13: ; preds = %for.cond
%tmp14 = load i32, i32* @g_3, align 4
- %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %tmp14) nounwind
+ %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %tmp14) nounwind
ret i32 0
}
diff --git a/test/Transforms/LoopIdiom/debug-line.ll b/test/Transforms/LoopIdiom/debug-line.ll
index 84bfafd..1bedf7b 100644
--- a/test/Transforms/LoopIdiom/debug-line.ll
+++ b/test/Transforms/LoopIdiom/debug-line.ll
@@ -39,7 +39,7 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon
!6 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, scope: !2, baseType: !7)
!7 = !MDBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
!8 = !MDLocation(line: 2, column: 18, scope: !0)
-!9 = !{i32 0}
+!9 = !{}
!10 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "i", line: 3, scope: !11, file: !1, type: !13)
!11 = distinct !MDLexicalBlock(line: 3, column: 3, file: !18, scope: !12)
!12 = distinct !MDLexicalBlock(line: 2, column: 21, file: !18, scope: !0)
diff --git a/test/Transforms/LoopInterchange/interchange.ll b/test/Transforms/LoopInterchange/interchange.ll
index 30a4a71..3994166 100644
--- a/test/Transforms/LoopInterchange/interchange.ll
+++ b/test/Transforms/LoopInterchange/interchange.ll
@@ -376,7 +376,7 @@ for.body.lr.ph:
for.body:
%indvars.iv24 = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next25, %for.inc10 ]
- tail call void (...)* @foo()
+ tail call void (...) @foo()
br label %for.body3
for.body3:
diff --git a/test/Transforms/LoopRotate/PhiRename-1.ll b/test/Transforms/LoopRotate/PhiRename-1.ll
index 8ec0fbf..6d75888 100644
--- a/test/Transforms/LoopRotate/PhiRename-1.ll
+++ b/test/Transforms/LoopRotate/PhiRename-1.ll
@@ -60,7 +60,7 @@ cond_true: ; preds = %bb
%tmp12 = load i32, i32* %tmp11 ; <i32> [#uses=1]
%tmp13 = load %struct.FILE*, %struct.FILE** @outfile ; <%struct.FILE*> [#uses=1]
%tmp14 = getelementptr [11 x i8], [11 x i8]* @str1, i32 0, i32 0 ; <i8*> [#uses=1]
- %tmp15 = call i32 (%struct.FILE*, i8*, ...)* @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 ) ; <i32> [#uses=0]
+ %tmp15 = call i32 (%struct.FILE*, i8*, ...) @fprintf( %struct.FILE* %tmp13, i8* %tmp14, i32 %tmp12 ) ; <i32> [#uses=0]
%tmp16 = load i32, i32* %c ; <i32> [#uses=1]
%tmp17 = add i32 %tmp16, 1 ; <i32> [#uses=1]
store i32 %tmp17, i32* %c
diff --git a/test/Transforms/LoopRotate/dbgvalue.ll b/test/Transforms/LoopRotate/dbgvalue.ll
index 075cdf9..88348b0 100644
--- a/test/Transforms/LoopRotate/dbgvalue.ll
+++ b/test/Transforms/LoopRotate/dbgvalue.ll
@@ -72,7 +72,7 @@ for.body:
for.inc:
%dec = add i64 %i.0, -1
- tail call void @llvm.dbg.value(metadata i64 %dec, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !0), metadata !MDExpression())
+ tail call void @llvm.dbg.value(metadata i64 %dec, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !0), metadata !MDExpression()), !dbg !MDLocation(scope: !0)
br label %for.cond
for.end:
diff --git a/test/Transforms/LoopSimplify/dup-preds.ll b/test/Transforms/LoopSimplify/dup-preds.ll
index 3d1f149..c9253fa 100644
--- a/test/Transforms/LoopSimplify/dup-preds.ll
+++ b/test/Transforms/LoopSimplify/dup-preds.ll
@@ -28,7 +28,7 @@ for.body305: ; preds = %for.body305, %if.th
br label %for.body305
for.body344: ; preds = %for.body344, %for.body276.lr.ph, %for.body276.lr.ph
- %indvar = phi i64 [ %indvar.next, %for.body344 ], [ 0, %for.body276.lr.ph ]
+ %indvar = phi i64 [ %indvar.next, %for.body344 ], [ 0, %for.body276.lr.ph ], [ 0, %for.body276.lr.ph ]
%indvars.iv552 = phi i64 [ %indvars.iv.next553, %for.body344 ], [ 0, %for.body276.lr.ph ], [ 0, %for.body276.lr.ph ]
%indvars.iv.next553 = add nuw nsw i64 %indvars.iv552, 1
%indvar.next = add i64 %indvar, 1
diff --git a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll
index d1454cf..394969c 100644
--- a/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll
+++ b/test/Transforms/LoopStrengthReduce/2008-08-13-CmpStride.ll
@@ -28,7 +28,7 @@ entry:
tail call void @func_1( ) nounwind
load volatile i16, i16* @g_3, align 2 ; <i16>:0 [#uses=1]
zext i16 %0 to i32 ; <i32>:1 [#uses=1]
- tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %1 ) nounwind ; <i32>:2 [#uses=0]
+ tail call i32 (i8*, ...) @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %1 ) nounwind ; <i32>:2 [#uses=0]
ret i32 0
}
diff --git a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll
index 481569c..5904434 100644
--- a/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll
+++ b/test/Transforms/LoopStrengthReduce/2008-09-09-Overflow.ll
@@ -45,7 +45,7 @@ define i32 @main() nounwind {
entry:
tail call void @func_1( ) nounwind
load i32, i32* @g_19, align 4 ; <i32>:0 [#uses=1]
- tail call i32 (i8*, ...)* @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %0 ) nounwind ; <i32>:1 [#uses=0]
+ tail call i32 (i8*, ...) @printf( i8* getelementptr ([4 x i8], [4 x i8]* @"\01LC", i32 0, i32 0), i32 %0 ) nounwind ; <i32>:1 [#uses=0]
ret i32 0
}
diff --git a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll
index 8304f76..c287b10 100644
--- a/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll
+++ b/test/Transforms/LoopStrengthReduce/2009-01-13-nonconstant-stride-outside-loop.ll
@@ -34,6 +34,6 @@ nactive_heaps.exit: ; preds = %bb2.i3, %bb1.i
%3 = load i32, i32* @heap_size, align 4 ; <i32> [#uses=1]
%4 = mul i32 %3, %m.0.i ; <i32> [#uses=1]
%5 = sub i32 %4, 0 ; <i32> [#uses=1]
- %6 = tail call i32 (i8*, i8*, ...)* @sprintf(i8* null, i8* getelementptr ([39 x i8], [39 x i8]* @"\01LC85", i32 0, i32 0), i32 %m.0.i, i32 0, i32 %5, i32 0) nounwind ; <i32> [#uses=0]
+ %6 = tail call i32 (i8*, i8*, ...) @sprintf(i8* null, i8* getelementptr ([39 x i8], [39 x i8]* @"\01LC85", i32 0, i32 0), i32 %m.0.i, i32 0, i32 %5, i32 0) nounwind ; <i32> [#uses=0]
ret %struct.obj* null
}
diff --git a/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll b/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll
index dba97f5..aaac868 100644
--- a/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll
+++ b/test/Transforms/LoopStrengthReduce/2012-07-18-LimitReassociate.ll
@@ -47,8 +47,8 @@ bb:
br i1 %tmp4, label %bb6, label %bb5
bb5: ; preds = %bb
- tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2021) nounwind
- tail call void (...)* @snork(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 1), i32 -2146631418) nounwind
+ tail call void (...) @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2021) nounwind
+ tail call void (...) @snork(i8* getelementptr inbounds (%struct.jim, %struct.jim* @global3, i64 0, i32 3, i64 1), i32 -2146631418) nounwind
unreachable
bb6: ; preds = %bb
@@ -95,8 +95,8 @@ bb30: ; preds = %bb22
br i1 %tmp31, label %bb33, label %bb32
bb32: ; preds = %bb30, %bb26, %bb17
- tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2038) nounwind
- tail call void (...)* @snork(i8* %tmp11, i32 -2146631418) nounwind
+ tail call void (...) @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2038) nounwind
+ tail call void (...) @snork(i8* %tmp11, i32 -2146631418) nounwind
unreachable
bb33: ; preds = %bb30
@@ -141,8 +141,8 @@ bb55: ; preds = %bb48
br i1 %tmp57, label %bb59, label %bb58
bb58: ; preds = %bb55, %bb52, %bb43
- tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2055) nounwind
- tail call void (...)* @snork(i8* %tmp38, i32 -2146631418) nounwind
+ tail call void (...) @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2055) nounwind
+ tail call void (...) @snork(i8* %tmp38, i32 -2146631418) nounwind
br label %bb247
bb59: ; preds = %bb55
@@ -168,7 +168,7 @@ bb68: ; preds = %bb59
]
bb69: ; preds = %bb68
- tail call void (...)* @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2071) nounwind
+ tail call void (...) @snork(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @global1, i64 0, i64 0), i32 2071) nounwind
%tmp70 = load i32, i32* getelementptr inbounds (%struct.snork, %struct.snork* @global, i64 0, i32 2), align 4
unreachable
diff --git a/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll b/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll
index ba03597..f862c26 100644
--- a/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll
+++ b/test/Transforms/LoopStrengthReduce/X86/2008-08-14-ShadowIV.ll
@@ -54,7 +54,7 @@ return: ; preds = %bb, %entry
; Unable to eliminate cast due to potentional overflow.
define void @foobar3() nounwind {
entry:
- tail call i32 (...)* @nn( ) nounwind ; <i32>:0 [#uses=1]
+ tail call i32 (...) @nn( ) nounwind ; <i32>:0 [#uses=1]
icmp eq i32 %0, 0 ; <i1>:1 [#uses=1]
br i1 %1, label %return, label %bb
@@ -64,7 +64,7 @@ bb: ; preds = %bb, %entry
uitofp i32 %i.03 to double ; <double>:2 [#uses=1]
tail call void @foo( double %2 ) nounwind
add i32 %i.03, 1 ; <i32>:3 [#uses=2]
- tail call i32 (...)* @nn( ) nounwind ; <i32>:4 [#uses=1]
+ tail call i32 (...) @nn( ) nounwind ; <i32>:4 [#uses=1]
icmp ugt i32 %4, %3 ; <i1>:5 [#uses=1]
br i1 %5, label %bb, label %return
diff --git a/test/Transforms/LoopStrengthReduce/X86/pr17473.ll b/test/Transforms/LoopStrengthReduce/X86/pr17473.ll
index 093cf65..5b7bb88 100644
--- a/test/Transforms/LoopStrengthReduce/X86/pr17473.ll
+++ b/test/Transforms/LoopStrengthReduce/X86/pr17473.ll
@@ -55,7 +55,7 @@ for.end: ; preds = %fn3.exit
%conv7 = sext i8 %inc to i32
%add = add nsw i32 %conv7, %conv
store i32 %add, i32* @e, align 4
- %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %add) #2
+ %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %add) #2
ret i32 0
}
diff --git a/test/Transforms/LoopStrengthReduce/different-type-ivs.ll b/test/Transforms/LoopStrengthReduce/different-type-ivs.ll
index 8cdd264..c24f877 100644
--- a/test/Transforms/LoopStrengthReduce/different-type-ivs.ll
+++ b/test/Transforms/LoopStrengthReduce/different-type-ivs.ll
@@ -11,7 +11,7 @@ no_exit: ; preds = %no_exit, %entry
%X.0.0 = mul i16 %indvar.upgrd.1, 1234 ; <i16> [#uses=1]
%tmp. = mul i32 %indvar, 1234 ; <i32> [#uses=1]
%tmp.5 = sext i16 %X.0.0 to i32 ; <i32> [#uses=1]
- %tmp.3 = call i32 (...)* @bar( i32 %tmp.5, i32 %tmp. ) ; <i32> [#uses=0]
+ %tmp.3 = call i32 (...) @bar( i32 %tmp.5, i32 %tmp. ) ; <i32> [#uses=0]
%tmp.0 = call i1 @pred( ) ; <i1> [#uses=1]
%indvar.next = add i32 %indvar, 1 ; <i32> [#uses=1]
br i1 %tmp.0, label %return, label %no_exit
diff --git a/test/Transforms/LoopStrengthReduce/pr12018.ll b/test/Transforms/LoopStrengthReduce/pr12018.ll
index df969ee..9bdbf4e 100644
--- a/test/Transforms/LoopStrengthReduce/pr12018.ll
+++ b/test/Transforms/LoopStrengthReduce/pr12018.ll
@@ -16,7 +16,7 @@ for.body: ; preds = %_ZN8nsTArray9Elemen
%tmp = bitcast %struct.nsTArrayHeader* %add.ptr.i to %struct.nsTArray*
%arrayidx = getelementptr inbounds %struct.nsTArray, %struct.nsTArray* %tmp, i32 %i.06
%add = add nsw i32 %i.06, 1
- call void @llvm.dbg.value(metadata %struct.nsTArray* %aValues, i64 0, metadata !0, metadata !{}) nounwind
+ call void @llvm.dbg.value(metadata %struct.nsTArray* %aValues, i64 0, metadata !0, metadata !MDExpression()) nounwind, !dbg !MDLocation(scope: !MDSubprogram())
br label %_ZN8nsTArray9ElementAtEi.exit
_ZN8nsTArray9ElementAtEi.exit: ; preds = %for.body
@@ -35,4 +35,4 @@ declare %struct.nsTArrayHeader* @_ZN8nsTArray4Hdr2Ev()
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone
-!0 = !MDLocalVariable(tag: DW_TAG_arg_variable)
+!0 = !MDLocalVariable(tag: DW_TAG_arg_variable, scope: !MDSubprogram())
diff --git a/test/Transforms/LoopStrengthReduce/pr18165.ll b/test/Transforms/LoopStrengthReduce/pr18165.ll
index 42d960f..11c9c4e 100644
--- a/test/Transforms/LoopStrengthReduce/pr18165.ll
+++ b/test/Transforms/LoopStrengthReduce/pr18165.ll
@@ -64,7 +64,7 @@ fn1.exit: ; preds = %lor.end.i
store i32 %add.i, i32* getelementptr inbounds (%struct.anon, %struct.anon* @e, i64 0, i32 1), align 4, !tbaa !8
store i32 0, i32* @h, align 4, !tbaa !7
%3 = load i32, i32* @b, align 4, !tbaa !7
- %call1 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3) #2
+ %call1 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3) #2
ret i32 0
}
diff --git a/test/Transforms/LoopUnroll/high-cost-trip-count-computation.ll b/test/Transforms/LoopUnroll/high-cost-trip-count-computation.ll
new file mode 100644
index 0000000..6b1943f
--- /dev/null
+++ b/test/Transforms/LoopUnroll/high-cost-trip-count-computation.ll
@@ -0,0 +1,27 @@
+; RUN: opt -S -unroll-runtime -loop-unroll < %s | FileCheck %s
+
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+
+;; Check that we don't emit expensive instructions to compute trip
+;; counts when unrolling loops.
+
+define i32 @test(i64 %v12, i8* %array, i64* %loc) {
+; CHECK-LABEL: @test(
+; CHECK-NOT: udiv
+entry:
+ %step = load i64, i64* %loc, !range !0
+ br label %loop
+
+loop: ; preds = %entry, %loop
+ %k.015 = phi i64 [ %v15, %loop ], [ %v12, %entry ]
+ %v14 = getelementptr inbounds i8, i8* %array, i64 %k.015
+ store i8 0, i8* %v14
+ %v15 = add nuw nsw i64 %k.015, %step
+ %v16 = icmp slt i64 %v15, 8193
+ br i1 %v16, label %loop, label %loopexit
+
+loopexit: ; preds = %loop
+ ret i32 0
+}
+
+!0 = !{i64 1, i64 100}
diff --git a/test/Transforms/LoopUnroll/runtime-loop.ll b/test/Transforms/LoopUnroll/runtime-loop.ll
index 9e78edf..fea15b6 100644
--- a/test/Transforms/LoopUnroll/runtime-loop.ll
+++ b/test/Transforms/LoopUnroll/runtime-loop.ll
@@ -1,5 +1,7 @@
; RUN: opt < %s -S -loop-unroll -unroll-runtime=true | FileCheck %s
+target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
+
; Tests for unrolling loops with run-time trip counts
; CHECK: %xtraiter = and i32 %n
diff --git a/test/Transforms/LoopUnroll/runtime-loop4.ll b/test/Transforms/LoopUnroll/runtime-loop4.ll
index 9be0ffd..5014c73 100644
--- a/test/Transforms/LoopUnroll/runtime-loop4.ll
+++ b/test/Transforms/LoopUnroll/runtime-loop4.ll
@@ -20,7 +20,8 @@ loop1:
br label %loop2.header
loop2.header:
- br label %loop2
+ %e = icmp uge i32 %iter, 1
+ br i1 %e, label %loop2, label %exit2
loop2:
%iv2 = phi i32 [ 0, %loop2.header ], [ %inc2, %loop2 ]
diff --git a/test/Transforms/LoopUnroll/runtime-loop5.ll b/test/Transforms/LoopUnroll/runtime-loop5.ll
new file mode 100644
index 0000000..e8d5177
--- /dev/null
+++ b/test/Transforms/LoopUnroll/runtime-loop5.ll
@@ -0,0 +1,45 @@
+; RUN: opt < %s -S -loop-unroll -unroll-runtime=true -unroll-count=16 | FileCheck --check-prefix=UNROLL-16 %s
+; RUN: opt < %s -S -loop-unroll -unroll-runtime=true -unroll-count=4 | FileCheck --check-prefix=UNROLL-4 %s
+
+; Given that the trip-count of this loop is a 3-bit value, we cannot
+; safely unroll it with a count of anything more than 8.
+
+define i3 @test(i3* %a, i3 %n) {
+; UNROLL-16-LABEL: @test(
+; UNROLL-4-LABEL: @test(
+entry:
+ %cmp1 = icmp eq i3 %n, 0
+ br i1 %cmp1, label %for.end, label %for.body
+
+; UNROLL-16-NOT: for.body.prol:
+; UNROLL-4: for.body.prol:
+
+for.body: ; preds = %for.body, %entry
+; UNROLL-16-LABEL: for.body:
+; UNROLL-4-LABEL: for.body:
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ]
+ %sum.02 = phi i3 [ %add, %for.body ], [ 0, %entry ]
+ %arrayidx = getelementptr inbounds i3, i3* %a, i64 %indvars.iv
+
+; UNROLL-16-LABEL: for.body
+; UNROLL-16-LABEL: getelementptr
+; UNROLL-16-LABEL-NOT: getelementptr
+
+; UNROLL-4-LABEL: getelementptr
+; UNROLL-4-LABEL: getelementptr
+; UNROLL-4-LABEL: getelementptr
+; UNROLL-4-LABEL: getelementptr
+
+ %0 = load i3, i3* %arrayidx
+ %add = add nsw i3 %0, %sum.02
+ %indvars.iv.next = add i64 %indvars.iv, 1
+ %lftr.wideiv = trunc i64 %indvars.iv.next to i3
+ %exitcond = icmp eq i3 %lftr.wideiv, %n
+ br i1 %exitcond, label %for.end, label %for.body
+
+; UNROLL-16-LABEL: for.end
+; UNROLL-4-LABEL: for.end
+for.end: ; preds = %for.body, %entry
+ %sum.0.lcssa = phi i3 [ 0, %entry ], [ %add, %for.body ]
+ ret i3 %sum.0.lcssa
+}
diff --git a/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll b/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
index 906c2c5..8ea4ed3 100644
--- a/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
+++ b/test/Transforms/LoopUnswitch/2008-06-02-DomInfo.ll
@@ -19,7 +19,7 @@ bb54: ; preds = %bb31, %bb5, %bb
br i1 false, label %bb64, label %bb
bb64: ; preds = %bb54
%tmp6566 = sext i16 %p_6 to i32 ; <i32> [#uses=1]
- %tmp68 = tail call i32 (...)* @func_18( i32 1, i32 %tmp6566, i32 1 ) nounwind ; <i32> [#uses=0]
+ %tmp68 = tail call i32 (...) @func_18( i32 1, i32 %tmp6566, i32 1 ) nounwind ; <i32> [#uses=0]
ret i32 undef
}
diff --git a/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll b/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll
index 31dba79..90c0944 100644
--- a/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll
+++ b/test/Transforms/LoopUnswitch/2008-11-03-Invariant.ll
@@ -15,7 +15,7 @@ bb: ; preds = %bb.nph, %bb3
br i1 %1, label %bb2, label %bb1
bb1: ; preds = %bb
- %2 = tail call i32 (...)* @b() nounwind ; <i32> [#uses=0]
+ %2 = tail call i32 (...) @b() nounwind ; <i32> [#uses=0]
br label %bb2
bb2: ; preds = %bb, %bb1
diff --git a/test/Transforms/LoopVectorize/dbg.value.ll b/test/Transforms/LoopVectorize/dbg.value.ll
index f942ecc..c794ca0 100644
--- a/test/Transforms/LoopVectorize/dbg.value.ll
+++ b/test/Transforms/LoopVectorize/dbg.value.ll
@@ -45,7 +45,7 @@ attributes #1 = { nounwind readnone }
!llvm.module.flags = !{!26}
!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang", isOptimized: true, emissionKind: 0, file: !25, enums: !1, retainedTypes: !1, subprograms: !2, globals: !11)
-!1 = !{i32 0}
+!1 = !{}
!2 = !{!3}
!3 = !MDSubprogram(name: "test", linkageName: "test", line: 5, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !25, scope: !4, type: !5, function: i32 ()* @test, variables: !8)
!4 = !MDFile(filename: "test", directory: "/path/to/somewhere")
diff --git a/test/Transforms/LoopVectorize/debugloc.ll b/test/Transforms/LoopVectorize/debugloc.ll
index 97d9da0..b9f98cf 100644
--- a/test/Transforms/LoopVectorize/debugloc.ll
+++ b/test/Transforms/LoopVectorize/debugloc.ll
@@ -65,7 +65,7 @@ attributes #1 = { nounwind readnone }
!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 185038) (llvm/trunk 185097)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
!1 = !MDFile(filename: "-", directory: "/Volumes/Data/backedup/dev/os/llvm/debug")
-!2 = !{i32 0}
+!2 = !{}
!3 = !{!4}
!4 = !MDSubprogram(name: "f", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !6, type: !7, function: i32 (i32*, i32)* @f, variables: !12)
!5 = !MDFile(filename: "<stdin>", directory: "/Volumes/Data/backedup/dev/os/llvm/debug")
diff --git a/test/Transforms/LowerExpectIntrinsic/basic.ll b/test/Transforms/LowerExpectIntrinsic/basic.ll
index 5d72371..73d9f44 100644
--- a/test/Transforms/LowerExpectIntrinsic/basic.ll
+++ b/test/Transforms/LowerExpectIntrinsic/basic.ll
@@ -18,7 +18,7 @@ entry:
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call i32 (...)* @f()
+ %call = call i32 (...) @f()
store i32 %call, i32* %retval
br label %return
@@ -50,7 +50,7 @@ entry:
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call i32 (...)* @f()
+ %call = call i32 (...) @f()
store i32 %call, i32* %retval
br label %return
@@ -81,7 +81,7 @@ entry:
br i1 %tobool1, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call i32 (...)* @f()
+ %call = call i32 (...) @f()
store i32 %call, i32* %retval
br label %return
@@ -113,7 +113,7 @@ entry:
br i1 %tobool2, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call i32 (...)* @f()
+ %call = call i32 (...) @f()
store i32 %call, i32* %retval
br label %return
@@ -143,7 +143,7 @@ entry:
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call i32 (...)* @f()
+ %call = call i32 (...) @f()
store i32 %call, i32* %retval
br label %return
@@ -231,7 +231,7 @@ entry:
br i1 %tobool, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call i32 (...)* @f()
+ %call = call i32 (...) @f()
store i32 %call, i32* %retval
br label %return
@@ -260,7 +260,7 @@ entry:
br i1 %expval, label %if.then, label %if.end
if.then: ; preds = %entry
- %call = call i32 (...)* @f()
+ %call = call i32 (...) @f()
store i32 %call, i32* %retval
br label %return
diff --git a/test/Transforms/LowerInvoke/2003-12-10-Crash.ll b/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
index 31f3d42..fca8e86 100644
--- a/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
+++ b/test/Transforms/LowerInvoke/2003-12-10-Crash.ll
@@ -15,8 +15,11 @@ invoke_cont.0: ; preds = %then
to label %try_exit unwind label %try_catch
try_catch: ; preds = %invoke_cont.0, %then
%__tmp.0 = phi i32* [ null, %invoke_cont.0 ], [ null, %then ] ; <i32*> [#uses=0]
+ %res = landingpad { i8* } personality i32 (...)* @__gxx_personality_v0
+ cleanup
ret void
try_exit: ; preds = %invoke_cont.0
ret void
}
+declare i32 @__gxx_personality_v0(...)
diff --git a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
index 2a009ab..7a55b07 100644
--- a/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
+++ b/test/Transforms/Mem2Reg/ConvertDebugInfo.ll
@@ -48,5 +48,5 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
!10 = !MDLocation(line: 3, scope: !11)
!11 = distinct !MDLexicalBlock(line: 2, column: 0, file: !12, scope: !1)
!12 = !MDFile(filename: "testfunc.c", directory: "/tmp")
-!13 = !{i32 0}
+!13 = !{}
!14 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll b/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
index 0d9e3de..e60acc4 100644
--- a/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
+++ b/test/Transforms/Mem2Reg/ConvertDebugInfo2.ll
@@ -53,5 +53,5 @@ return: ; preds = %entry
!18 = !MDLocation(line: 5, scope: !10, inlinedAt: !8)
!19 = !MDLocation(line: 10, scope: !1)
!20 = !MDFile(filename: "bar.c", directory: "/tmp/")
-!21 = !{i32 0}
+!21 = !{}
!22 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/test/Transforms/MemCpyOpt/form-memset.ll b/test/Transforms/MemCpyOpt/form-memset.ll
index f54406f..7d7f3a6 100644
--- a/test/Transforms/MemCpyOpt/form-memset.ll
+++ b/test/Transforms/MemCpyOpt/form-memset.ll
@@ -46,7 +46,7 @@ entry:
store i8 %c, i8* %tmp69, align 1
%tmp73 = getelementptr [19 x i8], [19 x i8]* %x, i32 0, i32 18 ; <i8*> [#uses=1]
store i8 %c, i8* %tmp73, align 1
- %tmp76 = call i32 (...)* @bar( [19 x i8]* %x ) nounwind
+ %tmp76 = call i32 (...) @bar( [19 x i8]* %x ) nounwind
ret void
; CHECK-LABEL: @test1(
; CHECK-NOT: store
diff --git a/test/Transforms/NaryReassociate/nary-add.ll b/test/Transforms/NaryReassociate/nary-add.ll
new file mode 100644
index 0000000..39d7c59
--- /dev/null
+++ b/test/Transforms/NaryReassociate/nary-add.ll
@@ -0,0 +1,198 @@
+; RUN: opt < %s -nary-reassociate -S | FileCheck %s
+
+target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
+
+declare void @foo(i32)
+
+; foo(a + c);
+; foo((a + (b + c));
+; =>
+; t = a + c;
+; foo(t);
+; foo(t + b);
+define void @left_reassociate(i32 %a, i32 %b, i32 %c) {
+; CHECK-LABEL: @left_reassociate(
+ %1 = add i32 %a, %c
+; CHECK: [[BASE:%[a-zA-Z0-9]+]] = add i32 %a, %c
+ call void @foo(i32 %1)
+ %2 = add i32 %b, %c
+ %3 = add i32 %a, %2
+; CHECK: add i32 [[BASE]], %b
+ call void @foo(i32 %3)
+ ret void
+}
+
+; foo(a + c);
+; foo((a + b) + c);
+; =>
+; t = a + c;
+; foo(t);
+; foo(t + b);
+define void @right_reassociate(i32 %a, i32 %b, i32 %c) {
+; CHECK-LABEL: @right_reassociate(
+ %1 = add i32 %a, %c
+; CHECK: [[BASE:%[a-zA-Z0-9]+]] = add i32 %a, %c
+ call void @foo(i32 %1)
+ %2 = add i32 %a, %b
+ %3 = add i32 %2, %c
+; CHECK: add i32 [[BASE]], %b
+ call void @foo(i32 %3)
+ ret void
+}
+
+; t1 = a + c;
+; foo(t1);
+; t2 = a + b;
+; foo(t2);
+; t3 = t2 + c;
+; foo(t3);
+;
+; Do not rewrite t3 into t1 + b because t2 is used elsewhere and is likely free.
+define void @no_reassociate(i32 %a, i32 %b, i32 %c) {
+; CHECK-LABEL: @no_reassociate(
+ %1 = add i32 %a, %c
+; CHECK: add i32 %a, %c
+ call void @foo(i32 %1)
+ %2 = add i32 %a, %b
+; CHECK: add i32 %a, %b
+ call void @foo(i32 %2)
+ %3 = add i32 %2, %c
+; CHECK: add i32 %2, %c
+ call void @foo(i32 %3)
+ ret void
+}
+
+; if (p1)
+; foo(a + c);
+; if (p2)
+; foo(a + c);
+; if (p3)
+; foo((a + b) + c);
+;
+; No action because (a + c) does not dominate ((a + b) + c).
+define void @conditional(i1 %p1, i1 %p2, i1 %p3, i32 %a, i32 %b, i32 %c) {
+; CHECK-LABEL: @conditional(
+entry:
+ br i1 %p1, label %then1, label %branch1
+
+then1:
+ %0 = add i32 %a, %c
+; CHECK: add i32 %a, %c
+ call void @foo(i32 %0)
+ br label %branch1
+
+branch1:
+ br i1 %p2, label %then2, label %branch2
+
+then2:
+ %1 = add i32 %a, %c
+; CHECK: add i32 %a, %c
+ call void @foo(i32 %1)
+ br label %branch2
+
+branch2:
+ br i1 %p3, label %then3, label %return
+
+then3:
+ %2 = add i32 %a, %b
+; CHECK: %2 = add i32 %a, %b
+ %3 = add i32 %2, %c
+; CHECK: add i32 %2, %c
+ call void @foo(i32 %3)
+ br label %return
+
+return:
+ ret void
+}
+
+; This test involves more conditional reassociation candidates. It exercises
+; the stack optimization in tryReassociatedAdd that pops the candidates that
+; do not dominate the current instruction.
+;
+; def1
+; cond1
+; / \
+; / \
+; cond2 use2
+; / \
+; / \
+; def2 def3
+; cond3
+; / \
+; / \
+; def4 use1
+;
+; NaryReassociate should match use1 with def3, and use2 with def1.
+define void @conditional2(i32 %a, i32 %b, i32 %c, i1 %cond1, i1 %cond2, i1 %cond3) {
+entry:
+ %def1 = add i32 %a, %b
+ br i1 %cond1, label %bb1, label %bb6
+bb1:
+ br i1 %cond2, label %bb2, label %bb3
+bb2:
+ %def2 = add i32 %a, %b
+ call void @foo(i32 %def2)
+ ret void
+bb3:
+ %def3 = add i32 %a, %b
+ br i1 %cond3, label %bb4, label %bb5
+bb4:
+ %def4 = add i32 %a, %b
+ call void @foo(i32 %def4)
+ ret void
+bb5:
+ %0 = add i32 %a, %c
+ %1 = add i32 %0, %b
+; CHECK: [[t1:%[0-9]+]] = add i32 %def3, %c
+ call void @foo(i32 %1) ; foo((a + c) + b);
+; CHECK-NEXT: call void @foo(i32 [[t1]])
+ ret void
+bb6:
+ %2 = add i32 %a, %c
+ %3 = add i32 %2, %b
+; CHECK: [[t2:%[0-9]+]] = add i32 %def1, %c
+ call void @foo(i32 %3) ; foo((a + c) + b);
+; CHECK-NEXT: call void @foo(i32 [[t2]])
+ ret void
+}
+
+; foo((a + b) + c)
+; foo(((a + d) + b) + c)
+; =>
+; t = (a + b) + c;
+; foo(t);
+; foo(t + d);
+define void @quaternary(i32 %a, i32 %b, i32 %c, i32 %d) {
+; CHECK-LABEL: @quaternary(
+ %1 = add i32 %a, %b
+ %2 = add i32 %1, %c
+ call void @foo(i32 %2)
+; CHECK: call void @foo(i32 [[TMP1:%[a-zA-Z0-9]]])
+ %3 = add i32 %a, %d
+ %4 = add i32 %3, %b
+ %5 = add i32 %4, %c
+; CHECK: [[TMP2:%[a-zA-Z0-9]]] = add i32 [[TMP1]], %d
+ call void @foo(i32 %5)
+; CHECK: call void @foo(i32 [[TMP2]]
+ ret void
+}
+
+define void @iterative(i32 %a, i32 %b, i32 %c) {
+ %ab = add i32 %a, %b
+ %abc = add i32 %ab, %c
+ call void @foo(i32 %abc)
+
+ %ab2 = add i32 %ab, %b
+ %ab2c = add i32 %ab2, %c
+; CHECK: %ab2c = add i32 %abc, %b
+ call void @foo(i32 %ab2c)
+; CHECK-NEXT: call void @foo(i32 %ab2c)
+
+ %ab3 = add i32 %ab2, %b
+ %ab3c = add i32 %ab3, %c
+; CHECK-NEXT: %ab3c = add i32 %ab2c, %b
+ call void @foo(i32 %ab3c)
+; CHECK-NEXT: call void @foo(i32 %ab3c)
+
+ ret void
+}
diff --git a/test/Transforms/ObjCARC/basic.ll b/test/Transforms/ObjCARC/basic.ll
index 2896fbb..c4f73e7 100644
--- a/test/Transforms/ObjCARC/basic.ll
+++ b/test/Transforms/ObjCARC/basic.ll
@@ -2684,8 +2684,8 @@ define {<2 x float>, <2 x float>} @"\01-[A z]"({}* %self, i8* nocapture %_cmd) n
invoke.cont:
%0 = bitcast {}* %self to i8*
%1 = tail call i8* @objc_retain(i8* %0) nounwind
- tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression())
- tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression())
+ tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression()), !dbg !MDLocation(scope: !2)
+ tail call void @llvm.dbg.value(metadata {}* %self, i64 0, metadata !MDLocalVariable(tag: DW_TAG_auto_variable, scope: !2), metadata !MDExpression()), !dbg !MDLocation(scope: !2)
%ivar = load i64, i64* @"OBJC_IVAR_$_A.myZ", align 8
%add.ptr = getelementptr i8, i8* %0, i64 %ivar
%tmp1 = bitcast i8* %add.ptr to float*
@@ -2706,7 +2706,7 @@ invoke.cont:
%3 = bitcast i8* %arrayidx19 to float*
%tmp20 = load float, float* %3, align 4
%conv21 = fpext float %tmp20 to double
- %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str4, i64 0, i64 0), double %conv, double %conv8, double %conv14, double %conv21)
+ %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str4, i64 0, i64 0), double %conv, double %conv8, double %conv14, double %conv21)
%ivar23 = load i64, i64* @"OBJC_IVAR_$_A.myZ", align 8
%add.ptr24 = getelementptr i8, i8* %0, i64 %ivar23
%4 = bitcast i8* %add.ptr24 to i128*
@@ -2758,7 +2758,7 @@ for.body: ; preds = %entry, %for.body
%i.010 = phi i64 [ %inc, %for.body ], [ 0, %entry ]
%1 = tail call i8* @objc_retain(i8* %x) nounwind
%tmp5 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_", align 8
- %call = tail call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %1, i8* %tmp5)
+ %call = tail call i8* (i8*, i8*, ...) @objc_msgSend(i8* %1, i8* %tmp5)
tail call void @objc_release(i8* %1) nounwind, !clang.imprecise_release !0
%inc = add nsw i64 %i.010, 1
%exitcond = icmp eq i64 %inc, %n
@@ -2837,17 +2837,17 @@ entry:
%tmp2 = load %struct.__CFString*, %struct.__CFString** @kUTTypePlainText, align 8
%tmp3 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_19", align 8
%tmp4 = bitcast %struct._class_t* %tmp1 to i8*
- %call5 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp4, i8* %tmp3, %struct.__CFString* %tmp2)
+ %call5 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp4, i8* %tmp3, %struct.__CFString* %tmp2)
%tmp5 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_21", align 8
%tmp6 = bitcast %3* %pboard to i8*
- %call76 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp6, i8* %tmp5, i8* %call5)
+ %call76 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp6, i8* %tmp5, i8* %call5)
%tmp9 = call i8* @objc_retain(i8* %call76) nounwind
%tobool = icmp eq i8* %tmp9, null
br i1 %tobool, label %end, label %land.lhs.true
land.lhs.true: ; preds = %entry
%tmp11 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_23", align 8
- %call137 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp6, i8* %tmp11, i8* %tmp9)
+ %call137 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp6, i8* %tmp11, i8* %tmp9)
%tmp = bitcast i8* %call137 to %1*
%tmp10 = call i8* @objc_retain(i8* %call137) nounwind
call void @objc_release(i8* null) nounwind
@@ -2866,7 +2866,7 @@ land.lhs.true23: ; preds = %if.then
%tmp24 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_26", align 8
%tmp26 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_28", align 8
%tmp27 = bitcast %struct._class_t* %tmp24 to i8*
- %call2822 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp27, i8* %tmp26, i8* %call137)
+ %call2822 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp27, i8* %tmp26, i8* %call137)
%tmp13 = bitcast i8* %call2822 to %5*
%tmp14 = call i8* @objc_retain(i8* %call2822) nounwind
call void @objc_release(i8* null) nounwind
@@ -2877,9 +2877,9 @@ if.end: ; preds = %land.lhs.true23
%tmp32 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_29", align 8
%tmp33 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_31", align 8
%tmp34 = bitcast %struct._class_t* %tmp32 to i8*
- %call35 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp34, i8* %tmp33)
+ %call35 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp34, i8* %tmp33)
%tmp37 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_33", align 8
- %call3923 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call35, i8* %tmp37, i8* %call2822, i32 signext 1, %4** %err)
+ %call3923 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %call35, i8* %tmp37, i8* %call2822, i32 signext 1, %4** %err)
%cmp = icmp eq i8* %call3923, null
br i1 %cmp, label %if.then44, label %end
@@ -2890,13 +2890,13 @@ if.then44: ; preds = %if.end, %land.lhs.t
%call513 = extractvalue %struct._NSRange %call51, 0
%call514 = extractvalue %struct._NSRange %call51, 1
%tmp52 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_37", align 8
- %call548 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call137, i8* %tmp52, i64 %call513, i64 %call514)
+ %call548 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %call137, i8* %tmp52, i64 %call513, i64 %call514)
%tmp55 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_38", align 8
%tmp56 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_40", align 8
%tmp57 = bitcast %struct._class_t* %tmp55 to i8*
- %call58 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp57, i8* %tmp56)
+ %call58 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp57, i8* %tmp56)
%tmp59 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_42", align 8
- %call6110 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call548, i8* %tmp59, i8* %call58)
+ %call6110 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %call548, i8* %tmp59, i8* %call58)
%tmp15 = call i8* @objc_retain(i8* %call6110) nounwind
call void @objc_release(i8* %call137) nounwind
%tmp64 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_46", align 8
@@ -2906,7 +2906,7 @@ if.then44: ; preds = %if.end, %land.lhs.t
if.then68: ; preds = %if.then44
%tmp70 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_48", align 8
- %call7220 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call6110, i8* %tmp70)
+ %call7220 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %call6110, i8* %tmp70)
%tmp16 = call i8* @objc_retain(i8* %call7220) nounwind
call void @objc_release(i8* %call6110) nounwind
br label %if.end74
@@ -2916,7 +2916,7 @@ if.end74: ; preds = %if.then68, %if.then
%filename.0 = bitcast i8* %filename.0.in to %1*
%tmp17 = load i8*, i8** bitcast (%0* @"\01l_objc_msgSend_fixup_isEqual_" to i8**), align 16
%tmp18 = bitcast i8* %tmp17 to i8 (i8*, %struct._message_ref_t*, i8*, ...)*
- %call78 = call signext i8 (i8*, %struct._message_ref_t*, i8*, ...)* %tmp18(i8* %call137, %struct._message_ref_t* bitcast (%0* @"\01l_objc_msgSend_fixup_isEqual_" to %struct._message_ref_t*), i8* %filename.0.in)
+ %call78 = call signext i8 (i8*, %struct._message_ref_t*, i8*, ...) %tmp18(i8* %call137, %struct._message_ref_t* bitcast (%0* @"\01l_objc_msgSend_fixup_isEqual_" to %struct._message_ref_t*), i8* %filename.0.in)
%tobool79 = icmp eq i8 %call78, 0
br i1 %tobool79, label %land.lhs.true80, label %if.then109
@@ -2930,7 +2930,7 @@ if.end106: ; preds = %land.lhs.true80
%tmp88 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_26", align 8
%tmp90 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_28", align 8
%tmp91 = bitcast %struct._class_t* %tmp88 to i8*
- %call9218 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp91, i8* %tmp90, i8* %filename.0.in)
+ %call9218 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp91, i8* %tmp90, i8* %filename.0.in)
%tmp20 = bitcast i8* %call9218 to %5*
%tmp21 = call i8* @objc_retain(i8* %call9218) nounwind
%tmp22 = bitcast %5* %url.025 to i8*
@@ -2938,9 +2938,9 @@ if.end106: ; preds = %land.lhs.true80
%tmp94 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_29", align 8
%tmp95 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_31", align 8
%tmp96 = bitcast %struct._class_t* %tmp94 to i8*
- %call97 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp96, i8* %tmp95)
+ %call97 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp96, i8* %tmp95)
%tmp99 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_33", align 8
- %call10119 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call97, i8* %tmp99, i8* %call9218, i32 signext 1, %4** %err)
+ %call10119 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %call97, i8* %tmp99, i8* %call9218, i32 signext 1, %4** %err)
%phitmp = icmp eq i8* %call10119, null
br i1 %phitmp, label %if.then109, label %end
@@ -2958,10 +2958,10 @@ if.then112: ; preds = %if.then109
%tmp118 = load %1*, %1** @NSFilePathErrorKey, align 8
%tmp119 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_53", align 8
%tmp120 = bitcast %struct._class_t* %tmp115 to i8*
- %call12113 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp120, i8* %tmp119, %1* %call117, %1* %tmp118, i8* null)
+ %call12113 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp120, i8* %tmp119, %1* %call117, %1* %tmp118, i8* null)
%tmp122 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_55", align 8
%tmp123 = bitcast %struct._class_t* %tmp113 to i8*
- %call12414 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp123, i8* %tmp122, %1* %tmp114, i64 258, i8* %call12113)
+ %call12414 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp123, i8* %tmp122, %1* %tmp114, i64 258, i8* %call12113)
%tmp23 = call i8* @objc_retain(i8* %call12414) nounwind
%tmp25 = call i8* @objc_autorelease(i8* %tmp23) nounwind
%tmp28 = bitcast i8* %tmp25 to %4*
@@ -2973,9 +2973,9 @@ if.end125: ; preds = %if.then112, %if.the
%tmp126 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_56", align 8
%tmp128 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_58", align 8
%tmp129 = bitcast %struct._class_t* %tmp126 to i8*
- %call13015 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %tmp129, i8* %tmp128, %4* %tmp127)
+ %call13015 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %tmp129, i8* %tmp128, %4* %tmp127)
%tmp131 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_60", align 8
- %call13317 = call i8* (i8*, i8*, ...)* @objc_msgSend(i8* %call13015, i8* %tmp131)
+ %call13317 = call i8* (i8*, i8*, ...) @objc_msgSend(i8* %call13015, i8* %tmp131)
br label %end
end: ; preds = %if.end125, %if.end106, %if.end, %land.lhs.true, %entry
diff --git a/test/Transforms/ObjCARC/contract.ll b/test/Transforms/ObjCARC/contract.ll
index 2259e17..6ad46f2 100644
--- a/test/Transforms/ObjCARC/contract.ll
+++ b/test/Transforms/ObjCARC/contract.ll
@@ -169,7 +169,7 @@ return: ; preds = %if.then, %entry
; CHECK-NOT: clang.arc.use
; CHECK: }
define void @test9(i8* %a, i8* %b) {
- call void (...)* @clang.arc.use(i8* %a, i8* %b) nounwind
+ call void (...) @clang.arc.use(i8* %a, i8* %b) nounwind
ret void
}
diff --git a/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll b/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
index 215841c..25135a3 100644
--- a/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
+++ b/test/Transforms/ObjCARC/ensure-that-exception-unwind-path-is-visited.ll
@@ -62,11 +62,11 @@ lpad: ; preds = %entry
call void @objc_end_catch(), !dbg !49, !clang.arc.no_objc_arc_exceptions !38
; CHECK: call void @objc_release(i8* %call)
call void @objc_release(i8* %call) nounwind, !dbg !42, !clang.imprecise_release !38
- call void (i8*, ...)* @NSLog(i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), i8* %call), !dbg !50, !clang.arc.no_objc_arc_exceptions !38
+ call void (i8*, ...) @NSLog(i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), i8* %call), !dbg !50, !clang.arc.no_objc_arc_exceptions !38
br label %if.end, !dbg !52
if.end: ; preds = %lpad, %eh.cont
- call void (i8*, ...)* @NSLog(i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), i8* %call), !dbg !53, !clang.arc.no_objc_arc_exceptions !38
+ call void (i8*, ...) @NSLog(i8* bitcast (%struct.NSConstantString* @_unnamed_cfstring_ to i8*), i8* %call), !dbg !53, !clang.arc.no_objc_arc_exceptions !38
; CHECK: call void @objc_release(i8* %call)
call void @objc_release(i8* %call) nounwind, !dbg !54, !clang.imprecise_release !38
ret i32 0, !dbg !54
@@ -91,7 +91,7 @@ entry:
%tmp1 = load %struct._class_t*, %struct._class_t** @"\01L_OBJC_CLASSLIST_REFERENCES_$_1", align 8, !dbg !56
%tmp2 = load i8*, i8** @"\01L_OBJC_SELECTOR_REFERENCES_5", align 8, !dbg !56, !invariant.load !38
%tmp3 = bitcast %struct._class_t* %tmp1 to i8*, !dbg !56
- call void (i8*, i8*, %0*, %0*, ...)* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %0*, %0*, ...)*)(i8* %tmp3, i8* %tmp2, %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_3 to %0*), %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_3 to %0*)), !dbg !56, !clang.arc.no_objc_arc_exceptions !38
+ call void (i8*, i8*, %0*, %0*, ...) bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to void (i8*, i8*, %0*, %0*, ...)*)(i8* %tmp3, i8* %tmp2, %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_3 to %0*), %0* bitcast (%struct.NSConstantString* @_unnamed_cfstring_3 to %0*)), !dbg !56, !clang.arc.no_objc_arc_exceptions !38
call void @objc_release(i8* %obj) nounwind, !dbg !58, !clang.imprecise_release !38
ret void, !dbg !58
}
@@ -114,14 +114,13 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon
!llvm.module.flags = !{!33, !34, !35, !36, !61}
!0 = !MDCompileUnit(language: DW_LANG_ObjC, producer: "clang version 3.3 ", isOptimized: true, runtimeVersion: 2, emissionKind: 0, file: !60, enums: !1, retainedTypes: !1, subprograms: !3, globals: !1)
-!1 = !{i32 0}
+!1 = !{}
!3 = !{!5, !27}
-!5 = !MDSubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 10, file: !60, scope: !6, type: !7, function: i32 ()* @main, variables: !10)
+!5 = !MDSubprogram(name: "main", line: 9, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: true, scopeLine: 10, file: !60, scope: !6, type: !7, function: i32 ()* @main, variables: !11)
!6 = !MDFile(filename: "test.m", directory: "/Volumes/Files/gottesmmcab/Radar/12906997")
!7 = !MDSubroutineType(types: !8)
!8 = !{!9}
!9 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
-!10 = !{!11}
!11 = !{!12, !21, !25}
!12 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "obj", line: 11, scope: !13, file: !6, type: !14)
!13 = distinct !MDLexicalBlock(line: 10, column: 0, file: !60, scope: !5)
@@ -138,10 +137,9 @@ declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnon
!24 = !MDBasicType(tag: DW_TAG_base_type, name: "signed char", size: 8, align: 8, encoding: DW_ATE_signed_char)
!25 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "obj2", line: 15, scope: !26, file: !6, type: !14)
!26 = distinct !MDLexicalBlock(line: 14, column: 0, file: !60, scope: !22)
-!27 = !MDSubprogram(name: "ThrowFunc", line: 4, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !60, scope: !6, type: !28, function: void (i8*)* @ThrowFunc, variables: !30)
+!27 = !MDSubprogram(name: "ThrowFunc", line: 4, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 5, file: !60, scope: !6, type: !28, function: void (i8*)* @ThrowFunc, variables: !31)
!28 = !MDSubroutineType(types: !29)
!29 = !{null, !14}
-!30 = !{!31}
!31 = !{!32}
!32 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "obj", line: 4, arg: 1, scope: !27, file: !6, type: !14)
!33 = !{i32 1, !"Objective-C Version", i32 2}
diff --git a/test/Transforms/ObjCARC/intrinsic-use-isolated.ll b/test/Transforms/ObjCARC/intrinsic-use-isolated.ll
index f5c31fd..03d7520 100644
--- a/test/Transforms/ObjCARC/intrinsic-use-isolated.ll
+++ b/test/Transforms/ObjCARC/intrinsic-use-isolated.ll
@@ -10,7 +10,7 @@ declare void @clang.arc.use(...) nounwind
; CHECK-NOT: clang.arc.use
; CHECK: }
define void @test0(i8* %a, i8* %b) {
- call void (...)* @clang.arc.use(i8* %a, i8* %b) nounwind
+ call void (...) @clang.arc.use(i8* %a, i8* %b) nounwind
ret void
}
diff --git a/test/Transforms/ObjCARC/intrinsic-use.ll b/test/Transforms/ObjCARC/intrinsic-use.ll
index d85cb3e..f75b187 100644
--- a/test/Transforms/ObjCARC/intrinsic-use.ll
+++ b/test/Transforms/ObjCARC/intrinsic-use.ll
@@ -23,13 +23,13 @@ declare void @test0_helper(i8*, i8**)
; CHECK-NEXT: @objc_retain(i8* %y)
; CHECK-NEXT: call void @test0_helper
; CHECK-NEXT: [[VAL1:%.*]] = load i8*, i8** %temp0
-; CHECK-NEXT: call void (...)* @clang.arc.use(i8* %y)
+; CHECK-NEXT: call void (...) @clang.arc.use(i8* %y)
; CHECK-NEXT: @objc_retain(i8* [[VAL1]])
; CHECK-NEXT: @objc_release(i8* %y)
; CHECK-NEXT: store i8* [[VAL1]], i8** %temp1
; CHECK-NEXT: call void @test0_helper
; CHECK-NEXT: [[VAL2:%.*]] = load i8*, i8** %temp1
-; CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[VAL1]])
+; CHECK-NEXT: call void (...) @clang.arc.use(i8* [[VAL1]])
; CHECK-NEXT: @objc_retain(i8* [[VAL2]])
; CHECK-NEXT: @objc_release(i8* [[VAL1]])
; CHECK-NEXT: @objc_autorelease(i8* %x)
@@ -49,13 +49,13 @@ entry:
call void @test0_helper(i8* %x, i8** %temp0)
%val1 = load i8*, i8** %temp0
%2 = call i8* @objc_retain(i8* %val1) nounwind
- call void (...)* @clang.arc.use(i8* %y) nounwind
+ call void (...) @clang.arc.use(i8* %y) nounwind
call void @objc_release(i8* %y) nounwind
store i8* %val1, i8** %temp1
call void @test0_helper(i8* %x, i8** %temp1)
%val2 = load i8*, i8** %temp1
%3 = call i8* @objc_retain(i8* %val2) nounwind
- call void (...)* @clang.arc.use(i8* %val1) nounwind
+ call void (...) @clang.arc.use(i8* %val1) nounwind
call void @objc_release(i8* %val1) nounwind
%4 = call i8* @objc_retain(i8* %x) nounwind
%5 = call i8* @objc_autorelease(i8* %x) nounwind
@@ -71,13 +71,13 @@ entry:
; CHECK-NEXT: @objc_retain(i8* %y)
; CHECK-NEXT: call void @test0_helper
; CHECK-NEXT: [[VAL1:%.*]] = load i8*, i8** %temp0
-; CHECK-NEXT: call void (...)* @clang.arc.use(i8* %y)
+; CHECK-NEXT: call void (...) @clang.arc.use(i8* %y)
; CHECK-NEXT: @objc_retain(i8* [[VAL1]])
; CHECK-NEXT: @objc_release(i8* %y)
; CHECK-NEXT: store i8* [[VAL1]], i8** %temp1
; CHECK-NEXT: call void @test0_helper
; CHECK-NEXT: [[VAL2:%.*]] = load i8*, i8** %temp1
-; CHECK-NEXT: call void (...)* @clang.arc.use(i8* [[VAL1]])
+; CHECK-NEXT: call void (...) @clang.arc.use(i8* [[VAL1]])
; CHECK-NEXT: @objc_retain(i8* [[VAL2]])
; CHECK-NEXT: @objc_release(i8* [[VAL1]])
; CHECK-NEXT: @objc_autorelease(i8* %x)
@@ -95,13 +95,13 @@ entry:
call void @test0_helper(i8* %x, i8** %temp0)
%val1 = load i8*, i8** %temp0
%2 = call i8* @objc_retain(i8* %val1) nounwind
- call void (...)* @clang.arc.use(i8* %y) nounwind
+ call void (...) @clang.arc.use(i8* %y) nounwind
call void @objc_release(i8* %y) nounwind, !clang.imprecise_release !0
store i8* %val1, i8** %temp1
call void @test0_helper(i8* %x, i8** %temp1)
%val2 = load i8*, i8** %temp1
%3 = call i8* @objc_retain(i8* %val2) nounwind
- call void (...)* @clang.arc.use(i8* %val1) nounwind
+ call void (...) @clang.arc.use(i8* %val1) nounwind
call void @objc_release(i8* %val1) nounwind, !clang.imprecise_release !0
%4 = call i8* @objc_retain(i8* %x) nounwind
%5 = call i8* @objc_autorelease(i8* %x) nounwind
diff --git a/test/Transforms/ObjCARC/move-and-merge-autorelease.ll b/test/Transforms/ObjCARC/move-and-merge-autorelease.ll
index 5d19f35..0a68541 100644
--- a/test/Transforms/ObjCARC/move-and-merge-autorelease.ll
+++ b/test/Transforms/ObjCARC/move-and-merge-autorelease.ll
@@ -99,9 +99,9 @@ bb81: ; preds = %bb, %bb76
%tmp10.1 = phi %0* [ %tmp10.0, %bb76 ], [ null, %bb ]
%tmp83 = bitcast %0* %tmp10.1 to i8*
%tmp84 = call i8* @objc_retain(i8* %tmp83) nounwind
- %tmp88 = bitcast i8* %tmp87 to %0*
call void @objc_release(i8* %tmp23) nounwind
%tmp87 = call i8* @objc_autorelease(i8* %tmp84) nounwind
+ %tmp88 = bitcast i8* %tmp87 to %0*
%tmp92 = bitcast %0* %tmp10.1 to i8*
call void @objc_release(i8* %tmp92) nounwind
ret %0* %tmp88
diff --git a/test/Transforms/PhaseOrdering/PR6627.ll b/test/Transforms/PhaseOrdering/PR6627.ll
index f214955..2774d20 100644
--- a/test/Transforms/PhaseOrdering/PR6627.ll
+++ b/test/Transforms/PhaseOrdering/PR6627.ll
@@ -36,7 +36,7 @@ land.lhs.true17: ; preds = %land.lhs.true9
br i1 %cmp23, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true17
- %call25 = call i32 (...)* @doo()
+ %call25 = call i32 (...) @doo()
br label %if.end
if.end:
@@ -80,7 +80,7 @@ land.lhs.true17: ; preds = %land.lhs.true9
br i1 %cmp23, label %if.then, label %if.end
if.then: ; preds = %land.lhs.true17
- %call25 = call i32 (...)* @doo()
+ %call25 = call i32 (...) @doo()
br label %if.end
if.end:
diff --git a/test/Transforms/PlaceSafepoints/basic.ll b/test/Transforms/PlaceSafepoints/basic.ll
index ca63da4..4dbff58 100644
--- a/test/Transforms/PlaceSafepoints/basic.ll
+++ b/test/Transforms/PlaceSafepoints/basic.ll
@@ -76,7 +76,7 @@ define i1 @test_call_with_result() gc "statepoint-example" {
; CHECK: (i1 (i1)* @i1_return_i1, i32 1, i32 0, i1 false, i32 0)
; CHECK: %call12 = call i1 @llvm.experimental.gc.result.i1
entry:
- %call1 = tail call i1 (i1)* @i1_return_i1(i1 false)
+ %call1 = tail call i1 (i1) @i1_return_i1(i1 false)
ret i1 %call1
}
diff --git a/test/Transforms/Reassociate/looptest.ll b/test/Transforms/Reassociate/looptest.ll
index 8b6a409..5563070 100644
--- a/test/Transforms/Reassociate/looptest.ll
+++ b/test/Transforms/Reassociate/looptest.ll
@@ -34,7 +34,7 @@ bb4: ; preds = %bb4, %bb3
%reg113 = add i32 %reg115, %reg117 ; <i32> [#uses=1]
%reg114 = add i32 %reg113, %reg116 ; <i32> [#uses=1]
%cast227 = getelementptr [4 x i8], [4 x i8]* @.LC0, i64 0, i64 0 ; <i8*> [#uses=1]
- call i32 (i8*, ...)* @printf( i8* %cast227, i32 %reg114 ) ; <i32>:0 [#uses=0]
+ call i32 (i8*, ...) @printf( i8* %cast227, i32 %reg114 ) ; <i32>:0 [#uses=0]
%reg118 = add i32 %reg117, 1 ; <i32> [#uses=2]
%cond224 = icmp ne i32 %reg118, %Num ; <i1> [#uses=1]
br i1 %cond224, label %bb4, label %bb5
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
index d026d50..e6e5efc 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-1.ll
@@ -20,7 +20,7 @@ merge:
; CHECK-LABEL: merge:
; CHECK: %base_phi = phi i64 addrspace(1)* [ %base_obj_x, %here ], [ %base_obj_y, %there ]
%merged_value = phi i64 addrspace(1)* [ %x, %here ], [ %y, %there ]
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i64 addrspace(1)* %merged_value
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
index 6f02056..fa800ea 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-10.ll
@@ -30,7 +30,7 @@ false:
merge:
%next = phi i64 addrspace(1)* [ %next_x, %true ], [ %next_y, %false ]
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
index 1e8d071..c7fd32e 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-11.ll
@@ -19,7 +19,7 @@ loop: ; preds = %loop, %entry
; CHECK-DAG: [ %next.relocated, %loop ]
%current = phi i64 addrspace(1)* [ %obj, %entry ], [ %next, %loop ]
%next = getelementptr i64, i64 addrspace(1)* %current, i32 1
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
index 94787bf..6509d23 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-2.ll
@@ -13,7 +13,7 @@ there:
merge:
%merged_value = phi i64 addrspace(1)* [ %base_obj, %entry ], [ %derived_obj, %there ]
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i64 addrspace(1)* %merged_value
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
index 5aaa47e..7a80f31 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-3.ll
@@ -12,7 +12,7 @@ loop:
%current.i32 = bitcast i64 addrspace(1)* %current to i32 addrspace(1)*
%next.i32 = getelementptr i32, i32 addrspace(1)* %current.i32, i32 1
%next.i64 = bitcast i32 addrspace(1)* %next.i32 to i64 addrspace(1)*
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
index 16bb3ac..33619ad 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-4.ll
@@ -13,9 +13,9 @@ entry:
loop:
; CHECK: loop:
-; CHECK: %safepoint_token1 = call i32 (i64 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 addrspace(1)* ()* @generate_obj, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i3
+; CHECK: %safepoint_token1 = call i32 (i64 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 addrspace(1)* ()* @generate_obj, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i3
; CHECK-NEXT: %obj2 = call i64 addrspace(1)* @llvm.experimental.gc.result
- %safepoint_token1 = call i32 (i64 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 addrspace(1)* ()* @generate_obj, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token1 = call i32 (i64 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i64f(i64 addrspace(1)* ()* @generate_obj, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
%obj2 = call i64 addrspace(1)* @llvm.experimental.gc.result.p1i64(i32 %safepoint_token1)
switch i32 %condition, label %dest_a [
i32 0, label %dest_b
@@ -37,11 +37,11 @@ merge:
; CHECK: %obj_to_consume = phi i64 addrspace(1)* [ %obj2, %dest_a ], [ null, %dest_b ], [ null, %dest_c ]
%obj_to_consume = phi i64 addrspace(1)* [ %obj2, %dest_a ], [ null, %dest_b ], [ null, %dest_c ]
- %safepoint_token3 = call i32 (void (i64 addrspace(1)*)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)* @consume_obj, i32 1, i32 0, i64 addrspace(1)* %obj_to_consume, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token3 = call i32 (void (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)* @consume_obj, i32 1, i32 0, i64 addrspace(1)* %obj_to_consume, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %merge.split
merge.split: ; preds = %merge
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
index 8390ecd..0800504 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-5.ll
@@ -23,7 +23,7 @@ merge:
; CHECK: %base_phi = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %base_obj_y, %there ]
; CHECK-NEXT: %merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ]
%merged_value = phi i64 addrspace(1)* [ %base_obj_x, %bump ], [ %y, %there ]
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i64 addrspace(1)* %merged_value
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
index 1d60d03..f286ed9 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-6.ll
@@ -33,7 +33,7 @@ merge:
; CHECK: %base_phi = phi i64 addrspace(1)* [ %base_obj_x, %merge_here ], [ %base_obj_y, %there ]
; CHECK-NEXT: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
%merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i64 addrspace(1)* %merged_value
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
index e4807e6..f51e117 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-7.ll
@@ -44,7 +44,7 @@ merge:
; CHECK: %merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
%merged_value = phi i64 addrspace(1)* [ %x, %merge_here ], [ %y, %there ]
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @site_for_call_safpeoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i64 addrspace(1)* %merged_value
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
index 488b61e..07bc42b 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-8.ll
@@ -24,7 +24,7 @@ check_for_null:
loop_back:
%next_element_ptr = getelementptr i64 addrspace(1)*, i64 addrspace(1)* addrspace(1)* %current_element_ptr, i32 1
%next_index = add i32 %index, 1
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop_check
not_found:
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
index c9fbcd6..973ac7e 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers-9.ll
@@ -13,7 +13,7 @@ loop:
%condition = call i1 @runtime_value()
%maybe_next = getelementptr i64, i64 addrspace(1)* %current, i32 1
%next = select i1 %condition, i64 addrspace(1)* %maybe_next, i64 addrspace(1)* %current
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop
}
diff --git a/test/Transforms/RewriteStatepointsForGC/base-pointers.ll b/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
index c5035eb..eab963f 100644
--- a/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
+++ b/test/Transforms/RewriteStatepointsForGC/base-pointers.ll
@@ -16,7 +16,7 @@ loop:
; CHECK-DAG: [ %obj.relocated, %loop ]
; CHECK-DAG: [ %obj, %entry ]
call void @use_obj(i64 addrspace(1)* %obj)
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop
}
@@ -57,7 +57,7 @@ define i64 addrspace(1)* @test1(i32 %caller, i8 addrspace(1)* %a, i8 addrspace(1
; CHECK: merge:
; CHECK-NEXT: %base_phi = phi i64 addrspace(1)* [ [[CAST_L]], %left ], [ [[CAST_L]], %left ], [ [[CAST_L]], %left ], [ [[CAST_R]], %right ], !is_base_value !0
%value = phi i64 addrspace(1)* [ %a.cast, %left], [ %a.cast, %left], [ %a.cast, %left], [ %b.cast, %right]
- %safepoint_token = call i32 (void (i64 addrspace(1)*)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)* @parse_point, i32 1, i32 0, i64 addrspace(1)* %value, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidp1i64f(void (i64 addrspace(1)*)* @parse_point, i32 1, i32 0, i64 addrspace(1)* %value, i32 5, i32 0, i32 0, i32 0, i32 0, i32 0)
ret i64 addrspace(1)* %value
}
@@ -76,7 +76,9 @@ loop: ; preds = %loop, %entry
; CHECK-LABEL: loop
; CHECK: %base_phi = phi i64 addrspace(1)*
; CHECK-DAG: [ %base_obj, %entry ]
-; CHECK-DAG: [ %base_select.relocated, %loop ]
+; Given the two selects are equivelent, so are their base phis - ideally,
+; we'd have commoned these, but that's a missed optimization, not correctness.
+; CHECK-DAG: [ [[DISCARD:%base_select.*.relocated]], %loop ]
; CHECK-NOT: base_phi2
; CHECK: next = select
; CHECK: base_select
@@ -89,7 +91,7 @@ loop: ; preds = %loop, %entry
%nexta = getelementptr i64, i64 addrspace(1)* %current, i32 1
%next = select i1 %cnd, i64 addrspace(1)* %nexta, i64 addrspace(1)* %base_arg2
%extra2 = select i1 %cnd, i64 addrspace(1)* %nexta, i64 addrspace(1)* %base_arg2
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %loop
}
diff --git a/test/Transforms/RewriteStatepointsForGC/basics.ll b/test/Transforms/RewriteStatepointsForGC/basics.ll
index c1a1e4e..1720cc1 100644
--- a/test/Transforms/RewriteStatepointsForGC/basics.ll
+++ b/test/Transforms/RewriteStatepointsForGC/basics.ll
@@ -10,7 +10,7 @@ define i8 addrspace(1)* @test1(i8 addrspace(1)* %obj) gc "statepoint-example" {
; CHECK-NEXT: gc.statepoint
; CHECK-NEXT: %obj.relocated = call coldcc i8 addrspace(1)*
entry:
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i8 addrspace(1)* %obj
}
@@ -23,8 +23,8 @@ define i8 addrspace(1)* @test2(i8 addrspace(1)* %obj) gc "statepoint-example" {
; CHECK-NEXT: gc.statepoint
; CHECK-NEXT: %obj.relocated1 = call coldcc i8 addrspace(1)*
entry:
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i8 addrspace(1)* %obj
}
@@ -39,7 +39,7 @@ define i8 @test3(i8 addrspace(1)* %obj) gc "statepoint-example" {
; CHECK-NEXT: load i8, i8 addrspace(1)* %obj.relocated
entry:
%derived = getelementptr i8, i8 addrspace(1)* %obj, i64 10
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
%a = load i8, i8 addrspace(1)* %derived
%b = load i8, i8 addrspace(1)* %obj
@@ -57,14 +57,14 @@ taken:
; CHECK-LABEL: taken:
; CHECK-NEXT: gc.statepoint
; CHECK-NEXT: %obj.relocated = call coldcc i8 addrspace(1)*
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %merge
untaken:
; CHECK-LABEL: untaken:
; CHECK-NEXT: gc.statepoint
; CHECK-NEXT: %obj.relocated1 = call coldcc i8 addrspace(1)*
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %merge
merge:
@@ -75,13 +75,13 @@ merge:
}
; When run over a function which doesn't opt in, should do nothing!
-define i8 addrspace(1)* @test5(i8 addrspace(1)* %obj) {
+define i8 addrspace(1)* @test5(i8 addrspace(1)* %obj) gc "ocaml" {
; CHECK-LABEL: @test5
; CHECK-LABEL: entry:
; CHECK-NEXT: gc.statepoint
; CHECK-NOT: %obj.relocated = call coldcc i8 addrspace(1)*
entry:
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i8 addrspace(1)* %obj
}
diff --git a/test/Transforms/RewriteStatepointsForGC/live-vector.ll b/test/Transforms/RewriteStatepointsForGC/live-vector.ll
new file mode 100644
index 0000000..c1a693e
--- /dev/null
+++ b/test/Transforms/RewriteStatepointsForGC/live-vector.ll
@@ -0,0 +1,87 @@
+; Test that we can correctly handle vectors of pointers in statepoint
+; rewriting. Currently, we scalarize, but that's an implementation detail.
+; RUN: opt %s -rewrite-statepoints-for-gc -S | FileCheck %s
+
+; A non-vector relocation for comparison
+define i64 addrspace(1)* @test(i64 addrspace(1)* %obj) gc "statepoint-example" {
+; CHECK-LABEL: test
+; CHECK: gc.statepoint
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: ret i64 addrspace(1)* %obj.relocated
+entry:
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0)
+ ret i64 addrspace(1)* %obj
+}
+
+; A base vector from a argument
+define <2 x i64 addrspace(1)*> @test2(<2 x i64 addrspace(1)*> %obj) gc "statepoint-example" {
+; CHECK-LABEL: test2
+; CHECK: extractelement
+; CHECK-NEXT: extractelement
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %5
+entry:
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0)
+ ret <2 x i64 addrspace(1)*> %obj
+}
+
+; A base vector from a load
+define <2 x i64 addrspace(1)*> @test3(<2 x i64 addrspace(1)*>* %ptr) gc "statepoint-example" {
+; CHECK-LABEL: test3
+; CHECK: load
+; CHECK-NEXT: extractelement
+; CHECK-NEXT: extractelement
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %5
+entry:
+ %obj = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0)
+ ret <2 x i64 addrspace(1)*> %obj
+}
+
+declare i32 @fake_personality_function()
+
+; When a statepoint is an invoke rather than a call
+define <2 x i64 addrspace(1)*> @test4(<2 x i64 addrspace(1)*>* %ptr) gc "statepoint-example" {
+; CHECK-LABEL: test4
+; CHECK: load
+; CHECK-NEXT: extractelement
+; CHECK-NEXT: extractelement
+; CHECK-NEXT: gc.statepoint
+entry:
+ %obj = load <2 x i64 addrspace(1)*>, <2 x i64 addrspace(1)*>* %ptr
+ invoke i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0)
+ to label %normal_return unwind label %exceptional_return
+
+; CHECK-LABEL: normal_return:
+; CHECK: gc.relocate
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %6
+normal_return: ; preds = %entry
+ ret <2 x i64 addrspace(1)*> %obj
+
+; CHECK-LABEL: exceptional_return:
+; CHECK: gc.relocate
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: insertelement
+; CHECK-NEXT: ret <2 x i64 addrspace(1)*> %10
+exceptional_return: ; preds = %entry
+ %landing_pad4 = landingpad { i8*, i32 } personality i32 ()* @fake_personality_function
+ cleanup
+ ret <2 x i64 addrspace(1)*> %obj
+}
+
+declare void @do_safepoint()
+
+declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...)
diff --git a/test/Transforms/RewriteStatepointsForGC/liveness-basics.ll b/test/Transforms/RewriteStatepointsForGC/liveness-basics.ll
new file mode 100644
index 0000000..0990c68
--- /dev/null
+++ b/test/Transforms/RewriteStatepointsForGC/liveness-basics.ll
@@ -0,0 +1,158 @@
+; A collection of liveness test cases to ensure we're reporting the
+; correct live values at statepoints
+; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+
+
+; Tests to make sure we consider %obj live in both the taken and untaken
+; predeccessor of merge.
+define i64 addrspace(1)* @test1(i1 %cmp, i64 addrspace(1)* %obj) gc "statepoint-example" {
+; CHECK-LABEL: @test1
+entry:
+ br i1 %cmp, label %taken, label %untaken
+
+taken:
+; CHECK-LABEL: taken:
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: %obj.relocated = call coldcc i64 addrspace(1)*
+; CHECK-NEXT: br label %merge
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ br label %merge
+
+untaken:
+; CHECK-LABEL: untaken:
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: %obj.relocated1 = call coldcc i64 addrspace(1)*
+; CHECK-NEXT: br label %merge
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ br label %merge
+
+merge:
+; CHECK-LABEL: merge:
+; CHECK-NEXT: %.0 = phi i64 addrspace(1)* [ %obj.relocated, %taken ], [ %obj.relocated1, %untaken ]
+; CHECK-NEXT: ret i64 addrspace(1)* %.0
+ ret i64 addrspace(1)* %obj
+}
+
+; A local kill should not effect liveness in predecessor block
+define i64 addrspace(1)* @test2(i1 %cmp, i64 addrspace(1)** %loc) gc "statepoint-example" {
+; CHECK-LABEL: @test2
+entry:
+; CHECK-LABEL: entry:
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: br
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ br i1 %cmp, label %taken, label %untaken
+
+taken:
+; CHECK-LABEL: taken:
+; CHECK-NEXT: %obj = load
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: ret i64 addrspace(1)* %obj.relocated
+
+ %obj = load i64 addrspace(1)*, i64 addrspace(1)** %loc
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ ret i64 addrspace(1)* %obj
+
+untaken:
+ ret i64 addrspace(1)* null
+}
+
+; A local kill should effect values live from a successor phi. Also, we
+; should only propagate liveness from a phi to the appropriate predecessors.
+define i64 addrspace(1)* @test3(i1 %cmp, i64 addrspace(1)** %loc) gc "statepoint-example" {
+; CHECK-LABEL: @test3
+entry:
+ br i1 %cmp, label %taken, label %untaken
+
+taken:
+; CHECK-LABEL: taken:
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: %obj = load
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: %obj.relocated = call coldcc i64 addrspace(1)*
+; CHECK-NEXT: br label %merge
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ %obj = load i64 addrspace(1)*, i64 addrspace(1)** %loc
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ br label %merge
+
+untaken:
+; CHECK-LABEL: taken:
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: br label %merge
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ br label %merge
+
+merge:
+ %phi = phi i64 addrspace(1)* [ %obj, %taken ], [ null, %untaken ]
+ ret i64 addrspace(1)* %phi
+}
+
+; A base pointer must be live if it is needed at a later statepoint,
+; even if the base pointer is otherwise unused.
+define i64 addrspace(1)* @test4(i1 %cmp, i64 addrspace(1)* %obj) gc "statepoint-example" {
+; CHECK-LABEL: @test4
+entry:
+; CHECK-LABEL: entry:
+; CHECK-NEXT: %derived = getelementptr
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: %derived.relocated =
+; CHECK-NEXT: %obj.relocated =
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: %derived.relocated1 =
+; Note: It's legal to relocate obj again, but not strictly needed
+; CHECK-NEXT: %obj.relocated2 =
+; CHECK-NEXT: ret i64 addrspace(1)* %derived.relocated1
+;
+ %derived = getelementptr i64, i64 addrspace(1)* %obj, i64 8
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ ret i64 addrspace(1)* %derived
+}
+
+declare void @consume(...) readonly
+
+; Make sure that a phi def visited during iteration is considered a kill.
+; Also, liveness after base pointer analysis can change based on new uses,
+; not just new defs.
+define i64 addrspace(1)* @test5(i1 %cmp, i64 addrspace(1)* %obj) gc "statepoint-example" {
+; CHECK-LABEL: @test5
+entry:
+ br i1 %cmp, label %taken, label %untaken
+
+taken:
+; CHECK-LABEL: taken:
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: %obj.relocated = call coldcc i64 addrspace(1)*
+; CHECK-NEXT: br label %merge
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ br label %merge
+
+untaken:
+; CHECK-LABEL: untaken:
+; CHECK-NEXT: br label %merge
+ br label %merge
+
+merge:
+; CHECK-LABEL: merge:
+; CHECK-NEXT: %.0 = phi i64 addrspace(1)*
+; CHECK-NEXT: %obj2a = phi
+; CHECK-NEXT: @consume
+; CHECK-NEXT: br label %final
+ %obj2a = phi i64 addrspace(1)* [ %obj, %taken ], [null, %untaken]
+ call void (...) @consume(i64 addrspace(1)* %obj2a)
+ br label %final
+final:
+; CHECK-LABEL: final:
+; CHECK-NEXT: @consume
+; CHECK-NEXT: ret i64 addrspace(1)* %.0
+ call void (...) @consume(i64 addrspace(1)* %obj2a)
+ ret i64 addrspace(1)* %obj
+}
+
+declare void @foo()
+
+declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...)
+
diff --git a/test/Transforms/RewriteStatepointsForGC/preprocess.ll b/test/Transforms/RewriteStatepointsForGC/preprocess.ll
new file mode 100644
index 0000000..29a7dcc
--- /dev/null
+++ b/test/Transforms/RewriteStatepointsForGC/preprocess.ll
@@ -0,0 +1,65 @@
+; RUN: opt -rewrite-statepoints-for-gc -S < %s | FileCheck %s
+
+declare void @consume(...)
+
+; Test to make sure we destroy LCSSA's single entry phi nodes before
+; running liveness
+define void @test6(i64 addrspace(1)* %obj) gc "statepoint-example" {
+; CHECK-LABEL: @test6
+entry:
+ br label %next
+
+next:
+; CHECK-LABEL: next:
+; CHECK-NEXT: gc.statepoint
+; CHECK-NEXT: gc.relocate
+; CHECK-NEXT: @consume(i64 addrspace(1)* %obj.relocated)
+; CHECK-NEXT: @consume(i64 addrspace(1)* %obj.relocated)
+ %obj2 = phi i64 addrspace(1)* [ %obj, %entry ]
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ call void (...) @consume(i64 addrspace(1)* %obj2)
+ call void (...) @consume(i64 addrspace(1)* %obj)
+ ret void
+}
+
+declare void @some_call(i64 addrspace(1)*)
+
+; Need to delete unreachable gc.statepoint call
+define void @test7() gc "statepoint-example" {
+; CHECK-LABEL: test7
+; CHECK-NOT: gc.statepoint
+ ret void
+
+unreached:
+ %obj = phi i64 addrspace(1)* [null, %unreached]
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ call void (...) @consume(i64 addrspace(1)* %obj)
+ br label %unreached
+}
+
+; Need to delete unreachable gc.statepoint invoke - tested seperately given
+; a correct implementation could only remove the instructions, not the block
+define void @test8() gc "statepoint-example" {
+; CHECK-LABEL: test8
+; CHECK-NOT: gc.statepoint
+ ret void
+
+unreached:
+ invoke i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ to label %normal_return unwind label %exceptional_return
+
+normal_return: ; preds = %entry
+ ret void
+
+exceptional_return: ; preds = %entry
+ %landing_pad4 = landingpad { i8*, i32 } personality i32 ()* undef
+ cleanup
+ ret void
+}
+
+declare void @foo()
+; Bound the last check-not
+; CHECK-LABEL: @foo
+
+declare i32 @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()*, i32, i32, ...)
+
diff --git a/test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll b/test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll
index b2dc2a1..73ebf2f 100644
--- a/test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll
+++ b/test/Transforms/RewriteStatepointsForGC/relocate_invoke_result.ll
@@ -24,7 +24,7 @@ normal_dest:
;; CHECK-LABEL: normal_dest:
;; CHECK-NEXT: gc.statepoint
;; CHECK-NEXT: %obj.relocated = call coldcc i64* addrspace(1)*
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @gc_call, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @gc_call, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret i64* addrspace(1)* %obj
}
diff --git a/test/Transforms/RewriteStatepointsForGC/relocation.ll b/test/Transforms/RewriteStatepointsForGC/relocation.ll
index c3bda3d..da092ee 100644
--- a/test/Transforms/RewriteStatepointsForGC/relocation.ll
+++ b/test/Transforms/RewriteStatepointsForGC/relocation.ll
@@ -9,7 +9,7 @@ entry:
; CHECK-LABEL: @test1
; CHECK-DAG: %obj.relocated
; CHECK-DAG: %obj2.relocated
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
br label %joint
joint:
@@ -61,7 +61,7 @@ loop_x:
br label %loop.backedge
loop.backedge:
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @do_safepoint, i32 0, i32 0, i32 0)
br label %loop
loop_y:
@@ -79,14 +79,14 @@ if_branch:
; CHECK-LABEL: if_branch:
; CHECK: gc.statepoint
; CHECK: gc.relocate
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
br label %join
else_branch:
; CHECK-LABEL: else_branch:
; CHECK: gc.statepoint
; CHECK: gc.relocate
- %safepoint_token1 = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
+ %safepoint_token1 = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 0)
br label %join
join:
@@ -96,7 +96,7 @@ join:
; CHECK-DAG: [ %arg.relocated, %if_branch ]
; CHECK-DAG: [ %arg.relocated4, %else_branch ]
; CHECK-NOT: phi
- call void (i8 addrspace(1)*)* @some_call(i8 addrspace(1)* %arg)
+ call void (i8 addrspace(1)*) @some_call(i8 addrspace(1)* %arg)
ret void
}
@@ -109,8 +109,8 @@ entry:
; CHECK: gc.statepoint
; CHECK-NEXT: gc.relocate
; CHECK-NEXT: gc.statepoint
- %safepoint_token = call i32 (void (i64)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidi64f(void (i64)* undef, i32 1, i32 0, i64 undef, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
- %safepoint_token1 = call i32 (i32 (i64 addrspace(1)*)*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i32p1i64f(i32 (i64 addrspace(1)*)* undef, i32 1, i32 0, i64 addrspace(1)* %obj, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void (i64)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidi64f(void (i64)* undef, i32 1, i32 0, i64 undef, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token1 = call i32 (i32 (i64 addrspace(1)*)*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_i32p1i64f(i32 (i64 addrspace(1)*)* undef, i32 1, i32 0, i64 addrspace(1)* %obj, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
ret void
}
@@ -123,10 +123,10 @@ define void @test4() gc "statepoint-example" {
; CHECK: gc.statepoint
; CHECK: gc.relocate
; CHECK: @use(i8 addrspace(1)* %res.relocated)
- %safepoint_token2 = tail call i32 (i8 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0)
+ %safepoint_token2 = tail call i32 (i8 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0)
%res = call i8 addrspace(1)* @llvm.experimental.gc.result.ptr.p1i8(i32 %safepoint_token2)
- call i32 (i8 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0)
- call void (...)* @use(i8 addrspace(1)* %res)
+ call i32 (i8 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0)
+ call void (...) @use(i8 addrspace(1)* %res)
unreachable
}
@@ -135,7 +135,7 @@ define void @test4() gc "statepoint-example" {
define void @test5(i8 addrspace(1)* %arg) gc "statepoint-example" {
; CHECK-LABEL: test5
entry:
- call i32 (i8 addrspace(1)* ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0)
+ call i32 (i8 addrspace(1)* ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_p1i8f(i8 addrspace(1)* ()* undef, i32 0, i32 0, i32 0)
switch i32 undef, label %kill [
i32 10, label %merge
i32 13, label %merge
@@ -151,7 +151,7 @@ merge:
; CHECK-DAG: [ %arg.relocated, %entry ]
; CHECK-DAG: [ %arg.relocated, %entry ]
%test = phi i8 addrspace(1)* [ null, %kill ], [ %arg, %entry ], [ %arg, %entry ]
- call void (...)* @use(i8 addrspace(1)* %test)
+ call void (...) @use(i8 addrspace(1)* %test)
unreachable
}
@@ -169,7 +169,7 @@ do_safepoint:
; CHECK: arg1.relocated =
; CHECK: arg2.relocated =
; CHECK: arg3.relocated =
- call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 3, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, i8 addrspace(1)* %arg3)
+ call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 3, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, i8 addrspace(1)* %arg3)
br label %gc.safepoint_poll.exit2
gc.safepoint_poll.exit2:
@@ -183,7 +183,7 @@ gc.safepoint_poll.exit2:
; CHECK: phi i8 addrspace(1)*
; CHECK-DAG: [ %arg1, %entry ]
; CHECK-DAG: [ %arg1.relocated, %do_safepoint ]
- call void (...)* @use(i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, i8 addrspace(1)* %arg3)
+ call void (...) @use(i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2, i8 addrspace(1)* %arg3)
ret void
}
@@ -208,7 +208,7 @@ outer-inc:
; CHECK-LABEL: outer-inc:
; CHECK: %arg1.relocated
; CHECK: %arg2.relocated
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 2, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 2, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2)
br label %outer-loop
}
@@ -237,7 +237,7 @@ inner-loop:
; CHECK: gc.statepoint
; CHECK: %arg1.relocated
; CHECK: %arg2.relocated
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 2, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 2, i8 addrspace(1)* %arg1, i8 addrspace(1)* %arg2)
br i1 %cmp, label %inner-loop, label %outer-inc
outer-inc:
@@ -257,7 +257,7 @@ branch2:
br i1 %condition, label %callbb, label %join2
callbb:
- %safepoint_token = call i32 (void ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
+ %safepoint_token = call i32 (void ()*, i32, i32, ...) @llvm.experimental.gc.statepoint.p0f_isVoidf(void ()* @foo, i32 0, i32 0, i32 5, i32 0, i32 -1, i32 0, i32 0, i32 0)
br label %join
join:
diff --git a/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll b/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll
index 7aced66..1ac6bcd 100644
--- a/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll
+++ b/test/Transforms/SCCP/2009-05-27-VectorOperandZero.ll
@@ -3,7 +3,7 @@
define i32 @main() nounwind {
entry:
- %0 = tail call signext i8 (...)* @sin() nounwind
+ %0 = tail call signext i8 (...) @sin() nounwind
ret i32 0
}
diff --git a/test/Transforms/SCCP/retvalue-undef.ll b/test/Transforms/SCCP/retvalue-undef.ll
index 5a4ba11..f0e9e67 100644
--- a/test/Transforms/SCCP/retvalue-undef.ll
+++ b/test/Transforms/SCCP/retvalue-undef.ll
@@ -15,7 +15,7 @@ define internal i32 @g() {
; CHECK-NEXT: ret i32 8
define internal void @outer_mod() {
- %1 = call i32 ()* ()* @f() ; <i32 ()*> [#uses=1]
+ %1 = call i32 ()* () @f() ; <i32 ()*> [#uses=1]
%2 = call i32 %1() ; <i32> [#uses=0]
ret void
}
diff --git a/test/Transforms/SLPVectorizer/X86/barriercall.ll b/test/Transforms/SLPVectorizer/X86/barriercall.ll
index 9def190..382a43f 100644
--- a/test/Transforms/SLPVectorizer/X86/barriercall.ll
+++ b/test/Transforms/SLPVectorizer/X86/barriercall.ll
@@ -8,7 +8,7 @@ target triple = "x86_64-apple-macosx10.8.0"
;CHECK: ret
define i32 @foo(i32* nocapture %A, i32 %n) {
entry:
- %call = tail call i32 (...)* @bar() #2
+ %call = tail call i32 (...) @bar() #2
%mul = mul nsw i32 %n, 5
%add = add nsw i32 %mul, 9
store i32 %add, i32* %A, align 4
diff --git a/test/Transforms/SLPVectorizer/X86/compare-reduce.ll b/test/Transforms/SLPVectorizer/X86/compare-reduce.ll
index 3c457c4..be17c5d 100644
--- a/test/Transforms/SLPVectorizer/X86/compare-reduce.ll
+++ b/test/Transforms/SLPVectorizer/X86/compare-reduce.ll
@@ -36,7 +36,7 @@ for.body: ; preds = %for.inc, %entry
br i1 %cmp11, label %if.then, label %for.inc
if.then: ; preds = %for.body
- %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
+ %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %for.inc
for.inc: ; preds = %for.body, %if.then
diff --git a/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll b/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll
index ea0064d..eac20a0 100644
--- a/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll
+++ b/test/Transforms/SLPVectorizer/X86/cross_block_slp.ll
@@ -35,7 +35,7 @@ entry:
br i1 %tobool, label %if.end, label %if.then
if.then:
- %call = tail call i32 (...)* @bar()
+ %call = tail call i32 (...) @bar()
br label %if.end
if.end:
diff --git a/test/Transforms/SLPVectorizer/X86/debug_info.ll b/test/Transforms/SLPVectorizer/X86/debug_info.ll
index ccacbcc..60ff358 100644
--- a/test/Transforms/SLPVectorizer/X86/debug_info.ll
+++ b/test/Transforms/SLPVectorizer/X86/debug_info.ll
@@ -59,7 +59,7 @@ attributes #1 = { nounwind readnone }
!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 187335) (llvm/trunk 187335:187340M)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
!1 = !MDFile(filename: "file.c", directory: "/Users/nadav")
-!2 = !{i32 0}
+!2 = !{}
!3 = !{!4}
!4 = !MDSubprogram(name: "depth", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 1, file: !1, scope: !5, type: !6, function: i32 (double*, i32)* @depth, variables: !11)
!5 = !MDFile(filename: "file.c", directory: "/Users/nadav")
diff --git a/test/Transforms/SLPVectorizer/X86/in-tree-user.ll b/test/Transforms/SLPVectorizer/X86/in-tree-user.ll
index a638548..b0ce074 100644
--- a/test/Transforms/SLPVectorizer/X86/in-tree-user.ll
+++ b/test/Transforms/SLPVectorizer/X86/in-tree-user.ll
@@ -35,7 +35,7 @@ for.body: ; preds = %for.inc, %entry
br i1 %cmp11, label %if.then, label %for.inc
if.then: ; preds = %for.body
- %call = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
+ %call = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %for.inc
for.inc: ; preds = %for.body, %if.then
diff --git a/test/Transforms/SLPVectorizer/X86/multi_block.ll b/test/Transforms/SLPVectorizer/X86/multi_block.ll
index 993054a..b381d06 100644
--- a/test/Transforms/SLPVectorizer/X86/multi_block.ll
+++ b/test/Transforms/SLPVectorizer/X86/multi_block.ll
@@ -34,7 +34,7 @@ define i32 @bar(double* nocapture %A, i32 %d) {
br i1 %6, label %9, label %7
; <label>:7 ; preds = %0
- %8 = tail call i32 (...)* @foo()
+ %8 = tail call i32 (...) @foo()
br label %9
; <label>:9 ; preds = %0, %7
diff --git a/test/Transforms/SLPVectorizer/X86/pr16628.ll b/test/Transforms/SLPVectorizer/X86/pr16628.ll
index c22ed34..06abe91 100644
--- a/test/Transforms/SLPVectorizer/X86/pr16628.ll
+++ b/test/Transforms/SLPVectorizer/X86/pr16628.ll
@@ -10,7 +10,7 @@ target triple = "x86_64-apple-macosx10.9.0"
; Function Attrs: nounwind ssp uwtable
define void @f() {
entry:
- %call = tail call i32 (...)* @g()
+ %call = tail call i32 (...) @g()
%0 = load i32, i32* @c, align 4
%lnot = icmp eq i32 %0, 0
%lnot.ext = zext i1 %lnot to i32
diff --git a/test/Transforms/SROA/ppcf128-no-fold.ll b/test/Transforms/SROA/ppcf128-no-fold.ll
new file mode 100644
index 0000000..3f2934c
--- /dev/null
+++ b/test/Transforms/SROA/ppcf128-no-fold.ll
@@ -0,0 +1,36 @@
+; RUN: opt < %s -sroa -S | FileCheck %s
+target datalayout = "E-m:e-i64:64-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+
+%struct.ld2 = type { [2 x ppc_fp128] }
+declare void @bar(i8*, [2 x i128])
+
+define void @foo(i8* %v) #0 {
+entry:
+ %v.addr = alloca i8*, align 8
+ %z = alloca %struct.ld2, align 16
+ store i8* %v, i8** %v.addr, align 8
+ %dat = getelementptr inbounds %struct.ld2, %struct.ld2* %z, i32 0, i32 0
+ %arrayidx = getelementptr inbounds [2 x ppc_fp128], [2 x ppc_fp128]* %dat, i32 0, i64 0
+ store ppc_fp128 0xM403B0000000000000000000000000000, ppc_fp128* %arrayidx, align 16
+ %dat1 = getelementptr inbounds %struct.ld2, %struct.ld2* %z, i32 0, i32 0
+ %arrayidx2 = getelementptr inbounds [2 x ppc_fp128], [2 x ppc_fp128]* %dat1, i32 0, i64 1
+ store ppc_fp128 0xM4093B400000000000000000000000000, ppc_fp128* %arrayidx2, align 16
+ %0 = load i8*, i8** %v.addr, align 8
+ %coerce.dive = getelementptr %struct.ld2, %struct.ld2* %z, i32 0, i32 0
+ %1 = bitcast [2 x ppc_fp128]* %coerce.dive to [2 x i128]*
+ %2 = load [2 x i128], [2 x i128]* %1, align 1
+ call void @bar(i8* %0, [2 x i128] %2)
+ ret void
+}
+
+; CHECK-LABEL: @foo
+; CHECK-NOT: i128 4628293042053316608
+; CHECK-NOT: i128 4653260752096854016
+; CHECK-DAG: i128 bitcast (ppc_fp128 0xM403B0000000000000000000000000000 to i128)
+; CHECK-DAG: i128 bitcast (ppc_fp128 0xM4093B400000000000000000000000000 to i128)
+; CHECK: call void @bar(i8* %v, [2 x i128]
+; CHECK: ret void
+
+attributes #0 = { nounwind }
+
diff --git a/test/Transforms/SampleProfile/branch.ll b/test/Transforms/SampleProfile/branch.ll
index a2d1fc3..ea41ee1 100644
--- a/test/Transforms/SampleProfile/branch.ll
+++ b/test/Transforms/SampleProfile/branch.ll
@@ -70,7 +70,7 @@ for.body: ; preds = %if.end, %for.body
if.end6: ; preds = %for.body, %if.end
%result.0 = phi double [ 0.000000e+00, %if.end ], [ %sub, %for.body ]
- %call7 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %result.0), !dbg !39
+ %call7 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double %result.0), !dbg !39
br label %return, !dbg !40
; CHECK: edge if.end6 -> return probability is 16 / 16 = 100% [HOT edge]
@@ -100,7 +100,7 @@ attributes #4 = { nounwind readonly }
!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 (trunk 192896) (llvm/trunk 192895)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
!1 = !MDFile(filename: "branch.cc", directory: ".")
-!2 = !{i32 0}
+!2 = !{}
!3 = !{!4}
!4 = !MDSubprogram(name: "main", line: 4, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: i32 (i32, i8**)* @main, variables: !12)
!5 = !MDFile(filename: "branch.cc", directory: ".")
diff --git a/test/Transforms/SampleProfile/calls.ll b/test/Transforms/SampleProfile/calls.ll
index 7576dcb..a484995 100644
--- a/test/Transforms/SampleProfile/calls.ll
+++ b/test/Transforms/SampleProfile/calls.ll
@@ -83,7 +83,7 @@ if.end: ; preds = %if.else, %if.then
while.end: ; preds = %while.cond
%4 = load i32, i32* %s, align 4, !dbg !24
- %call2 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
+ %call2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i32 0, i32 0), i32 %4), !dbg !24
ret i32 0, !dbg !25
}
diff --git a/test/Transforms/SampleProfile/fnptr.ll b/test/Transforms/SampleProfile/fnptr.ll
index 07c3c75..9b6653e 100644
--- a/test/Transforms/SampleProfile/fnptr.ll
+++ b/test/Transforms/SampleProfile/fnptr.ll
@@ -114,7 +114,7 @@ for.inc12: ; preds = %for.inc
for.end14: ; preds = %for.inc12
%S.2.lcssa.lcssa = phi double [ %S.2.lcssa, %for.inc12 ]
- %call15 = tail call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %S.2.lcssa.lcssa), !dbg !24
+ %call15 = tail call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), double %S.2.lcssa.lcssa), !dbg !24
ret i32 0, !dbg !25
}
diff --git a/test/Transforms/SampleProfile/propagate.ll b/test/Transforms/SampleProfile/propagate.ll
index fc9dedb..523122a 100644
--- a/test/Transforms/SampleProfile/propagate.ll
+++ b/test/Transforms/SampleProfile/propagate.ll
@@ -184,7 +184,7 @@ entry:
%4 = load i32, i32* %y, align 4, !dbg !41
%5 = load i64, i64* %N, align 8, !dbg !41
%call = call i64 @_Z3fooiil(i32 %3, i32 %4, i64 %5), !dbg !41
- %call1 = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i64 %2, i64 %call), !dbg !41
+ %call1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i32 0, i32 0), i32 %0, i32 %1, i64 %2, i64 %call), !dbg !41
ret i32 0, !dbg !42
}
diff --git a/test/Transforms/ScalarRepl/debuginfo-preserved.ll b/test/Transforms/ScalarRepl/debuginfo-preserved.ll
index 80ce25e..10bad7d 100644
--- a/test/Transforms/ScalarRepl/debuginfo-preserved.ll
+++ b/test/Transforms/ScalarRepl/debuginfo-preserved.ll
@@ -61,5 +61,5 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata) nounwind readnone
!16 = !MDLocation(line: 5, column: 5, scope: !11)
!17 = !{!1}
!18 = !MDFile(filename: "/d/j/debug-test.c", directory: "/Volumes/Data/b")
-!19 = !{i32 0}
+!19 = !{}
!20 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/test/Transforms/ScalarRepl/inline-vector.ll b/test/Transforms/ScalarRepl/inline-vector.ll
index 5d856c6..85f3741 100644
--- a/test/Transforms/ScalarRepl/inline-vector.ll
+++ b/test/Transforms/ScalarRepl/inline-vector.ll
@@ -45,7 +45,7 @@ for.end: ; preds = %for.cond
%x = getelementptr inbounds %struct.Vector4, %struct.Vector4* %vector, i32 0, i32 0
%tmp5 = load float, float* %x, align 16
%conv = fpext float %tmp5 to double
- %call = call i32 (...)* @printf(double %conv) nounwind
+ %call = call i32 (...) @printf(double %conv) nounwind
ret void
}
diff --git a/test/Transforms/ScalarRepl/only-memcpy-uses.ll b/test/Transforms/ScalarRepl/only-memcpy-uses.ll
index 935c289..d0ed20b 100644
--- a/test/Transforms/ScalarRepl/only-memcpy-uses.ll
+++ b/test/Transforms/ScalarRepl/only-memcpy-uses.ll
@@ -18,7 +18,7 @@ entry:
%tmp2 = bitcast %struct.S* %agg.tmp to i8*
%tmp3 = bitcast %struct.S* %t to i8*
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp2, i8* %tmp3, i64 48, i32 4, i1 false)
- %call = call i32 (...)* @bazz(%struct.S* byval %agg.tmp)
+ %call = call i32 (...) @bazz(%struct.S* byval %agg.tmp)
ret void
}
diff --git a/test/Transforms/ScalarRepl/phi-cycle.ll b/test/Transforms/ScalarRepl/phi-cycle.ll
index 6089936..a44f081 100644
--- a/test/Transforms/ScalarRepl/phi-cycle.ll
+++ b/test/Transforms/ScalarRepl/phi-cycle.ll
@@ -67,10 +67,10 @@ while.cond.backedge.i: ; preds = %if.end.i, %while.bo
; CHECK: func.exit:
; CHECK-NOT: load
-; CHECK: %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %tmp) [[NUW:#[0-9]+]]
+; CHECK: %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %tmp) [[NUW:#[0-9]+]]
func.exit: ; preds = %while.body.i.func.exit_crit_edge, %while.cond.i.func.exit_crit_edge
%tmp3 = load i32, i32* %x.i, align 4
- %call = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %tmp3) nounwind
+ %call = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %tmp3) nounwind
ret i32 0
}
diff --git a/test/Transforms/Scalarizer/dbginfo.ll b/test/Transforms/Scalarizer/dbginfo.ll
index 2bc9335..37a810f 100644
--- a/test/Transforms/Scalarizer/dbginfo.ll
+++ b/test/Transforms/Scalarizer/dbginfo.ll
@@ -59,7 +59,7 @@ attributes #1 = { nounwind readnone }
!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.4 (trunk 194134) (llvm/trunk 194126)", isOptimized: true, emissionKind: 0, file: !1, enums: !2, retainedTypes: !2, subprograms: !3, globals: !2, imports: !2)
!1 = !MDFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build")
-!2 = !{i32 0}
+!2 = !{}
!3 = !{!4}
!4 = !MDSubprogram(name: "f1", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 4, file: !1, scope: !5, type: !6, function: void (<4 x i32>*, <4 x i32>*, <4 x i32>*)* @f1, variables: !14)
!5 = !MDFile(filename: "/tmp/add.c", directory: "/home/richards/llvm/build")
diff --git a/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll b/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll
index 46df0f0..99041ed 100644
--- a/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll
+++ b/test/Transforms/SimplifyCFG/2007-12-21-Crash.ll
@@ -13,7 +13,7 @@ bb5.outer: ; preds = %bb5.outer.loopexit, %entry
br label %bb5
bb5: ; preds = %bb5, %bb5.outer
- %tmp6 = tail call i32 (...)* @foo( ) nounwind ; <i32> [#uses=1]
+ %tmp6 = tail call i32 (...) @foo( ) nounwind ; <i32> [#uses=1]
switch i32 %tmp6, label %bb13 [
i32 -1, label %bb10
i32 102, label %bb5
@@ -21,7 +21,7 @@ bb5: ; preds = %bb5, %bb5.outer
]
bb10: ; preds = %bb5
- %tmp12 = tail call i32 (...)* @bar( i32 %undo.0.ph ) nounwind ; <i32> [#uses=0]
+ %tmp12 = tail call i32 (...) @bar( i32 %undo.0.ph ) nounwind ; <i32> [#uses=0]
br label %UnifiedReturnBlock
bb13: ; preds = %bb5
diff --git a/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll b/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll
index 2ef49bf..154677b 100644
--- a/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll
+++ b/test/Transforms/SimplifyCFG/2008-07-13-InfLoopMiscompile.ll
@@ -29,7 +29,7 @@ cowblock: ; preds = %beeblock, %monkeyblock
func_1.exit: ; preds = %cowblock, %entry
%outval = phi i32 [ %cowval, %cowblock ], [ 1, %entry ] ; <i32> [#uses=1]
- %pout = tail call i32 (i8*, ...)* @printf( i8* noalias getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %outval ) nounwind ; <i32> [#uses=0]
+ %pout = tail call i32 (i8*, ...) @printf( i8* noalias getelementptr ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i32 %outval ) nounwind ; <i32> [#uses=0]
ret i32 0
}
diff --git a/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll b/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll
index 7271024..4fc21d9 100644
--- a/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll
+++ b/test/Transforms/SimplifyCFG/2008-12-16-DCECond.ll
@@ -9,7 +9,7 @@ entry:
br i1 %cmp, label %ifthen, label %ifend
ifthen: ; preds = %entry
- %call = call i32 (...)* @foo() ; <i32> [#uses=0]
+ %call = call i32 (...) @foo() ; <i32> [#uses=0]
br label %ifend
ifend: ; preds = %ifthen, %entry
@@ -17,7 +17,7 @@ ifend: ; preds = %ifthen, %entry
br i1 %cmp2, label %ifthen3, label %ifend5
ifthen3: ; preds = %ifend
- %call4 = call i32 (...)* @foo() ; <i32> [#uses=0]
+ %call4 = call i32 (...) @foo() ; <i32> [#uses=0]
br label %ifend5
ifend5: ; preds = %ifthen3, %ifend
@@ -25,7 +25,7 @@ ifend5: ; preds = %ifthen3, %ifend
br i1 %cmp7, label %ifthen8, label %ifend10
ifthen8: ; preds = %ifend5
- %call9 = call i32 (...)* @bar() ; <i32> [#uses=0]
+ %call9 = call i32 (...) @bar() ; <i32> [#uses=0]
br label %ifend10
ifend10: ; preds = %ifthen8, %ifend5
@@ -33,7 +33,7 @@ ifend10: ; preds = %ifthen8, %ifend5
br i1 %cmp12, label %ifthen13, label %ifend15
ifthen13: ; preds = %ifend10
- %call14 = call i32 (...)* @bar() ; <i32> [#uses=0]
+ %call14 = call i32 (...) @bar() ; <i32> [#uses=0]
br label %ifend15
ifend15: ; preds = %ifthen13, %ifend10
diff --git a/test/Transforms/SimplifyCFG/UnreachableEliminate.ll b/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
index 22b144b..8718c55 100644
--- a/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
+++ b/test/Transforms/SimplifyCFG/UnreachableEliminate.ll
@@ -22,11 +22,15 @@ entry:
invoke void @test2( )
to label %N unwind label %U
U:
+ %res = landingpad { i8* } personality i32 (...)* @__gxx_personality_v0
+ cleanup
unreachable
N:
ret void
}
+declare i32 @__gxx_personality_v0(...)
+
define i32 @test3(i32 %v) {
; CHECK-LABEL: @test3(
; CHECK: entry:
diff --git a/test/Transforms/SimplifyCFG/common-dest-folding.ll b/test/Transforms/SimplifyCFG/common-dest-folding.ll
index 0aa3b2c..e3e27c7 100644
--- a/test/Transforms/SimplifyCFG/common-dest-folding.ll
+++ b/test/Transforms/SimplifyCFG/common-dest-folding.ll
@@ -18,7 +18,7 @@ define i32 @foo(i32 %k, i32 %c1, i32 %c2) {
br i1 %5, label %8, label %6
; <label>:6 ; preds = %3
- %7 = tail call i32 (...)* @bar() nounwind
+ %7 = tail call i32 (...) @bar() nounwind
br label %8
; <label>:8 ; preds = %3, %0, %6
@@ -47,7 +47,7 @@ bb3: ; preds = %bb
br i1 %tmp6, label %bb9, label %bb7
bb7: ; preds = %bb3
- %tmp8 = tail call i32 (...)* @bar() #1
+ %tmp8 = tail call i32 (...) @bar() #1
br label %bb9
bb9: ; preds = %bb7, %bb3, %bb
diff --git a/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll b/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
index ac5ab60..ee7df26 100644
--- a/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
+++ b/test/Transforms/SimplifyCFG/hoist-dbgvalue.ll
@@ -4,17 +4,17 @@ define i32 @foo(i32 %i) nounwind ssp {
call void @llvm.dbg.value(metadata i32 %i, i64 0, metadata !6, metadata !MDExpression()), !dbg !7
call void @llvm.dbg.value(metadata i32 0, i64 0, metadata !9, metadata !MDExpression()), !dbg !11
%1 = icmp ne i32 %i, 0, !dbg !12
-;CHECK: call i32 (...)* @bar()
+;CHECK: call i32 (...) @bar()
;CHECK-NEXT: llvm.dbg.value
br i1 %1, label %2, label %4, !dbg !12
; <label>:2 ; preds = %0
- %3 = call i32 (...)* @bar(), !dbg !13
+ %3 = call i32 (...) @bar(), !dbg !13
call void @llvm.dbg.value(metadata i32 %3, i64 0, metadata !9, metadata !MDExpression()), !dbg !13
br label %6, !dbg !15
; <label>:4 ; preds = %0
- %5 = call i32 (...)* @bar(), !dbg !16
+ %5 = call i32 (...) @bar(), !dbg !16
call void @llvm.dbg.value(metadata i32 %5, i64 0, metadata !9, metadata !MDExpression()), !dbg !16
br label %6, !dbg !18
diff --git a/test/Transforms/SimplifyCFG/trap-debugloc.ll b/test/Transforms/SimplifyCFG/trap-debugloc.ll
index a86649b..65c7e41 100644
--- a/test/Transforms/SimplifyCFG/trap-debugloc.ll
+++ b/test/Transforms/SimplifyCFG/trap-debugloc.ll
@@ -13,7 +13,7 @@ define void @foo() nounwind ssp {
!0 = !MDSubprogram(name: "foo", line: 3, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, file: !8, scope: !1, type: !3, function: void ()* @foo)
!1 = !MDFile(filename: "foo.c", directory: "/private/tmp")
-!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-206.1) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: 0, file: !8, enums: !4, retainedTypes: !4, subprograms: !9)
+!2 = !MDCompileUnit(language: DW_LANG_C99, producer: "Apple clang version 3.0 (tags/Apple/clang-206.1) (based on LLVM 3.0svn)", isOptimized: true, emissionKind: 0, file: !8, enums: !{}, retainedTypes: !{}, subprograms: !9)
!3 = !MDSubroutineType(types: !4)
!4 = !{null}
!5 = !MDLocation(line: 4, column: 2, scope: !6)
diff --git a/test/Transforms/SimplifyCFG/volatile-phioper.ll b/test/Transforms/SimplifyCFG/volatile-phioper.ll
index f2d4b8b..c366d05 100644
--- a/test/Transforms/SimplifyCFG/volatile-phioper.ll
+++ b/test/Transforms/SimplifyCFG/volatile-phioper.ll
@@ -17,12 +17,12 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
define void @test(i8** nocapture %PeiServices) #0 {
entry:
- %call = tail call i32 (...)* @Trace() #2
+ %call = tail call i32 (...) @Trace() #2
%tobool = icmp eq i32 %call, 0
br i1 %tobool, label %while.body, label %if.then
if.then: ; preds = %entry
- %call1 = tail call i32 (...)* @Trace() #2
+ %call1 = tail call i32 (...) @Trace() #2
br label %while.body
while.body: ; preds = %entry, %if.then, %while.body
diff --git a/test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll b/test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll
index 94c47c7..e2201ce 100644
--- a/test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll
+++ b/test/Transforms/StraightLineStrengthReduce/X86/no-slsr.ll
@@ -5,8 +5,8 @@ target triple = "x86_64-unknown-linux-gnu"
; Do not perform SLSR on &input[s] and &input[s * 2] which fit into addressing
; modes of X86.
-define i32 @slsr_gep(i32* %input, i64 %s) {
-; CHECK-LABEL: @slsr_gep(
+define i32 @no_slsr_gep(i32* %input, i64 %s) {
+; CHECK-LABEL: @no_slsr_gep(
; v0 = input[0];
%p0 = getelementptr inbounds i32, i32* %input, i64 0
%v0 = load i32, i32* %p0
@@ -28,3 +28,17 @@ define i32 @slsr_gep(i32* %input, i64 %s) {
ret i32 %2
}
+define void @no_slsr_add(i32 %b, i32 %s) {
+; CHECK-LABEL: @no_slsr_add(
+ %1 = add i32 %b, %s
+; CHECK: add i32 %b, %s
+ call void @foo(i32 %1)
+ %s2 = mul i32 %s, 2
+; CHECK: %s2 = mul i32 %s, 2
+ %2 = add i32 %b, %s2
+; CHECK: add i32 %b, %s2
+ call void @foo(i32 %2)
+ ret void
+}
+
+declare void @foo(i32 %a)
diff --git a/test/Transforms/StraightLineStrengthReduce/slsr-add.ll b/test/Transforms/StraightLineStrengthReduce/slsr-add.ll
new file mode 100644
index 0000000..4c79be0
--- /dev/null
+++ b/test/Transforms/StraightLineStrengthReduce/slsr-add.ll
@@ -0,0 +1,101 @@
+; RUN: opt < %s -slsr -gvn -dce -S | FileCheck %s
+
+target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
+
+define void @shl(i32 %b, i32 %s) {
+; CHECK-LABEL: @shl(
+ %1 = add i32 %b, %s
+; [[BASIS:%[a-zA-Z0-9]+]] = add i32 %b, %s
+ call void @foo(i32 %1)
+ %s2 = shl i32 %s, 1
+ %2 = add i32 %b, %s2
+; add i32 [[BASIS]], %s
+ call void @foo(i32 %2)
+ ret void
+}
+
+define void @stride_is_2s(i32 %b, i32 %s) {
+; CHECK-LABEL: @stride_is_2s(
+ %s2 = shl i32 %s, 1
+; CHECK: %s2 = shl i32 %s, 1
+ %1 = add i32 %b, %s2
+; CHECK: [[t1:%[a-zA-Z0-9]+]] = add i32 %b, %s2
+ call void @foo(i32 %1)
+ %s4 = shl i32 %s, 2
+ %2 = add i32 %b, %s4
+; CHECK: [[t2:%[a-zA-Z0-9]+]] = add i32 [[t1]], %s2
+ call void @foo(i32 %2)
+ %s6 = mul i32 %s, 6
+ %3 = add i32 %b, %s6
+; CHECK: add i32 [[t2]], %s2
+ call void @foo(i32 %3)
+ ret void
+}
+
+define void @stride_is_3s(i32 %b, i32 %s) {
+; CHECK-LABEL: @stride_is_3s(
+ %1 = add i32 %s, %b
+; CHECK: [[t1:%[a-zA-Z0-9]+]] = add i32 %s, %b
+ call void @foo(i32 %1)
+ %s4 = shl i32 %s, 2
+ %2 = add i32 %s4, %b
+; CHECK: [[bump:%[a-zA-Z0-9]+]] = mul i32 %s, 3
+; CHECK: [[t2:%[a-zA-Z0-9]+]] = add i32 [[t1]], [[bump]]
+ call void @foo(i32 %2)
+ %s7 = mul i32 %s, 7
+ %3 = add i32 %s7, %b
+; CHECK: add i32 [[t2]], [[bump]]
+ call void @foo(i32 %3)
+ ret void
+}
+
+; foo(b + 6 * s);
+; foo(b + 4 * s);
+; foo(b + 2 * s);
+; =>
+; t1 = b + 6 * s;
+; foo(t1);
+; s2 = 2 * s;
+; t2 = t1 - s2;
+; foo(t2);
+; t3 = t2 - s2;
+; foo(t3);
+define void @stride_is_minus_2s(i32 %b, i32 %s) {
+; CHECK-LABEL: @stride_is_minus_2s(
+ %s6 = mul i32 %s, 6
+ %1 = add i32 %b, %s6
+; CHECK: [[t1:%[a-zA-Z0-9]+]] = add i32 %b, %s6
+; CHECK: call void @foo(i32 [[t1]])
+ call void @foo(i32 %1)
+ %s4 = shl i32 %s, 2
+ %2 = add i32 %b, %s4
+; CHECK: [[bump:%[a-zA-Z0-9]+]] = shl i32 %s, 1
+; CHECK: [[t2:%[a-zA-Z0-9]+]] = sub i32 [[t1]], [[bump]]
+ call void @foo(i32 %2)
+; CHECK: call void @foo(i32 [[t2]])
+ %s2 = shl i32 %s, 1
+ %3 = add i32 %b, %s2
+; CHECK: [[t3:%[a-zA-Z0-9]+]] = sub i32 [[t2]], [[bump]]
+ call void @foo(i32 %3)
+; CHECK: call void @foo(i32 [[t3]])
+ ret void
+}
+
+; t = b + (s << 3);
+; foo(t);
+; foo(b + s);
+;
+; do not rewrite b + s to t - 7 * s because the latter is more complicated.
+define void @simple_enough(i32 %b, i32 %s) {
+; CHECK-LABEL: @simple_enough(
+ %s8 = shl i32 %s, 3
+ %1 = add i32 %b, %s8
+ call void @foo(i32 %1)
+ %2 = add i32 %b, %s
+; CHECK: [[t:%[a-zA-Z0-9]+]] = add i32 %b, %s{{$}}
+ call void @foo(i32 %2)
+; CHECK: call void @foo(i32 [[t]])
+ ret void
+}
+
+declare void @foo(i32)
diff --git a/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll b/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll
index 47e6637..3944739 100644
--- a/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll
+++ b/test/Transforms/StraightLineStrengthReduce/slsr-gep.ll
@@ -2,77 +2,108 @@
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
-define i32 @slsr_gep(i32* %input, i64 %s) {
+; foo(input[0]);
+; foo(input[s]);
+; foo(input[s * 2]);
+; =>
+; p0 = &input[0];
+; foo(*p);
+; p1 = p0 + s;
+; foo(*p1);
+; p2 = p1 + s;
+; foo(*p2);
+define void @slsr_gep(i32* %input, i64 %s) {
; CHECK-LABEL: @slsr_gep(
; v0 = input[0];
%p0 = getelementptr inbounds i32, i32* %input, i64 0
%v0 = load i32, i32* %p0
+ call void @foo(i32 %v0)
; v1 = input[s];
%p1 = getelementptr inbounds i32, i32* %input, i64 %s
; CHECK: %p1 = getelementptr inbounds i32, i32* %input, i64 %s
%v1 = load i32, i32* %p1
+ call void @foo(i32 %v1)
; v2 = input[s * 2];
- %s2 = mul nsw i64 %s, 2
+ %s2 = shl nsw i64 %s, 1
%p2 = getelementptr inbounds i32, i32* %input, i64 %s2
; CHECK: %p2 = getelementptr inbounds i32, i32* %p1, i64 %s
%v2 = load i32, i32* %p2
+ call void @foo(i32 %v2)
- ; return v0 + v1 + v2;
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- ret i32 %2
+ ret void
}
-define i32 @slsr_gep_sext(i32* %input, i32 %s) {
+; foo(input[0]);
+; foo(input[(long)s]);
+; foo(input[(long)(s * 2)]);
+; =>
+; p0 = &input[0];
+; foo(*p);
+; p1 = p0 + (long)s;
+; foo(*p1);
+; p2 = p1 + (long)s;
+; foo(*p2);
+define void @slsr_gep_sext(i32* %input, i32 %s) {
; CHECK-LABEL: @slsr_gep_sext(
; v0 = input[0];
%p0 = getelementptr inbounds i32, i32* %input, i64 0
%v0 = load i32, i32* %p0
+ call void @foo(i32 %v0)
- ; v1 = input[(long)s];
+ ; v1 = input[s];
%t = sext i32 %s to i64
%p1 = getelementptr inbounds i32, i32* %input, i64 %t
; CHECK: %p1 = getelementptr inbounds i32, i32* %input, i64 %t
%v1 = load i32, i32* %p1
+ call void @foo(i32 %v1)
- ; v2 = input[(long)(s * 2)];
- %s2 = mul nsw i32 %s, 2
+ ; v2 = input[s * 2];
+ %s2 = shl nsw i32 %s, 1
%t2 = sext i32 %s2 to i64
%p2 = getelementptr inbounds i32, i32* %input, i64 %t2
; CHECK: %p2 = getelementptr inbounds i32, i32* %p1, i64 %t
%v2 = load i32, i32* %p2
+ call void @foo(i32 %v2)
- ; return v0 + v1 + v2;
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- ret i32 %2
+ ret void
}
-define i32 @slsr_gep_2d([10 x [5 x i32]]* %input, i64 %s, i64 %t) {
+; int input[10][5];
+; foo(input[s][t]);
+; foo(input[s * 2][t]);
+; foo(input[s * 3][t]);
+; =>
+; p0 = &input[s][t];
+; foo(*p0);
+; p1 = p0 + 5s;
+; foo(*p1);
+; p2 = p1 + 5s;
+; foo(*p2);
+define void @slsr_gep_2d([10 x [5 x i32]]* %input, i64 %s, i64 %t) {
; CHECK-LABEL: @slsr_gep_2d(
; v0 = input[s][t];
%p0 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* %input, i64 0, i64 %s, i64 %t
%v0 = load i32, i32* %p0
+ call void @foo(i32 %v0)
; v1 = input[s * 2][t];
- %s2 = mul nsw i64 %s, 2
+ %s2 = shl nsw i64 %s, 1
; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = mul i64 %s, 5
%p1 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* %input, i64 0, i64 %s2, i64 %t
; CHECK: %p1 = getelementptr inbounds i32, i32* %p0, i64 [[BUMP]]
%v1 = load i32, i32* %p1
+ call void @foo(i32 %v1)
- ; v2 = input[s * 3][t];
+ ; v3 = input[s * 3][t];
%s3 = mul nsw i64 %s, 3
%p2 = getelementptr inbounds [10 x [5 x i32]], [10 x [5 x i32]]* %input, i64 0, i64 %s3, i64 %t
; CHECK: %p2 = getelementptr inbounds i32, i32* %p1, i64 [[BUMP]]
%v2 = load i32, i32* %p2
+ call void @foo(i32 %v2)
- ; return v0 + v1 + v2;
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- ret i32 %2
+ ret void
}
%struct.S = type <{ i64, i32 }>
@@ -83,27 +114,55 @@ define i32 @slsr_gep_2d([10 x [5 x i32]]* %input, i64 %s, i64 %t) {
; which may not be divisible by typeof(input[s][t].f1) = 8. Therefore, we
; rewrite the candidates using byte offset instead of index offset as in
; @slsr_gep_2d.
-define i64 @slsr_gep_uglygep([10 x [5 x %struct.S]]* %input, i64 %s, i64 %t) {
+define void @slsr_gep_uglygep([10 x [5 x %struct.S]]* %input, i64 %s, i64 %t) {
; CHECK-LABEL: @slsr_gep_uglygep(
; v0 = input[s][t].f1;
%p0 = getelementptr inbounds [10 x [5 x %struct.S]], [10 x [5 x %struct.S]]* %input, i64 0, i64 %s, i64 %t, i32 0
%v0 = load i64, i64* %p0
+ call void @bar(i64 %v0)
; v1 = input[s * 2][t].f1;
- %s2 = mul nsw i64 %s, 2
+ %s2 = shl nsw i64 %s, 1
; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = mul i64 %s, 60
%p1 = getelementptr inbounds [10 x [5 x %struct.S]], [10 x [5 x %struct.S]]* %input, i64 0, i64 %s2, i64 %t, i32 0
; CHECK: getelementptr inbounds i8, i8* %{{[0-9]+}}, i64 [[BUMP]]
%v1 = load i64, i64* %p1
+ call void @bar(i64 %v1)
; v2 = input[s * 3][t].f1;
%s3 = mul nsw i64 %s, 3
%p2 = getelementptr inbounds [10 x [5 x %struct.S]], [10 x [5 x %struct.S]]* %input, i64 0, i64 %s3, i64 %t, i32 0
; CHECK: getelementptr inbounds i8, i8* %{{[0-9]+}}, i64 [[BUMP]]
%v2 = load i64, i64* %p2
+ call void @bar(i64 %v2)
+
+ ret void
+}
+
+define void @slsr_out_of_bounds_gep(i32* %input, i32 %s) {
+; CHECK-LABEL: @slsr_out_of_bounds_gep(
+ ; v0 = input[0];
+ %p0 = getelementptr i32, i32* %input, i64 0
+ %v0 = load i32, i32* %p0
+ call void @foo(i32 %v0)
- ; return v0 + v1 + v2;
- %1 = add i64 %v0, %v1
- %2 = add i64 %1, %v2
- ret i64 %2
+ ; v1 = input[(long)s];
+ %t = sext i32 %s to i64
+ %p1 = getelementptr i32, i32* %input, i64 %t
+; CHECK: %p1 = getelementptr i32, i32* %input, i64 %t
+ %v1 = load i32, i32* %p1
+ call void @foo(i32 %v1)
+
+ ; v2 = input[(long)(s * 2)];
+ %s2 = shl nsw i32 %s, 1
+ %t2 = sext i32 %s2 to i64
+ %p2 = getelementptr i32, i32* %input, i64 %t2
+; CHECK: %p2 = getelementptr i32, i32* %p1, i64 %t
+ %v2 = load i32, i32* %p2
+ call void @foo(i32 %v2)
+
+ ret void
}
+
+declare void @foo(i32)
+declare void @bar(i64)
diff --git a/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll b/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
index 0a7e472..1c7333d 100644
--- a/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
+++ b/test/Transforms/StraightLineStrengthReduce/slsr-mul.ll
@@ -2,37 +2,32 @@
target datalayout = "e-i64:64-v16:16-v32:32-n16:32:64"
-declare i32 @foo(i32 %a)
-
-define i32 @slsr1(i32 %b, i32 %s) {
+define void @slsr1(i32 %b, i32 %s) {
; CHECK-LABEL: @slsr1(
- ; v0 = foo(b * s);
+ ; foo(b * s);
%mul0 = mul i32 %b, %s
; CHECK: mul i32
; CHECK-NOT: mul i32
- %v0 = call i32 @foo(i32 %mul0)
+ call void @foo(i32 %mul0)
- ; v1 = foo((b + 1) * s);
+ ; foo((b + 1) * s);
%b1 = add i32 %b, 1
%mul1 = mul i32 %b1, %s
- %v1 = call i32 @foo(i32 %mul1)
+ call void @foo(i32 %mul1)
- ; v2 = foo((b + 2) * s);
+ ; foo((b + 2) * s);
%b2 = add i32 %b, 2
%mul2 = mul i32 %b2, %s
- %v2 = call i32 @foo(i32 %mul2)
+ call void @foo(i32 %mul2)
- ; return v0 + v1 + v2;
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- ret i32 %2
+ ret void
}
-; v0 = foo(a * b)
-; v1 = foo((a + 1) * b)
-; v2 = foo(a * (b + 1))
-; v3 = foo((a + 1) * (b + 1))
-define i32 @slsr2(i32 %a, i32 %b) {
+; foo(a * b)
+; foo((a + 1) * b)
+; foo(a * (b + 1))
+; foo((a + 1) * (b + 1))
+define void @slsr2(i32 %a, i32 %b) {
; CHECK-LABEL: @slsr2(
%a1 = add i32 %a, 1
%b1 = add i32 %b, 1
@@ -43,63 +38,50 @@ define i32 @slsr2(i32 %a, i32 %b) {
%mul2 = mul i32 %a, %b1
%mul3 = mul i32 %a1, %b1
- %v0 = call i32 @foo(i32 %mul0)
- %v1 = call i32 @foo(i32 %mul1)
- %v2 = call i32 @foo(i32 %mul2)
- %v3 = call i32 @foo(i32 %mul3)
+ call void @foo(i32 %mul0)
+ call void @foo(i32 %mul1)
+ call void @foo(i32 %mul2)
+ call void @foo(i32 %mul3)
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- %3 = add i32 %2, %v3
- ret i32 %3
+ ret void
}
; The bump is a multiple of the stride.
;
-; v0 = foo(b * s);
-; v1 = foo((b + 2) * s);
-; v2 = foo((b + 4) * s);
-; return v0 + v1 + v2;
-;
-; ==>
-;
+; foo(b * s);
+; foo((b + 2) * s);
+; foo((b + 4) * s);
+; =>
; mul0 = b * s;
-; v0 = foo(mul0);
; bump = s * 2;
; mul1 = mul0 + bump; // GVN ensures mul1 and mul2 use the same bump.
-; v1 = foo(mul1);
; mul2 = mul1 + bump;
-; v2 = foo(mul2);
-; return v0 + v1 + v2;
-define i32 @slsr3(i32 %b, i32 %s) {
+define void @slsr3(i32 %b, i32 %s) {
; CHECK-LABEL: @slsr3(
%mul0 = mul i32 %b, %s
; CHECK: mul i32
- %v0 = call i32 @foo(i32 %mul0)
+ call void @foo(i32 %mul0)
%b1 = add i32 %b, 2
%mul1 = mul i32 %b1, %s
-; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = mul i32 %s, 2
+; CHECK: [[BUMP:%[a-zA-Z0-9]+]] = shl i32 %s, 1
; CHECK: %mul1 = add i32 %mul0, [[BUMP]]
- %v1 = call i32 @foo(i32 %mul1)
+ call void @foo(i32 %mul1)
%b2 = add i32 %b, 4
%mul2 = mul i32 %b2, %s
; CHECK: %mul2 = add i32 %mul1, [[BUMP]]
- %v2 = call i32 @foo(i32 %mul2)
+ call void @foo(i32 %mul2)
- %1 = add i32 %v0, %v1
- %2 = add i32 %1, %v2
- ret i32 %2
+ ret void
}
; Do not rewrite a candidate if its potential basis does not dominate it.
-; v0 = 0;
+;
; if (cond)
-; v0 = foo(a * b);
-; v1 = foo((a + 1) * b);
-; return v0 + v1;
-define i32 @not_dominate(i1 %cond, i32 %a, i32 %b) {
+; foo(a * b);
+; foo((a + 1) * b);
+define void @not_dominate(i1 %cond, i32 %a, i32 %b) {
; CHECK-LABEL: @not_dominate(
entry:
%a1 = add i32 %a, 1
@@ -108,14 +90,14 @@ entry:
then:
%mul0 = mul i32 %a, %b
; CHECK: %mul0 = mul i32 %a, %b
- %v0 = call i32 @foo(i32 %mul0)
+ call void @foo(i32 %mul0)
br label %merge
merge:
- %v0.phi = phi i32 [ 0, %entry ], [ %mul0, %then ]
%mul1 = mul i32 %a1, %b
; CHECK: %mul1 = mul i32 %a1, %b
- %v1 = call i32 @foo(i32 %mul1)
- %sum = add i32 %v0.phi, %v1
- ret i32 %sum
+ call void @foo(i32 %mul1)
+ ret void
}
+
+declare void @foo(i32)
diff --git a/test/Transforms/StripSymbols/2010-08-25-crash.ll b/test/Transforms/StripSymbols/2010-08-25-crash.ll
index 457dfd1..7fd3bcc 100644
--- a/test/Transforms/StripSymbols/2010-08-25-crash.ll
+++ b/test/Transforms/StripSymbols/2010-08-25-crash.ll
@@ -18,7 +18,7 @@ entry:
!8 = !MDLocation(line: 3, column: 13, scope: !9)
!9 = distinct !MDLexicalBlock(line: 3, column: 11, file: !10, scope: !0)
!10 = !MDFile(filename: "/tmp/a.c", directory: "/Volumes/Lalgate/clean/D.CW")
-!11 = !{i32 0}
+!11 = !{}
!12 = !{!0}
!13 = !{!6}
!14 = !{i32 1, !"Debug Info Version", i32 3}
diff --git a/test/Transforms/StripSymbols/strip-dead-debug-info.ll b/test/Transforms/StripSymbols/strip-dead-debug-info.ll
index febb944..d9511b8 100644
--- a/test/Transforms/StripSymbols/strip-dead-debug-info.ll
+++ b/test/Transforms/StripSymbols/strip-dead-debug-info.ll
@@ -30,7 +30,7 @@ attributes #2 = { nounwind readonly ssp }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!25}
-!0 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !2, subprograms: !23, globals: !24)
+!0 = !MDCompileUnit(language: DW_LANG_C89, producer: "4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", isOptimized: true, emissionKind: 1, file: !1, enums: !{}, retainedTypes: !{}, subprograms: !23, globals: !24)
!1 = !MDFile(filename: "g.c", directory: "/tmp/")
!2 = !{null}
!3 = !MDSubprogram(name: "bar", line: 5, isLocal: true, isDefinition: true, virtualIndex: 6, isOptimized: true, file: !1, scope: null, type: !4)
diff --git a/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll b/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll
index 2921860..4f7a3ca 100644
--- a/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll
+++ b/test/Transforms/TailDup/2008-06-11-AvoidDupLoopHeader.ll
@@ -11,7 +11,7 @@ bb: ; preds = %entry
br label %bb9
bb5: ; preds = %bb9
- %tmp7 = call i32 (...)* @bar( i32 %x.0 ) nounwind ; <i32> [#uses=1]
+ %tmp7 = call i32 (...) @bar( i32 %x.0 ) nounwind ; <i32> [#uses=1]
br label %bb9
bb9: ; preds = %bb5, %bb, %entry