diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2011-07-17 15:36:56 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2011-07-17 15:36:56 +0000 |
| commit | 411bd29eea3c360d5b48a18a17b5e87f5671af0e (patch) | |
| tree | c8086addb211fa670a9d2b1038d8c2e453229755 /test/Transforms/GVN | |
| parent | 56fe8f14099930935e3870e3e823c322a85c1c89 (diff) | |
Notes
Diffstat (limited to 'test/Transforms/GVN')
| -rw-r--r-- | test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll | 25 | ||||
| -rw-r--r-- | test/Transforms/GVN/2008-02-26-MemCpySize.ll | 46 | ||||
| -rw-r--r-- | test/Transforms/GVN/2011-04-27-phioperands.ll | 106 | ||||
| -rw-r--r-- | test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll | 85 | ||||
| -rw-r--r-- | test/Transforms/GVN/nonescaping-malloc.ll | 98 | ||||
| -rw-r--r-- | test/Transforms/GVN/rle.ll | 21 |
6 files changed, 250 insertions, 131 deletions
diff --git a/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll b/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll deleted file mode 100644 index 9a75e1ad978cd..0000000000000 --- a/test/Transforms/GVN/2008-02-24-NonDominatedMemcpy.ll +++ /dev/null @@ -1,25 +0,0 @@ -; RUN: opt < %s -gvn -dse -S | grep {call.*memcpy} | count 1 - -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" -target triple = "x86_64-apple-darwin8" - %struct.ggFrame3 = type { %struct.ggPoint3, %struct.ggONB3 } - %struct.ggHMatrix3 = type { [4 x [4 x double]] } - %struct.ggONB3 = type { %struct.ggPoint3, %struct.ggPoint3, %struct.ggPoint3 } - %struct.ggPoint3 = type { [3 x double] } - %struct.ggQuaternion = type { [4 x double], i32, %struct.ggHMatrix3 } - -declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) nounwind - -define void @_Z10ggCRSplineRK8ggFrame3S1_S1_S1_d(%struct.ggFrame3* noalias sret %agg.result, %struct.ggFrame3* %f0, %struct.ggFrame3* %f1, %struct.ggFrame3* %f2, %struct.ggFrame3* %f3, double %t) nounwind { -entry: - %qresult = alloca %struct.ggQuaternion ; <%struct.ggQuaternion*> [#uses=1] - %tmp = alloca %struct.ggONB3 ; <%struct.ggONB3*> [#uses=2] - call void @_ZN12ggQuaternion7getONB3Ev( %struct.ggONB3* noalias sret %tmp, %struct.ggQuaternion* %qresult ) nounwind - %tmp1.i = getelementptr %struct.ggFrame3* %agg.result, i32 0, i32 1 ; <%struct.ggONB3*> [#uses=1] - %tmp13.i = bitcast %struct.ggONB3* %tmp1.i to i8* ; <i8*> [#uses=1] - %tmp24.i = bitcast %struct.ggONB3* %tmp to i8* ; <i8*> [#uses=1] - call void @llvm.memcpy.i64( i8* %tmp13.i, i8* %tmp24.i, i64 72, i32 8 ) nounwind - ret void -} - -declare void @_ZN12ggQuaternion7getONB3Ev(%struct.ggONB3* noalias sret , %struct.ggQuaternion*) nounwind diff --git a/test/Transforms/GVN/2008-02-26-MemCpySize.ll b/test/Transforms/GVN/2008-02-26-MemCpySize.ll deleted file mode 100644 index 6ed8a76c0de2f..0000000000000 --- a/test/Transforms/GVN/2008-02-26-MemCpySize.ll +++ /dev/null @@ -1,46 +0,0 @@ -; RUN: opt < %s -gvn -dse -S | grep {call.*memcpy.*cell} | count 2 -; PR2099 - -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" -target triple = "i686-apple-darwin9" - %struct.s = type { [11 x i8], i32 } -@.str = internal constant [11 x i8] c"0123456789\00" ; <[11 x i8]*> [#uses=1] -@cell = weak global %struct.s zeroinitializer ; <%struct.s*> [#uses=2] - -declare i32 @check(%struct.s* byval %p) nounwind - -declare i32 @strcmp(i8*, i8*) nounwind readonly - -define i32 @main() noreturn nounwind { -entry: - %p = alloca %struct.s, align 8 ; <%struct.s*> [#uses=2] - store i32 99, i32* getelementptr (%struct.s* @cell, i32 0, i32 1), align 4 - call void @llvm.memcpy.i32( i8* getelementptr (%struct.s* @cell, i32 0, i32 0, i32 0), i8* getelementptr ([11 x i8]* @.str, i32 0, i32 0), i32 11, i32 1 ) - %tmp = getelementptr %struct.s* %p, i32 0, i32 0, i32 0 ; <i8*> [#uses=2] - call void @llvm.memcpy.i64( i8* %tmp, i8* getelementptr (%struct.s* @cell, i32 0, i32 0, i32 0), i64 16, i32 8 ) - %tmp1.i = getelementptr %struct.s* %p, i32 0, i32 1 ; <i32*> [#uses=1] - %tmp2.i = load i32* %tmp1.i, align 4 ; <i32> [#uses=1] - %tmp3.i = icmp eq i32 %tmp2.i, 99 ; <i1> [#uses=1] - br i1 %tmp3.i, label %bb5.i, label %bb - -bb5.i: ; preds = %entry - %tmp91.i = call i32 @strcmp( i8* %tmp, i8* getelementptr ([11 x i8]* @.str, i32 0, i32 0) ) nounwind readonly ; <i32> [#uses=1] - %tmp53 = icmp eq i32 %tmp91.i, 0 ; <i1> [#uses=1] - br i1 %tmp53, label %bb7, label %bb - -bb: ; preds = %bb5.i, %entry - call void @abort( ) noreturn nounwind - unreachable - -bb7: ; preds = %bb5.i - call void @exit( i32 0 ) noreturn nounwind - unreachable -} - -declare void @llvm.memcpy.i32(i8*, i8*, i32, i32) nounwind - -declare void @abort() noreturn nounwind - -declare void @exit(i32) noreturn nounwind - -declare void @llvm.memcpy.i64(i8*, i8*, i64, i32) nounwind diff --git a/test/Transforms/GVN/2011-04-27-phioperands.ll b/test/Transforms/GVN/2011-04-27-phioperands.ll new file mode 100644 index 0000000000000..6e5075db7c8ef --- /dev/null +++ b/test/Transforms/GVN/2011-04-27-phioperands.ll @@ -0,0 +1,106 @@ +; RUN: opt %s -gvn -disable-output + +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-f128:128:128-n8:16:32:64" + +@nuls = external global [10 x i8] + +define fastcc void @p_ere() nounwind { +entry: + br label %"<bb 5>" + +"<L18>.i": + br i1 undef, label %"<bb 3>.i30.i", label %doemit.exit51.i + +"<bb 3>.i30.i": + unreachable + +doemit.exit51.i: + br label %"<bb 53>.i" + +"<L19>.i": + br i1 undef, label %"<bb 3>.i55.i", label %doemit.exit76.i + +"<bb 3>.i55.i": + unreachable + +doemit.exit76.i: + br label %"<bb 53>.i" + +"<L98>.i": + store i8* getelementptr inbounds ([10 x i8]* @nuls, i64 0, i64 0), i8** undef, align 8 + br label %"<bb 53>.i" + +"<L99>.i": + br label %"<bb 53>.i" + +"<L24>.i": + br i1 undef, label %"<bb 53>.i", label %"<bb 35>.i" + +"<bb 35>.i": + br label %"<bb 53>.i" + +"<L28>.i": + br label %"<bb 53>.i" + +"<L29>.i": + br label %"<bb 53>.i" + +"<L39>.i": + br label %"<bb 53>.i" + +"<bb 53>.i": + %wascaret_2.i = phi i32 [ 0, %"<L39>.i" ], [ 0, %"<L29>.i" ], [ 0, %"<L28>.i" ], [ 0, %"<bb 35>.i" ], [ 0, %"<L99>.i" ], [ 0, %"<L98>.i" ], [ 0, %doemit.exit76.i ], [ 1, %doemit.exit51.i ], [ 0, %"<L24>.i" ] + %D.5496_84.i = load i8** undef, align 8 + br i1 undef, label %"<bb 54>.i", label %"<bb 5>" + +"<bb 54>.i": + br i1 undef, label %"<bb 5>", label %"<bb 58>.i" + +"<bb 58>.i": + br i1 undef, label %"<bb 64>.i", label %"<bb 59>.i" + +"<bb 59>.i": + br label %"<bb 64>.i" + +"<bb 64>.i": + switch i32 undef, label %"<bb 5>" [ + i32 42, label %"<L54>.i" + i32 43, label %"<L55>.i" + i32 63, label %"<L56>.i" + i32 123, label %"<bb 5>.i258.i" + ] + +"<L54>.i": + br i1 undef, label %"<bb 3>.i105.i", label %doemit.exit127.i + +"<bb 3>.i105.i": + unreachable + +doemit.exit127.i: + unreachable + +"<L55>.i": + br i1 undef, label %"<bb 3>.i157.i", label %"<bb 5>" + +"<bb 3>.i157.i": + unreachable + +"<L56>.i": + br label %"<bb 5>" + +"<bb 5>.i258.i": + unreachable + +"<bb 5>": + switch i32 undef, label %"<L39>.i" [ + i32 36, label %"<L19>.i" + i32 94, label %"<L18>.i" + i32 124, label %"<L98>.i" + i32 42, label %"<L99>.i" + i32 43, label %"<L99>.i" + i32 46, label %"<L24>.i" + i32 63, label %"<L99>.i" + i32 91, label %"<L28>.i" + i32 92, label %"<L29>.i" + ] +} diff --git a/test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll b/test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll new file mode 100644 index 0000000000000..18178e45a22b3 --- /dev/null +++ b/test/Transforms/GVN/2011-07-07-MatchIntrinsicExtract.ll @@ -0,0 +1,85 @@ +; RUN: opt < %s -gvn -S | FileCheck %s +; + +%0 = type { i64, i1 } + +define i64 @test1(i64 %a, i64 %b) nounwind ssp { +entry: + %uadd = tail call %0 @llvm.uadd.with.overflow.i64(i64 %a, i64 %b) + %uadd.0 = extractvalue %0 %uadd, 0 + %add1 = add i64 %a, %b + ret i64 %add1 +} + +; CHECK: @test1 +; CHECK-NOT: add1 +; CHECK: ret + +define i64 @test2(i64 %a, i64 %b) nounwind ssp { +entry: + %usub = tail call %0 @llvm.usub.with.overflow.i64(i64 %a, i64 %b) + %usub.0 = extractvalue %0 %usub, 0 + %sub1 = sub i64 %a, %b + ret i64 %sub1 +} + +; CHECK: @test2 +; CHECK-NOT: sub1 +; CHECK: ret + +define i64 @test3(i64 %a, i64 %b) nounwind ssp { +entry: + %umul = tail call %0 @llvm.umul.with.overflow.i64(i64 %a, i64 %b) + %umul.0 = extractvalue %0 %umul, 0 + %mul1 = mul i64 %a, %b + ret i64 %mul1 +} + +; CHECK: @test3 +; CHECK-NOT: mul1 +; CHECK: ret + +define i64 @test4(i64 %a, i64 %b) nounwind ssp { +entry: + %sadd = tail call %0 @llvm.sadd.with.overflow.i64(i64 %a, i64 %b) + %sadd.0 = extractvalue %0 %sadd, 0 + %add1 = add i64 %a, %b + ret i64 %add1 +} + +; CHECK: @test4 +; CHECK-NOT: add1 +; CHECK: ret + +define i64 @test5(i64 %a, i64 %b) nounwind ssp { +entry: + %ssub = tail call %0 @llvm.ssub.with.overflow.i64(i64 %a, i64 %b) + %ssub.0 = extractvalue %0 %ssub, 0 + %sub1 = sub i64 %a, %b + ret i64 %sub1 +} + +; CHECK: @test5 +; CHECK-NOT: sub1 +; CHECK: ret + +define i64 @test6(i64 %a, i64 %b) nounwind ssp { +entry: + %smul = tail call %0 @llvm.smul.with.overflow.i64(i64 %a, i64 %b) + %smul.0 = extractvalue %0 %smul, 0 + %mul1 = mul i64 %a, %b + ret i64 %mul1 +} + +; CHECK: @test6 +; CHECK-NOT: mul1 +; CHECK: ret + +declare void @exit(i32) noreturn +declare %0 @llvm.uadd.with.overflow.i64(i64, i64) nounwind readnone +declare %0 @llvm.usub.with.overflow.i64(i64, i64) nounwind readnone +declare %0 @llvm.umul.with.overflow.i64(i64, i64) nounwind readnone +declare %0 @llvm.sadd.with.overflow.i64(i64, i64) nounwind readnone +declare %0 @llvm.ssub.with.overflow.i64(i64, i64) nounwind readnone +declare %0 @llvm.smul.with.overflow.i64(i64, i64) nounwind readnone + diff --git a/test/Transforms/GVN/nonescaping-malloc.ll b/test/Transforms/GVN/nonescaping-malloc.ll index 1d50205c6851b..dba9d81405c01 100644 --- a/test/Transforms/GVN/nonescaping-malloc.ll +++ b/test/Transforms/GVN/nonescaping-malloc.ll @@ -20,13 +20,13 @@ target triple = "x86_64-apple-darwin10.0" define %"struct.llvm::StringMapEntry<void*>"* @_Z3fooRN4llvm9StringMapIPvNS_15MallocAllocatorEEEPKc(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %X, i8* %P) ssp { entry: - %tmp = alloca %"struct.llvm::StringRef", align 8 ; <%"struct.llvm::StringRef"*> [#uses=3] - %tmp.i = getelementptr inbounds %"struct.llvm::StringRef"* %tmp, i64 0, i32 0 ; <i8**> [#uses=1] + %tmp = alloca %"struct.llvm::StringRef", align 8 + %tmp.i = getelementptr inbounds %"struct.llvm::StringRef"* %tmp, i64 0, i32 0 store i8* %P, i8** %tmp.i, align 8 - %tmp1.i = call i64 @strlen(i8* %P) nounwind readonly ; <i64> [#uses=1] - %tmp2.i = getelementptr inbounds %"struct.llvm::StringRef"* %tmp, i64 0, i32 1 ; <i64*> [#uses=1] + %tmp1.i = call i64 @strlen(i8* %P) nounwind readonly + %tmp2.i = getelementptr inbounds %"struct.llvm::StringRef"* %tmp, i64 0, i32 1 store i64 %tmp1.i, i64* %tmp2.i, align 8 - %tmp1 = call %"struct.llvm::StringMapEntry<void*>"* @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %X, %"struct.llvm::StringRef"* %tmp) ssp ; <%"struct.llvm::StringMapEntry<void*>"*> [#uses=1] + %tmp1 = call %"struct.llvm::StringMapEntry<void*>"* @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %X, %"struct.llvm::StringRef"* %tmp) ssp ret %"struct.llvm::StringMapEntry<void*>"* %tmp1 } @@ -34,75 +34,75 @@ declare i64 @strlen(i8* nocapture) nounwind readonly declare noalias i8* @malloc(i64) nounwind -declare void @llvm.memcpy.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind - declare i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.llvm::StringMapImpl"*, i64, i64) define linkonce_odr %"struct.llvm::StringMapEntry<void*>"* @_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueERKNS_9StringRefE(%"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, %"struct.llvm::StringRef"* nocapture %Key) ssp align 2 { entry: - %elt = bitcast %"struct.llvm::StringRef"* %Key to i64* ; <i64*> [#uses=1] - %val = load i64* %elt ; <i64> [#uses=3] - %tmp = getelementptr inbounds %"struct.llvm::StringRef"* %Key, i64 0, i32 1 ; <i64*> [#uses=1] - %val2 = load i64* %tmp ; <i64> [#uses=2] - %tmp2.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0 ; <%"struct.llvm::StringMapImpl"*> [#uses=1] - %tmp3.i = tail call i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.llvm::StringMapImpl"* %tmp2.i, i64 %val, i64 %val2) ; <i32> [#uses=1] - %tmp4.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 0 ; <%"struct.llvm::StringMapImpl::ItemBucket"**> [#uses=1] - %tmp5.i = load %"struct.llvm::StringMapImpl::ItemBucket"** %tmp4.i, align 8 ; <%"struct.llvm::StringMapImpl::ItemBucket"*> [#uses=1] - %tmp6.i = zext i32 %tmp3.i to i64 ; <i64> [#uses=1] - %tmp7.i = getelementptr inbounds %"struct.llvm::StringMapImpl::ItemBucket"* %tmp5.i, i64 %tmp6.i, i32 1 ; <%"struct.llvm::StringMapEntryBase"**> [#uses=2] - %tmp8.i = load %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 ; <%"struct.llvm::StringMapEntryBase"*> [#uses=3] - %tmp9.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, null ; <i1> [#uses=1] - %tmp13.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*) ; <i1> [#uses=1] - %or.cond.i = or i1 %tmp9.i, %tmp13.i ; <i1> [#uses=1] + %elt = bitcast %"struct.llvm::StringRef"* %Key to i64* + %val = load i64* %elt + %tmp = getelementptr inbounds %"struct.llvm::StringRef"* %Key, i64 0, i32 1 + %val2 = load i64* %tmp + %tmp2.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0 + %tmp3.i = tail call i32 @_ZN4llvm13StringMapImpl15LookupBucketForENS_9StringRefE(%"struct.llvm::StringMapImpl"* %tmp2.i, i64 %val, i64 %val2) + %tmp4.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 0 + %tmp5.i = load %"struct.llvm::StringMapImpl::ItemBucket"** %tmp4.i, align 8 + %tmp6.i = zext i32 %tmp3.i to i64 + %tmp7.i = getelementptr inbounds %"struct.llvm::StringMapImpl::ItemBucket"* %tmp5.i, i64 %tmp6.i, i32 1 + %tmp8.i = load %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 + %tmp9.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, null + %tmp13.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp8.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*) + %or.cond.i = or i1 %tmp9.i, %tmp13.i br i1 %or.cond.i, label %bb4.i, label %bb6.i bb4.i: ; preds = %entry - %tmp41.i = inttoptr i64 %val to i8* ; <i8*> [#uses=2] - %tmp4.i35.i = getelementptr inbounds i8* %tmp41.i, i64 %val2 ; <i8*> [#uses=1] - %tmp.i.i = ptrtoint i8* %tmp4.i35.i to i64 ; <i64> [#uses=1] - %tmp1.i.i = trunc i64 %tmp.i.i to i32 ; <i32> [#uses=1] - %tmp3.i.i = trunc i64 %val to i32 ; <i32> [#uses=1] - %tmp4.i.i = sub i32 %tmp1.i.i, %tmp3.i.i ; <i32> [#uses=3] - %tmp5.i.i = add i32 %tmp4.i.i, 17 ; <i32> [#uses=1] - %tmp8.i.i = zext i32 %tmp5.i.i to i64 ; <i64> [#uses=1] - %tmp.i20.i.i = tail call noalias i8* @malloc(i64 %tmp8.i.i) nounwind ; <i8*> [#uses=7] - %tmp10.i.i = bitcast i8* %tmp.i20.i.i to %"struct.llvm::StringMapEntry<void*>"* ; <%"struct.llvm::StringMapEntry<void*>"*> [#uses=2] - %tmp12.i.i = icmp eq i8* %tmp.i20.i.i, null ; <i1> [#uses=1] + %tmp41.i = inttoptr i64 %val to i8* + %tmp4.i35.i = getelementptr inbounds i8* %tmp41.i, i64 %val2 + %tmp.i.i = ptrtoint i8* %tmp4.i35.i to i64 + %tmp1.i.i = trunc i64 %tmp.i.i to i32 + %tmp3.i.i = trunc i64 %val to i32 + %tmp4.i.i = sub i32 %tmp1.i.i, %tmp3.i.i + %tmp5.i.i = add i32 %tmp4.i.i, 17 + %tmp8.i.i = zext i32 %tmp5.i.i to i64 + %tmp.i20.i.i = tail call noalias i8* @malloc(i64 %tmp8.i.i) nounwind + %tmp10.i.i = bitcast i8* %tmp.i20.i.i to %"struct.llvm::StringMapEntry<void*>"* + %tmp12.i.i = icmp eq i8* %tmp.i20.i.i, null br i1 %tmp12.i.i, label %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i, label %bb.i.i bb.i.i: ; preds = %bb4.i - %tmp.i.i.i.i = bitcast i8* %tmp.i20.i.i to i32* ; <i32*> [#uses=1] + %tmp.i.i.i.i = bitcast i8* %tmp.i20.i.i to i32* store i32 %tmp4.i.i, i32* %tmp.i.i.i.i, align 4 - %tmp1.i19.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 8 ; <i8*> [#uses=1] - %0 = bitcast i8* %tmp1.i19.i.i to i8** ; <i8**> [#uses=1] + %tmp1.i19.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 8 + %0 = bitcast i8* %tmp1.i19.i.i to i8** store i8* null, i8** %0, align 8 br label %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i -_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i: ; preds = %bb4.i, %bb.i.i - %tmp.i18.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 16 ; <i8*> [#uses=1] - %tmp15.i.i = zext i32 %tmp4.i.i to i64 ; <i64> [#uses=2] - tail call void @llvm.memcpy.i64(i8* %tmp.i18.i.i, i8* %tmp41.i, i64 %tmp15.i.i, i32 1) nounwind - %tmp.i18.sum.i.i = add i64 %tmp15.i.i, 16 ; <i64> [#uses=1] - %tmp17.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 %tmp.i18.sum.i.i ; <i8*> [#uses=1] +_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i: ; preds = %bb.i.i, %bb4.i + %tmp.i18.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 16 + %tmp15.i.i = zext i32 %tmp4.i.i to i64 + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %tmp.i18.i.i, i8* %tmp41.i, i64 %tmp15.i.i, i32 1, i1 false) + %tmp.i18.sum.i.i = add i64 %tmp15.i.i, 16 + %tmp17.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 %tmp.i18.sum.i.i store i8 0, i8* %tmp17.i.i, align 1 - %tmp.i.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 8 ; <i8*> [#uses=1] - %1 = bitcast i8* %tmp.i.i.i to i8** ; <i8**> [#uses=1] + %tmp.i.i.i = getelementptr inbounds i8* %tmp.i20.i.i, i64 8 + %1 = bitcast i8* %tmp.i.i.i to i8** store i8* null, i8** %1, align 8 - %tmp22.i = load %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 ; <%"struct.llvm::StringMapEntryBase"*> [#uses=1] - %tmp24.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp22.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*) ; <i1> [#uses=1] + %tmp22.i = load %"struct.llvm::StringMapEntryBase"** %tmp7.i, align 8 + %tmp24.i = icmp eq %"struct.llvm::StringMapEntryBase"* %tmp22.i, inttoptr (i64 -1 to %"struct.llvm::StringMapEntryBase"*) br i1 %tmp24.i, label %bb9.i, label %_ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueIS1_EERNS_14StringMapEntryIS1_EENS_9StringRefET_.exit bb6.i: ; preds = %entry - %tmp16.i = bitcast %"struct.llvm::StringMapEntryBase"* %tmp8.i to %"struct.llvm::StringMapEntry<void*>"* ; <%"struct.llvm::StringMapEntry<void*>"*> [#uses=1] + %tmp16.i = bitcast %"struct.llvm::StringMapEntryBase"* %tmp8.i to %"struct.llvm::StringMapEntry<void*>"* ret %"struct.llvm::StringMapEntry<void*>"* %tmp16.i bb9.i: ; preds = %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i - %tmp25.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 3 ; <i32*> [#uses=2] - %tmp26.i = load i32* %tmp25.i, align 8 ; <i32> [#uses=1] - %tmp27.i = add i32 %tmp26.i, -1 ; <i32> [#uses=1] + %tmp25.i = getelementptr inbounds %"struct.llvm::StringMap<void*,llvm::MallocAllocator>"* %this, i64 0, i32 0, i32 3 + %tmp26.i = load i32* %tmp25.i, align 8 + %tmp27.i = add i32 %tmp26.i, -1 store i32 %tmp27.i, i32* %tmp25.i, align 8 ret %"struct.llvm::StringMapEntry<void*>"* %tmp10.i.i _ZN4llvm9StringMapIPvNS_15MallocAllocatorEE16GetOrCreateValueIS1_EERNS_14StringMapEntryIS1_EENS_9StringRefET_.exit: ; preds = %_ZN4llvm14StringMapEntryIPvE6CreateINS_15MallocAllocatorES1_EEPS2_PKcS7_RT_T0_.exit.i ret %"struct.llvm::StringMapEntry<void*>"* %tmp10.i.i } + +declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture, i64, i32, i1) nounwind diff --git a/test/Transforms/GVN/rle.ll b/test/Transforms/GVN/rle.ll index 28b1fc7b60755..2f0d2eb367ccc 100644 --- a/test/Transforms/GVN/rle.ll +++ b/test/Transforms/GVN/rle.ll @@ -135,7 +135,7 @@ define i8* @coerce_mustalias7(i64 %V, i64* %P) { define signext i16 @memset_to_i16_local(i16* %A) nounwind ssp { entry: %conv = bitcast i16* %A to i8* - tail call void @llvm.memset.i64(i8* %conv, i8 1, i64 200, i32 1) + tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 1, i64 200, i32 1, i1 false) %arrayidx = getelementptr inbounds i16* %A, i64 42 %tmp2 = load i16* %arrayidx ret i16 %tmp2 @@ -148,7 +148,7 @@ entry: define float @memset_to_float_local(float* %A, i8 %Val) nounwind ssp { entry: %conv = bitcast float* %A to i8* ; <i8*> [#uses=1] - tail call void @llvm.memset.i64(i8* %conv, i8 %Val, i64 400, i32 1) + tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 %Val, i64 400, i32 1, i1 false) %arrayidx = getelementptr inbounds float* %A, i64 42 ; <float*> [#uses=1] %tmp2 = load float* %arrayidx ; <float> [#uses=1] ret float %tmp2 @@ -168,11 +168,11 @@ define i16 @memset_to_i16_nonlocal0(i16* %P, i1 %cond) { %P3 = bitcast i16* %P to i8* br i1 %cond, label %T, label %F T: - tail call void @llvm.memset.i64(i8* %P3, i8 1, i64 400, i32 1) + tail call void @llvm.memset.p0i8.i64(i8* %P3, i8 1, i64 400, i32 1, i1 false) br label %Cont F: - tail call void @llvm.memset.i64(i8* %P3, i8 2, i64 400, i32 1) + tail call void @llvm.memset.p0i8.i64(i8* %P3, i8 2, i64 400, i32 1, i1 false) br label %Cont Cont: @@ -193,7 +193,7 @@ Cont: define float @memcpy_to_float_local(float* %A) nounwind ssp { entry: %conv = bitcast float* %A to i8* ; <i8*> [#uses=1] - tail call void @llvm.memcpy.i64(i8* %conv, i8* bitcast ({i32, float, i32 }* @GCst to i8*), i64 12, i32 1) + tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* %conv, i8* bitcast ({i32, float, i32 }* @GCst to i8*), i64 12, i32 1, i1 false) %arrayidx = getelementptr inbounds float* %A, i64 1 ; <float*> [#uses=1] %tmp2 = load float* %arrayidx ; <float> [#uses=1] ret float %tmp2 @@ -203,11 +203,6 @@ entry: } -declare void @llvm.memset.i64(i8* nocapture, i8, i64, i32) nounwind -declare void @llvm.memcpy.i64(i8* nocapture, i8* nocapture, i64, i32) nounwind - - - ;; non-local i32/float -> i8 load forwarding. define i8 @coerce_mustalias_nonlocal0(i32* %P, i1 %cond) { @@ -539,7 +534,7 @@ define i32 @memset_to_load() nounwind readnone { entry: %x = alloca [256 x i32], align 4 ; <[256 x i32]*> [#uses=2] %tmp = bitcast [256 x i32]* %x to i8* ; <i8*> [#uses=1] - call void @llvm.memset.i64(i8* %tmp, i8 0, i64 1024, i32 4) + call void @llvm.memset.p0i8.i64(i8* %tmp, i8 0, i64 1024, i32 4, i1 false) %arraydecay = getelementptr inbounds [256 x i32]* %x, i32 0, i32 0 ; <i32*> %tmp1 = load i32* %arraydecay ; <i32> [#uses=1] ret i32 %tmp1 @@ -643,3 +638,7 @@ entry: ; CHECK-ret i32 } +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 + |
