[llvm] r275741 - [GVN] Move the PRE/LOADPRE test in a subdirectory.
Davide Italiano via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 17 16:48:19 PDT 2016
Author: davide
Date: Sun Jul 17 18:48:18 2016
New Revision: 275741
URL: http://llvm.org/viewvc/llvm-project?rev=275741&view=rev
Log:
[GVN] Move the PRE/LOADPRE test in a subdirectory.
Added:
llvm/trunk/test/Transforms/GVN/PRE/
llvm/trunk/test/Transforms/GVN/PRE/2011-06-01-NonLocalMemdepMiscompile.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll
llvm/trunk/test/Transforms/GVN/PRE/atomic.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/atomic.ll
llvm/trunk/test/Transforms/GVN/PRE/invariant-load.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/invariant-load.ll
llvm/trunk/test/Transforms/GVN/PRE/load-metadata.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/load-metadata.ll
llvm/trunk/test/Transforms/GVN/PRE/load-pre-align.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/load-pre-align.ll
llvm/trunk/test/Transforms/GVN/PRE/load-pre-licm.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/load-pre-licm.ll
llvm/trunk/test/Transforms/GVN/PRE/load-pre-nonlocal.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll
llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap-2.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll
llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll
llvm/trunk/test/Transforms/GVN/PRE/phi-translate.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/phi-translate.ll
llvm/trunk/test/Transforms/GVN/PRE/pre-gep-load.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/pre-gep-load.ll
llvm/trunk/test/Transforms/GVN/PRE/pre-load.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/pre-load.ll
llvm/trunk/test/Transforms/GVN/PRE/pre-no-cost-phi.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll
llvm/trunk/test/Transforms/GVN/PRE/preserve-tbaa.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll
llvm/trunk/test/Transforms/GVN/PRE/rle-phi-translate.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll
llvm/trunk/test/Transforms/GVN/PRE/rle-semidominated.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/rle-semidominated.ll
llvm/trunk/test/Transforms/GVN/PRE/rle.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/rle.ll
llvm/trunk/test/Transforms/GVN/PRE/volatile.ll
- copied, changed from r275739, llvm/trunk/test/Transforms/GVN/volatile.ll
Removed:
llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll
llvm/trunk/test/Transforms/GVN/atomic.ll
llvm/trunk/test/Transforms/GVN/invariant-load.ll
llvm/trunk/test/Transforms/GVN/load-metadata.ll
llvm/trunk/test/Transforms/GVN/load-pre-align.ll
llvm/trunk/test/Transforms/GVN/load-pre-licm.ll
llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll
llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll
llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll
llvm/trunk/test/Transforms/GVN/phi-translate.ll
llvm/trunk/test/Transforms/GVN/pre-gep-load.ll
llvm/trunk/test/Transforms/GVN/pre-load.ll
llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll
llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll
llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll
llvm/trunk/test/Transforms/GVN/rle-semidominated.ll
llvm/trunk/test/Transforms/GVN/rle.ll
llvm/trunk/test/Transforms/GVN/volatile.ll
Removed: llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll (original)
+++ llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll (removed)
@@ -1,61 +0,0 @@
-; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
-; This test is checking that (a) this doesn't crash, and (b) we don't
-; conclude the value of %tmp17 is available in bb1.bb15_crit_edge.
-; rdar://9429882
-
-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-macosx10.7.0"
-
-define i1 @rb_intern() nounwind ssp {
-; CHECK-LABEL: @rb_intern(
-
-bb:
- %tmp = alloca i8*, align 8
- store i8* null, i8** %tmp, align 8
- store i8 undef, i8* null, align 536870912
- br label %bb1
-
-bb1:
- br i1 undef, label %bb3, label %bb15
-
-; CHECK: bb1:
-; CHECK: [[TMP:%.*]] = phi i8* [ getelementptr (i8, i8* null, i64 undef), %bb10 ], [ null, %bb ]
-
-; CHECK: bb1.bb15_crit_edge:
-; CHECK: %tmp17.pre = load i8, i8* [[TMP]], align 1
-
-bb3:
- call void @isalnum()
- br i1 undef, label %bb10, label %bb5
-
-bb5:
- br i1 undef, label %bb10, label %bb6
-
-bb6:
- %tmp7 = load i8*, i8** %tmp, align 8
- %tmp8 = load i8, i8* %tmp7, align 1
- %tmp9 = zext i8 %tmp8 to i64
- br i1 undef, label %bb15, label %bb10
-
-bb10:
- %tmp11 = load i8*, i8** %tmp, align 8
- %tmp12 = load i8, i8* %tmp11, align 1
- %tmp13 = zext i8 %tmp12 to i64
- %tmp14 = getelementptr inbounds i8, i8* null, i64 undef
- store i8* %tmp14, i8** %tmp, align 8
- br label %bb1
-
-bb15:
- %tmp16 = load i8*, i8** %tmp, align 8
- %tmp17 = load i8, i8* %tmp16, align 1
- %tmp18 = icmp eq i8 %tmp17, 0
- br label %bb19
-
-; CHECK: bb15:
-; CHECK: %tmp17 = phi i8 [ %tmp17.pre, %bb1.bb15_crit_edge ], [ %tmp8, %bb6 ]
-
-bb19: ; preds = %bb15
- ret i1 %tmp18
-}
-
-declare void @isalnum() nounwind inlinehint ssp
Copied: llvm/trunk/test/Transforms/GVN/PRE/2011-06-01-NonLocalMemdepMiscompile.ll (from r275739, llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/2011-06-01-NonLocalMemdepMiscompile.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/2011-06-01-NonLocalMemdepMiscompile.ll&p1=llvm/trunk/test/Transforms/GVN/2011-06-01-NonLocalMemdepMiscompile.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/atomic.ll (from r275739, llvm/trunk/test/Transforms/GVN/atomic.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/atomic.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/atomic.ll&p1=llvm/trunk/test/Transforms/GVN/atomic.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/invariant-load.ll (from r275739, llvm/trunk/test/Transforms/GVN/invariant-load.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/invariant-load.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/invariant-load.ll&p1=llvm/trunk/test/Transforms/GVN/invariant-load.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/load-metadata.ll (from r275739, llvm/trunk/test/Transforms/GVN/load-metadata.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/load-metadata.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/load-metadata.ll&p1=llvm/trunk/test/Transforms/GVN/load-metadata.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/load-pre-align.ll (from r275739, llvm/trunk/test/Transforms/GVN/load-pre-align.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/load-pre-align.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/load-pre-align.ll&p1=llvm/trunk/test/Transforms/GVN/load-pre-align.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/load-pre-licm.ll (from r275739, llvm/trunk/test/Transforms/GVN/load-pre-licm.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/load-pre-licm.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/load-pre-licm.ll&p1=llvm/trunk/test/Transforms/GVN/load-pre-licm.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/load-pre-nonlocal.ll (from r275739, llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/load-pre-nonlocal.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/load-pre-nonlocal.ll&p1=llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap-2.ll (from r275739, llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap-2.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap-2.ll&p1=llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap.ll (from r275739, llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/lpre-call-wrap.ll&p1=llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/phi-translate.ll (from r275739, llvm/trunk/test/Transforms/GVN/phi-translate.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/phi-translate.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/phi-translate.ll&p1=llvm/trunk/test/Transforms/GVN/phi-translate.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/pre-gep-load.ll (from r275739, llvm/trunk/test/Transforms/GVN/pre-gep-load.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/pre-gep-load.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/pre-gep-load.ll&p1=llvm/trunk/test/Transforms/GVN/pre-gep-load.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/pre-load.ll (from r275739, llvm/trunk/test/Transforms/GVN/pre-load.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/pre-load.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/pre-load.ll&p1=llvm/trunk/test/Transforms/GVN/pre-load.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/pre-no-cost-phi.ll (from r275739, llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/pre-no-cost-phi.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/pre-no-cost-phi.ll&p1=llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/preserve-tbaa.ll (from r275739, llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/preserve-tbaa.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/preserve-tbaa.ll&p1=llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/rle-phi-translate.ll (from r275739, llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/rle-phi-translate.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/rle-phi-translate.ll&p1=llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/rle-semidominated.ll (from r275739, llvm/trunk/test/Transforms/GVN/rle-semidominated.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/rle-semidominated.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/rle-semidominated.ll&p1=llvm/trunk/test/Transforms/GVN/rle-semidominated.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/rle.ll (from r275739, llvm/trunk/test/Transforms/GVN/rle.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/rle.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/rle.ll&p1=llvm/trunk/test/Transforms/GVN/rle.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Copied: llvm/trunk/test/Transforms/GVN/PRE/volatile.ll (from r275739, llvm/trunk/test/Transforms/GVN/volatile.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/PRE/volatile.ll?p2=llvm/trunk/test/Transforms/GVN/PRE/volatile.ll&p1=llvm/trunk/test/Transforms/GVN/volatile.ll&r1=275739&r2=275741&rev=275741&view=diff
==============================================================================
(empty)
Removed: llvm/trunk/test/Transforms/GVN/atomic.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/atomic.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/atomic.ll (original)
+++ llvm/trunk/test/Transforms/GVN/atomic.ll (removed)
@@ -1,503 +0,0 @@
-; RUN: opt -basicaa -gvn -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-macosx10.7.0"
-
- at x = common global i32 0, align 4
- at y = common global i32 0, align 4
-
-; GVN across unordered store (allowed)
-define i32 @test1() nounwind uwtable ssp {
-; CHECK-LABEL: test1
-; CHECK: add i32 %x, %x
-entry:
- %x = load i32, i32* @y
- store atomic i32 %x, i32* @x unordered, align 4
- %y = load i32, i32* @y
- %z = add i32 %x, %y
- ret i32 %z
-}
-
-; GVN across unordered load (allowed)
-define i32 @test3() nounwind uwtable ssp {
-; CHECK-LABEL: test3
-; CHECK: add i32 %x, %x
-entry:
- %x = load i32, i32* @y
- %y = load atomic i32, i32* @x unordered, align 4
- %z = load i32, i32* @y
- %a = add i32 %x, %z
- %b = add i32 %y, %a
- ret i32 %b
-}
-
-; GVN load to unordered load (allowed)
-define i32 @test5() nounwind uwtable ssp {
-; CHECK-LABEL: test5
-; CHECK: add i32 %x, %x
-entry:
- %x = load atomic i32, i32* @x unordered, align 4
- %y = load i32, i32* @x
- %z = add i32 %x, %y
- ret i32 %z
-}
-
-; GVN unordered load to load (unordered load must not be removed)
-define i32 @test6() nounwind uwtable ssp {
-; CHECK-LABEL: test6
-; CHECK: load atomic i32, i32* @x unordered
-entry:
- %x = load i32, i32* @x
- %x2 = load atomic i32, i32* @x unordered, align 4
- %x3 = add i32 %x, %x2
- ret i32 %x3
-}
-
-; GVN across release-acquire pair (forbidden)
-define i32 @test7() nounwind uwtable ssp {
-; CHECK-LABEL: test7
-; CHECK: add i32 %x, %y
-entry:
- %x = load i32, i32* @y
- store atomic i32 %x, i32* @x release, align 4
- %w = load atomic i32, i32* @x acquire, align 4
- %y = load i32, i32* @y
- %z = add i32 %x, %y
- ret i32 %z
-}
-
-; GVN across monotonic store (allowed)
-define i32 @test9() nounwind uwtable ssp {
-; CHECK-LABEL: test9
-; CHECK: add i32 %x, %x
-entry:
- %x = load i32, i32* @y
- store atomic i32 %x, i32* @x monotonic, align 4
- %y = load i32, i32* @y
- %z = add i32 %x, %y
- ret i32 %z
-}
-
-; GVN of an unordered across monotonic load (not allowed)
-define i32 @test10() nounwind uwtable ssp {
-; CHECK-LABEL: test10
-; CHECK: add i32 %x, %y
-entry:
- %x = load atomic i32, i32* @y unordered, align 4
- %clobber = load atomic i32, i32* @x monotonic, align 4
- %y = load atomic i32, i32* @y monotonic, align 4
- %z = add i32 %x, %y
- ret i32 %z
-}
-
-define i32 @PR22708(i1 %flag) {
-; CHECK-LABEL: PR22708
-entry:
- br i1 %flag, label %if.then, label %if.end
-
-if.then:
- store i32 43, i32* @y, align 4
-; CHECK: store i32 43, i32* @y, align 4
- br label %if.end
-
-if.end:
- load atomic i32, i32* @x acquire, align 4
- %load = load i32, i32* @y, align 4
-; CHECK: load atomic i32, i32* @x acquire, align 4
-; CHECK: load i32, i32* @y, align 4
- ret i32 %load
-}
-
-; CHECK-LABEL: @test12(
-; Can't remove a load over a ordering barrier
-define i32 @test12(i1 %B, i32* %P1, i32* %P2) {
- %load0 = load i32, i32* %P1
- %1 = load atomic i32, i32* %P2 seq_cst, align 4
- %load1 = load i32, i32* %P1
- %sel = select i1 %B, i32 %load0, i32 %load1
- ret i32 %sel
- ; CHECK: load i32, i32* %P1
- ; CHECK: load i32, i32* %P1
-}
-
-; CHECK-LABEL: @test13(
-; atomic to non-atomic forwarding is legal
-define i32 @test13(i32* %P1) {
- %a = load atomic i32, i32* %P1 seq_cst, align 4
- %b = load i32, i32* %P1
- %res = sub i32 %a, %b
- ret i32 %res
- ; CHECK: load atomic i32, i32* %P1
- ; CHECK: ret i32 0
-}
-
-; CHECK-LABEL: @test13b(
-define i32 @test13b(i32* %P1) {
- store atomic i32 0, i32* %P1 unordered, align 4
- %b = load i32, i32* %P1
- ret i32 %b
- ; CHECK: ret i32 0
-}
-
-; CHECK-LABEL: @test14(
-; atomic to unordered atomic forwarding is legal
-define i32 @test14(i32* %P1) {
- %a = load atomic i32, i32* %P1 seq_cst, align 4
- %b = load atomic i32, i32* %P1 unordered, align 4
- %res = sub i32 %a, %b
- ret i32 %res
- ; CHECK: load atomic i32, i32* %P1 seq_cst
- ; CHECK-NEXT: ret i32 0
-}
-
-; CHECK-LABEL: @test15(
-; implementation restriction: can't forward to stonger
-; than unordered
-define i32 @test15(i32* %P1, i32* %P2) {
- %a = load atomic i32, i32* %P1 seq_cst, align 4
- %b = load atomic i32, i32* %P1 seq_cst, align 4
- %res = sub i32 %a, %b
- ret i32 %res
- ; CHECK: load atomic i32, i32* %P1
- ; CHECK: load atomic i32, i32* %P1
-}
-
-; CHECK-LABEL: @test16(
-; forwarding non-atomic to atomic is wrong! (However,
-; it would be legal to use the later value in place of the
-; former in this particular example. We just don't
-; do that right now.)
-define i32 @test16(i32* %P1, i32* %P2) {
- %a = load i32, i32* %P1, align 4
- %b = load atomic i32, i32* %P1 unordered, align 4
- %res = sub i32 %a, %b
- ret i32 %res
- ; CHECK: load i32, i32* %P1
- ; CHECK: load atomic i32, i32* %P1
-}
-
-; CHECK-LABEL: @test16b(
-define i32 @test16b(i32* %P1) {
- store i32 0, i32* %P1
- %b = load atomic i32, i32* %P1 unordered, align 4
- ret i32 %b
- ; CHECK: load atomic i32, i32* %P1
-}
-
-; Can't DSE across a full fence
-define void @fence_seq_cst_store(i32* %P1, i32* %P2) {
-; CHECK-LABEL: @fence_seq_cst_store(
-; CHECK: store
-; CHECK: store atomic
-; CHECK: store
- store i32 0, i32* %P1, align 4
- store atomic i32 0, i32* %P2 seq_cst, align 4
- store i32 0, i32* %P1, align 4
- ret void
-}
-
-; Can't DSE across a full fence
-define void @fence_seq_cst(i32* %P1, i32* %P2) {
-; CHECK-LABEL: @fence_seq_cst(
-; CHECK: store
-; CHECK: fence seq_cst
-; CHECK: store
- store i32 0, i32* %P1, align 4
- fence seq_cst
- store i32 0, i32* %P1, align 4
- ret void
-}
-
-; Can't DSE across a full singlethread fence
-define void @fence_seq_cst_st(i32* %P1, i32* %P2) {
-; CHECK-LABEL: @fence_seq_cst_st(
-; CHECK: store
-; CHECK: fence singlethread seq_cst
-; CHECK: store
- store i32 0, i32* %P1, align 4
- fence singlethread seq_cst
- store i32 0, i32* %P1, align 4
- ret void
-}
-
-; Can't DSE across a full fence
-define void @fence_asm_sideeffect(i32* %P1, i32* %P2) {
-; CHECK-LABEL: @fence_asm_sideeffect(
-; CHECK: store
-; CHECK: call void asm sideeffect
-; CHECK: store
- store i32 0, i32* %P1, align 4
- call void asm sideeffect "", ""()
- store i32 0, i32* %P1, align 4
- ret void
-}
-
-; Can't DSE across a full fence
-define void @fence_asm_memory(i32* %P1, i32* %P2) {
-; CHECK-LABEL: @fence_asm_memory(
-; CHECK: store
-; CHECK: call void asm
-; CHECK: store
- store i32 0, i32* %P1, align 4
- call void asm "", "~{memory}"()
- store i32 0, i32* %P1, align 4
- ret void
-}
-
-; Can't remove a volatile load
-define i32 @volatile_load(i32* %P1, i32* %P2) {
- %a = load i32, i32* %P1, align 4
- %b = load volatile i32, i32* %P1, align 4
- %res = sub i32 %a, %b
- ret i32 %res
- ; CHECK-LABEL: @volatile_load(
- ; CHECK: load i32, i32* %P1
- ; CHECK: load volatile i32, i32* %P1
-}
-
-; Can't remove redundant volatile loads
-define i32 @redundant_volatile_load(i32* %P1, i32* %P2) {
- %a = load volatile i32, i32* %P1, align 4
- %b = load volatile i32, i32* %P1, align 4
- %res = sub i32 %a, %b
- ret i32 %res
- ; CHECK-LABEL: @redundant_volatile_load(
- ; CHECK: load volatile i32, i32* %P1
- ; CHECK: load volatile i32, i32* %P1
- ; CHECK: sub
-}
-
-; Can't DSE a volatile store
-define void @volatile_store(i32* %P1, i32* %P2) {
-; CHECK-LABEL: @volatile_store(
-; CHECK: store volatile
-; CHECK: store
- store volatile i32 0, i32* %P1, align 4
- store i32 3, i32* %P1, align 4
- ret void
-}
-
-; Can't DSE a redundant volatile store
-define void @redundant_volatile_store(i32* %P1, i32* %P2) {
-; CHECK-LABEL: @redundant_volatile_store(
-; CHECK: store volatile
-; CHECK: store volatile
- store volatile i32 0, i32* %P1, align 4
- store volatile i32 0, i32* %P1, align 4
- ret void
-}
-
-; Can value forward from volatiles
-define i32 @test20(i32* %P1, i32* %P2) {
- %a = load volatile i32, i32* %P1, align 4
- %b = load i32, i32* %P1, align 4
- %res = sub i32 %a, %b
- ret i32 %res
- ; CHECK-LABEL: @test20(
- ; CHECK: load volatile i32, i32* %P1
- ; CHECK: ret i32 0
-}
-
-; We're currently conservative about widening
-define i64 @widen1(i32* %P1) {
- ; CHECK-LABEL: @widen1(
- ; CHECK: load atomic i32, i32* %P1
- ; CHECK: load atomic i64, i64* %p2
- %p2 = bitcast i32* %P1 to i64*
- %a = load atomic i32, i32* %P1 unordered, align 4
- %b = load atomic i64, i64* %p2 unordered, align 4
- %a64 = sext i32 %a to i64
- %res = sub i64 %a64, %b
- ret i64 %res
-}
-
-; narrowing does work
-define i64 @narrow(i32* %P1) {
- ; CHECK-LABEL: @narrow(
- ; CHECK: load atomic i64, i64* %p2
- ; CHECK-NOT: load atomic i32, i32* %P1
- %p2 = bitcast i32* %P1 to i64*
- %a64 = load atomic i64, i64* %p2 unordered, align 4
- %b = load atomic i32, i32* %P1 unordered, align 4
- %b64 = sext i32 %b to i64
- %res = sub i64 %a64, %b64
- ret i64 %res
-}
-
-; Missed optimization, we don't yet optimize ordered loads
-define i64 @narrow2(i32* %P1) {
- ; CHECK-LABEL: @narrow2(
- ; CHECK: load atomic i64, i64* %p2
- ; CHECK: load atomic i32, i32* %P1
- %p2 = bitcast i32* %P1 to i64*
- %a64 = load atomic i64, i64* %p2 acquire, align 4
- %b = load atomic i32, i32* %P1 acquire, align 4
- %b64 = sext i32 %b to i64
- %res = sub i64 %a64, %b64
- ret i64 %res
-}
-
-; Note: The cross block FRE testing is deliberately light. All of the tricky
-; bits of legality are shared code with the block-local FRE above. These
-; are here only to show that we haven't obviously broken anything.
-
-; unordered atomic to unordered atomic
-define i32 @non_local_fre(i32* %P1) {
-; CHECK-LABEL: @non_local_fre(
-; CHECK: load atomic i32, i32* %P1
-; CHECK: ret i32 0
-; CHECK: ret i32 0
- %a = load atomic i32, i32* %P1 unordered, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- ret i32 %a
-next:
- %b = load atomic i32, i32* %P1 unordered, align 4
- %res = sub i32 %a, %b
- ret i32 %res
-}
-
-; unordered atomic to non-atomic
-define i32 @non_local_fre2(i32* %P1) {
-; CHECK-LABEL: @non_local_fre2(
-; CHECK: load atomic i32, i32* %P1
-; CHECK: ret i32 0
-; CHECK: ret i32 0
- %a = load atomic i32, i32* %P1 unordered, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- ret i32 %a
-next:
- %b = load i32, i32* %P1
- %res = sub i32 %a, %b
- ret i32 %res
-}
-
-; Can't forward ordered atomics.
-define i32 @non_local_fre3(i32* %P1) {
-; CHECK-LABEL: @non_local_fre3(
-; CHECK: load atomic i32, i32* %P1 acquire
-; CHECK: ret i32 0
-; CHECK: load atomic i32, i32* %P1 acquire
-; CHECK: ret i32 %res
- %a = load atomic i32, i32* %P1 acquire, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- ret i32 %a
-next:
- %b = load atomic i32, i32* %P1 acquire, align 4
- %res = sub i32 %a, %b
- ret i32 %res
-}
-
-declare void @clobber()
-
-; unordered atomic to unordered atomic
-define i32 @non_local_pre(i32* %P1) {
-; CHECK-LABEL: @non_local_pre(
-; CHECK: load atomic i32, i32* %P1 unordered
-; CHECK: load atomic i32, i32* %P1 unordered
-; CHECK: %b = phi i32 [ %b.pre, %early ], [ %a, %0 ]
-; CHECK: ret i32 %b
- %a = load atomic i32, i32* %P1 unordered, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- call void @clobber()
- br label %next
-next:
- %b = load atomic i32, i32* %P1 unordered, align 4
- ret i32 %b
-}
-
-; unordered atomic to non-atomic
-define i32 @non_local_pre2(i32* %P1) {
-; CHECK-LABEL: @non_local_pre2(
-; CHECK: load atomic i32, i32* %P1 unordered
-; CHECK: load i32, i32* %P1
-; CHECK: %b = phi i32 [ %b.pre, %early ], [ %a, %0 ]
-; CHECK: ret i32 %b
- %a = load atomic i32, i32* %P1 unordered, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- call void @clobber()
- br label %next
-next:
- %b = load i32, i32* %P1
- ret i32 %b
-}
-
-; non-atomic to unordered atomic - can't forward!
-define i32 @non_local_pre3(i32* %P1) {
-; CHECK-LABEL: @non_local_pre3(
-; CHECK: %a = load i32, i32* %P1
-; CHECK: %b = load atomic i32, i32* %P1 unordered
-; CHECK: ret i32 %b
- %a = load i32, i32* %P1
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- call void @clobber()
- br label %next
-next:
- %b = load atomic i32, i32* %P1 unordered, align 4
- ret i32 %b
-}
-
-; ordered atomic to ordered atomic - can't forward
-define i32 @non_local_pre4(i32* %P1) {
-; CHECK-LABEL: @non_local_pre4(
-; CHECK: %a = load atomic i32, i32* %P1 seq_cst
-; CHECK: %b = load atomic i32, i32* %P1 seq_cst
-; CHECK: ret i32 %b
- %a = load atomic i32, i32* %P1 seq_cst, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- call void @clobber()
- br label %next
-next:
- %b = load atomic i32, i32* %P1 seq_cst, align 4
- ret i32 %b
-}
-
-; can't remove volatile on any path
-define i32 @non_local_pre5(i32* %P1) {
-; CHECK-LABEL: @non_local_pre5(
-; CHECK: %a = load atomic i32, i32* %P1 seq_cst
-; CHECK: %b = load volatile i32, i32* %P1
-; CHECK: ret i32 %b
- %a = load atomic i32, i32* %P1 seq_cst, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- call void @clobber()
- br label %next
-next:
- %b = load volatile i32, i32* %P1
- ret i32 %b
-}
-
-
-; ordered atomic to unordered atomic
-define i32 @non_local_pre6(i32* %P1) {
-; CHECK-LABEL: @non_local_pre6(
-; CHECK: load atomic i32, i32* %P1 seq_cst
-; CHECK: load atomic i32, i32* %P1 unordered
-; CHECK: %b = phi i32 [ %b.pre, %early ], [ %a, %0 ]
-; CHECK: ret i32 %b
- %a = load atomic i32, i32* %P1 seq_cst, align 4
- %cmp = icmp eq i32 %a, 0
- br i1 %cmp, label %early, label %next
-early:
- call void @clobber()
- br label %next
-next:
- %b = load atomic i32, i32* %P1 unordered, align 4
- ret i32 %b
-}
-
Removed: llvm/trunk/test/Transforms/GVN/invariant-load.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/invariant-load.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/invariant-load.ll (original)
+++ llvm/trunk/test/Transforms/GVN/invariant-load.ll (removed)
@@ -1,136 +0,0 @@
-; Test if the !invariant.load metadata is maintained by GVN.
-; RUN: opt -basicaa -gvn -S < %s | FileCheck %s
-
-define i32 @test1(i32* nocapture %p, i8* nocapture %q) {
-; CHECK-LABEL: test1
-; CHECK: %x = load i32, i32* %p, align 4, !invariant.load !0
-; CHECK-NOT: %y = load
-entry:
- %x = load i32, i32* %p, align 4, !invariant.load !0
- %conv = trunc i32 %x to i8
- store i8 %conv, i8* %q, align 1
- %y = load i32, i32* %p, align 4, !invariant.load !0
- %add = add i32 %y, 1
- ret i32 %add
-}
-
-define i32 @test2(i32* nocapture %p, i8* nocapture %q) {
-; CHECK-LABEL: test2
-; CHECK-NOT: !invariant.load
-; CHECK-NOT: %y = load
-entry:
- %x = load i32, i32* %p, align 4
- %conv = trunc i32 %x to i8
- store i8 %conv, i8* %q, align 1
- %y = load i32, i32* %p, align 4, !invariant.load !0
- %add = add i32 %y, 1
- ret i32 %add
-}
-
-; With the invariant.load metadata, what would otherwise
-; be a case for PRE becomes a full redundancy.
-define i32 @test3(i1 %cnd, i32* %p, i32* %q) {
-; CHECK-LABEL: test3
-; CHECK-NOT: load
-entry:
- %v1 = load i32, i32* %p
- br i1 %cnd, label %bb1, label %bb2
-
-bb1:
- store i32 5, i32* %q
- br label %bb2
-
-bb2:
- %v2 = load i32, i32* %p, !invariant.load !0
- %res = sub i32 %v1, %v2
- ret i32 %res
-}
-
-; This test is here to document a case which doesn't optimize
-; as well as it could.
-define i32 @test4(i1 %cnd, i32* %p, i32* %q) {
-; CHECK-LABEL: test4
-; %v2 is redundant, but GVN currently doesn't catch that
-entry:
- %v1 = load i32, i32* %p, !invariant.load !0
- br i1 %cnd, label %bb1, label %bb2
-
-bb1:
- store i32 5, i32* %q
- br label %bb2
-
-bb2:
- %v2 = load i32, i32* %p
- %res = sub i32 %v1, %v2
- ret i32 %res
-}
-
-; Checks that we return the mustalias store as a def
-; so that it contributes to value forwarding. Note
-; that we could and should remove the store too.
-define i32 @test5(i1 %cnd, i32* %p) {
-; CHECK-LABEL: test5
-; CHECK-LABEL: entry:
-; CHECK-NEXT: store i32 5, i32* %p
-; CHECK-NEXT: ret i32 5
-entry:
- %v1 = load i32, i32* %p, !invariant.load !0
- store i32 5, i32* %p ;; must alias store, want to exploit
- %v2 = load i32, i32* %p, !invariant.load !0
- ret i32 %v2
-}
-
-
-declare void @foo()
-
-; Clobbering (mayalias) stores, even in function calls, can be ignored
-define i32 @test6(i1 %cnd, i32* %p) {
-; CHECK-LABEL: test6
-; CHECK-LABEL: entry:
-; CHECK-NEXT: @foo
-; CHECK-NEXT: ret i32 0
-entry:
- %v1 = load i32, i32* %p, !invariant.load !0
- call void @foo()
- %v2 = load i32, i32* %p, !invariant.load !0
- %res = sub i32 %v1, %v2
- ret i32 %res
-}
-
-declare noalias i32* @bar(...)
-
-; Same as previous, but a function with a noalias result (since they're handled
-; differently in MDA)
-define i32 @test7(i1 %cnd, i32* %p) {
-; CHECK-LABEL: test7
-; CHECK-LABEL: entry:
-; CHECK-NEXT: @bar
-; CHECK-NEXT: ret i32 0
-entry:
- %v1 = load i32, i32* %p, !invariant.load !0
- call i32* (...) @bar(i32* %p)
- %v2 = load i32, i32* %p, !invariant.load !0
- %res = sub i32 %v1, %v2
- ret i32 %res
-}
-
-define i32 @test8(i1 %cnd, i32* %p) {
-; CHECK-LABEL: test8
-; CHECK: @bar
-; CHECK: load i32, i32* %p2, !invariant.load
-; CHECK: br label %merge
-entry:
- %v1 = load i32, i32* %p, !invariant.load !0
- br i1 %cnd, label %taken, label %merge
-taken:
- %p2 = call i32* (...) @bar(i32* %p)
- br label %merge
-merge:
- %p3 = phi i32* [%p, %entry], [%p2, %taken]
- %v2 = load i32, i32* %p3, !invariant.load !0
- %res = sub i32 %v1, %v2
- ret i32 %res
-}
-
-!0 = !{ }
-
Removed: llvm/trunk/test/Transforms/GVN/load-metadata.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/load-metadata.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/load-metadata.ll (original)
+++ llvm/trunk/test/Transforms/GVN/load-metadata.ll (removed)
@@ -1,24 +0,0 @@
-; RUN: opt -S -gvn < %s | FileCheck %s
-
-define i32 @test1(i32* %p, i1 %C) {
-; CHECK-LABEL: @test1(
-block1:
- br i1 %C, label %block2, label %block3
-
-block2:
- br label %block4
-; CHECK: block2:
-; CHECK-NEXT: load i32, i32* %p, !range !0, !invariant.group !1
-
-block3:
- store i32 0, i32* %p
- br label %block4
-
-block4:
- %PRE = load i32, i32* %p, !range !0, !invariant.group !1
- ret i32 %PRE
-}
-
-
-!0 = !{i32 40, i32 100}
-!1 = !{!"magic ptr"}
Removed: llvm/trunk/test/Transforms/GVN/load-pre-align.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/load-pre-align.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/load-pre-align.ll (original)
+++ llvm/trunk/test/Transforms/GVN/load-pre-align.ll (removed)
@@ -1,44 +0,0 @@
-; RUN: opt < %s -gvn -S | FileCheck %s
-
-target datalayout = "e-p:32:32:32-i1:8:32-i8:8:32-i16:16:32-i32:32:32-i64:32:32-f32:32:32-f64:32:32-v64:64:64-v128:128:128-a0:0:32-n32"
-
- at p = external global i32
-
-define i32 @test(i32 %n) nounwind {
-; CHECK-LABEL: @test(
-entry:
- br label %for.cond
-
-; loads aligned greater than the memory should not be moved past conditionals
-; CHECK-NOT: load
-; CHECK: br i1
-
-for.cond:
- %i.0 = phi i32 [ 0, %entry ], [ %indvar.next, %for.inc ]
- %cmp = icmp slt i32 %i.0, %n
- br i1 %cmp, label %for.body, label %for.cond.for.end_crit_edge
-
-for.cond.for.end_crit_edge:
-; ...but PRE can still move the load out of for.end to here.
-; CHECK: for.cond.for.end_crit_edge:
-; CHECK-NEXT: load
- br label %for.end
-
-for.body:
- %tmp3 = load i32, i32* @p, align 8
- %dec = add i32 %tmp3, -1
- store i32 %dec, i32* @p
- %cmp6 = icmp slt i32 %dec, 0
- br i1 %cmp6, label %for.body.for.end_crit_edge, label %for.inc
-
-for.body.for.end_crit_edge:
- br label %for.end
-
-for.inc:
- %indvar.next = add i32 %i.0, 1
- br label %for.cond
-
-for.end:
- %tmp9 = load i32, i32* @p, align 8
- ret i32 %tmp9
-}
Removed: llvm/trunk/test/Transforms/GVN/load-pre-licm.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/load-pre-licm.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/load-pre-licm.ll (original)
+++ llvm/trunk/test/Transforms/GVN/load-pre-licm.ll (removed)
@@ -1,39 +0,0 @@
-; RUN: opt -S -basicaa -gvn < %s | FileCheck %s
-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-n8:16:32"
-target triple = "i386-apple-darwin11.0.0"
-
- at sortlist = external global [5001 x i32], align 4
-
-define void @Bubble() nounwind noinline {
-; CHECK: entry:
-; CHECK-NEXT: %tmp7.pre = load i32
-entry:
- br label %while.body5
-
-; CHECK: while.body5:
-; CHECK: %tmp7 = phi i32
-; CHECK-NOT: %tmp7 = load i32
-while.body5:
- %indvar = phi i32 [ 0, %entry ], [ %tmp6, %if.end ]
- %tmp5 = add i32 %indvar, 2
- %arrayidx9 = getelementptr [5001 x i32], [5001 x i32]* @sortlist, i32 0, i32 %tmp5
- %tmp6 = add i32 %indvar, 1
- %arrayidx = getelementptr [5001 x i32], [5001 x i32]* @sortlist, i32 0, i32 %tmp6
- %tmp7 = load i32, i32* %arrayidx, align 4
- %tmp10 = load i32, i32* %arrayidx9, align 4
- %cmp11 = icmp sgt i32 %tmp7, %tmp10
- br i1 %cmp11, label %if.then, label %if.end
-
-; CHECK: if.then:
-if.then:
- store i32 %tmp10, i32* %arrayidx, align 4
- store i32 %tmp7, i32* %arrayidx9, align 4
- br label %if.end
-
-if.end:
- %exitcond = icmp eq i32 %tmp6, 100
- br i1 %exitcond, label %while.end.loopexit, label %while.body5
-
-while.end.loopexit:
- ret void
-}
Removed: llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll (original)
+++ llvm/trunk/test/Transforms/GVN/load-pre-nonlocal.ll (removed)
@@ -1,111 +0,0 @@
-; RUN: opt -S -o - -basicaa -domtree -gvn %s | FileCheck %s
-
-target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
-
-%struct.S1 = type { i32, i32 }
-
- at a2 = common global i32* null, align 8
- at a = common global i32* null, align 8
- at s1 = common global %struct.S1 zeroinitializer, align 8
-
-; Check that GVN doesn't determine %2 is partially redundant.
-
-; CHECK-LABEL: define i32 @volatile_load
-; CHECK: for.body:
-; CHECK: %2 = load i32, i32*
-; CHECK: %3 = load volatile i32, i32*
-; CHECK: for.cond.for.end_crit_edge:
-
-define i32 @volatile_load(i32 %n) {
-entry:
- %cmp6 = icmp sgt i32 %n, 0
- br i1 %cmp6, label %for.body.lr.ph, label %for.end
-
-for.body.lr.ph:
- %0 = load i32*, i32** @a2, align 8, !tbaa !1
- %1 = load i32*, i32** @a, align 8, !tbaa !1
- br label %for.body
-
-for.body:
- %indvars.iv = phi i64 [ 0, %for.body.lr.ph ], [ %indvars.iv.next, %for.body ]
- %s.09 = phi i32 [ 0, %for.body.lr.ph ], [ %add, %for.body ]
- %p.08 = phi i32* [ %0, %for.body.lr.ph ], [ %incdec.ptr, %for.body ]
- %2 = load i32, i32* %p.08, align 4, !tbaa !5
- %arrayidx = getelementptr inbounds i32, i32* %1, i64 %indvars.iv
- store i32 %2, i32* %arrayidx, align 4, !tbaa !5
- %3 = load volatile i32, i32* %p.08, align 4, !tbaa !5
- %add = add nsw i32 %3, %s.09
- %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
- %incdec.ptr = getelementptr inbounds i32, i32* %p.08, i64 1
- %lftr.wideiv = trunc i64 %indvars.iv.next to i32
- %exitcond = icmp ne i32 %lftr.wideiv, %n
- br i1 %exitcond, label %for.body, label %for.cond.for.end_crit_edge
-
-for.cond.for.end_crit_edge:
- %add.lcssa = phi i32 [ %add, %for.body ]
- br label %for.end
-
-for.end:
- %s.0.lcssa = phi i32 [ %add.lcssa, %for.cond.for.end_crit_edge ], [ 0, %entry ]
- ret i32 %s.0.lcssa
-}
-
-; %1 is partially redundant if %0 can be widened to a 64-bit load.
-
-; CHECK-LABEL: define i32 @overaligned_load
-; CHECK: if.then:
-; CHECK: %0 = load i64
-; CHECK: [[LSHR:%[0-9]+]] = lshr i64 %0, 32, !dbg [[LSHR_LOC:![0-9]+]]
-; CHECK: trunc i64 [[LSHR]] to i32
-; CHECK: if.end:
-; CHECK-NOT: %1 = load i32, i32*
-; CHECK: [[LSHR_LOC]] = !DILocation(line: 101, column: 1, scope: !{{.*}})
-
-define i32 @overaligned_load(i32 %a, i32* nocapture %b) !dbg !13 {
-entry:
- %cmp = icmp sgt i32 %a, 0, !dbg !14
- br i1 %cmp, label %if.then, label %if.else, !dbg !14
-
-if.then:
- %0 = load i32, i32* getelementptr inbounds (%struct.S1, %struct.S1* @s1, i64 0, i32 0), align 8, !tbaa !5, !dbg !15
- br label %if.end, !dbg !15
-
-if.else:
- %arrayidx = getelementptr inbounds i32, i32* %b, i64 2, !dbg !16
- store i32 10, i32* %arrayidx, align 4, !tbaa !5, !dbg !16
- br label %if.end, !dbg !16
-
-if.end:
- %i.0 = phi i32 [ %0, %if.then ], [ 0, %if.else ]
- %p.0 = phi i32* [ getelementptr inbounds (%struct.S1, %struct.S1* @s1, i64 0, i32 0), %if.then ], [ %b, %if.else ]
- %add.ptr = getelementptr inbounds i32, i32* %p.0, i64 1, !dbg !17
- %1 = load i32, i32* %add.ptr, align 4, !tbaa !5, !dbg !17
- %add1 = add nsw i32 %1, %i.0, !dbg !17
- ret i32 %add1, !dbg !17
-}
-
-!1 = !{!2, !2, i64 0}
-!2 = !{!"any pointer", !3, i64 0}
-!3 = !{!"omnipotent char", !4, i64 0}
-!4 = !{!"Simple C/C++ TBAA"}
-!5 = !{!6, !6, i64 0}
-!6 = !{!"int", !3, i64 0}
-
-!llvm.module.flags = !{!7, !8, !9}
-!llvm.dbg.cu = !{!18}
-!7 = !{i32 2, !"Dwarf Version", i32 4}
-!8 = !{i32 2, !"Debug Info Version", i32 3}
-!9 = !{i32 1, !"PIC Level", i32 2}
-
-!10 = !{}
-!11 = !DISubroutineType(types: !10)
-!12 = !DIFile(filename: "test.cpp", directory: "/tmp")
-!13 = distinct !DISubprogram(name: "test", scope: !12, file: !12, line: 99, type: !11, isLocal: false, isDefinition: true, scopeLine: 100, flags: DIFlagPrototyped, isOptimized: false, unit: !18, variables: !10)
-!14 = !DILocation(line: 100, column: 1, scope: !13)
-!15 = !DILocation(line: 101, column: 1, scope: !13)
-!16 = !DILocation(line: 102, column: 1, scope: !13)
-!17 = !DILocation(line: 103, column: 1, scope: !13)
-!18 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
- file: !12,
- isOptimized: true, flags: "-O2",
- splitDebugFilename: "abc.debug", emissionKind: 2)
Removed: llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll (original)
+++ llvm/trunk/test/Transforms/GVN/lpre-call-wrap-2.ll (removed)
@@ -1,40 +0,0 @@
-; RUN: opt -S -basicaa -gvn -enable-load-pre < %s | FileCheck %s
-;
-; The partially redundant load in bb1 should be hoisted to "bb". This comes
-; from this C code (GCC PR 23455):
-; unsigned outcnt; extern void flush_outbuf(void);
-; void bi_windup(unsigned char *outbuf, unsigned char bi_buf) {
-; outbuf[outcnt] = bi_buf;
-; if (outcnt == 16384)
-; flush_outbuf();
-; outbuf[outcnt] = bi_buf;
-; }
-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 = "i386-apple-darwin7"
- at outcnt = common global i32 0 ; <i32*> [#uses=3]
-
-define void @bi_windup(i8* %outbuf, i8 zeroext %bi_buf) nounwind {
-entry:
- %"alloca point" = bitcast i32 0 to i32 ; <i32> [#uses=0]
- %0 = load i32, i32* @outcnt, align 4 ; <i32> [#uses=1]
- %1 = getelementptr i8, i8* %outbuf, i32 %0 ; <i8*> [#uses=1]
- store i8 %bi_buf, i8* %1, align 1
- %2 = load i32, i32* @outcnt, align 4 ; <i32> [#uses=1]
- %3 = icmp eq i32 %2, 16384 ; <i1> [#uses=1]
- br i1 %3, label %bb, label %bb1
-
-bb: ; preds = %entry
- call void @flush_outbuf() nounwind
- br label %bb1
-
-bb1: ; preds = %bb, %entry
-; CHECK: bb1:
-; CHECK-NEXT: phi
-; CHECK-NEXT: getelementptr
- %4 = load i32, i32* @outcnt, align 4 ; <i32> [#uses=1]
- %5 = getelementptr i8, i8* %outbuf, i32 %4 ; <i8*> [#uses=1]
- store i8 %bi_buf, i8* %5, align 1
- ret void
-}
-
-declare void @flush_outbuf()
Removed: llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll (original)
+++ llvm/trunk/test/Transforms/GVN/lpre-call-wrap.ll (removed)
@@ -1,55 +0,0 @@
-; RUN: opt -S -gvn -enable-load-pre < %s | FileCheck %s
-;
-; Make sure the load in bb3.backedge is removed and moved into bb1 after the
-; call. This makes the non-call case faster.
-;
-; This test is derived from this C++ code (GCC PR 37810):
-; void g();
-; struct A {
-; int n; int m;
-; A& operator++(void) { ++n; if (n == m) g(); return *this; }
-; A() : n(0), m(0) { }
-; friend bool operator!=(A const& a1, A const& a2) { return a1.n != a2.n; }
-; };
-; void testfunction(A& iter) { A const end; while (iter != end) ++iter; }
-;
-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 = "i386-apple-darwin7"
- %struct.A = type { i32, i32 }
-
-define void @_Z12testfunctionR1A(%struct.A* %iter) {
-entry:
- %0 = getelementptr %struct.A, %struct.A* %iter, i32 0, i32 0 ; <i32*> [#uses=3]
- %1 = load i32, i32* %0, align 4 ; <i32> [#uses=2]
- %2 = icmp eq i32 %1, 0 ; <i1> [#uses=1]
- br i1 %2, label %return, label %bb.nph
-
-bb.nph: ; preds = %entry
- %3 = getelementptr %struct.A, %struct.A* %iter, i32 0, i32 1 ; <i32*> [#uses=1]
- br label %bb
-
-bb: ; preds = %bb3.backedge, %bb.nph
- %.rle = phi i32 [ %1, %bb.nph ], [ %7, %bb3.backedge ] ; <i32> [#uses=1]
- %4 = add i32 %.rle, 1 ; <i32> [#uses=2]
- store i32 %4, i32* %0, align 4
- %5 = load i32, i32* %3, align 4 ; <i32> [#uses=1]
- %6 = icmp eq i32 %4, %5 ; <i1> [#uses=1]
- br i1 %6, label %bb1, label %bb3.backedge
-
-bb1: ; preds = %bb
- tail call void @_Z1gv()
- br label %bb3.backedge
-
-bb3.backedge: ; preds = %bb, %bb1
-; CHECK: bb3.backedge:
-; CHECK-NEXT: phi
-; CHECK-NEXT: icmp
- %7 = load i32, i32* %0, align 4 ; <i32> [#uses=2]
- %8 = icmp eq i32 %7, 0 ; <i1> [#uses=1]
- br i1 %8, label %return, label %bb
-
-return: ; preds = %bb3.backedge, %entry
- ret void
-}
-
-declare void @_Z1gv()
Removed: llvm/trunk/test/Transforms/GVN/phi-translate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/phi-translate.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/phi-translate.ll (original)
+++ llvm/trunk/test/Transforms/GVN/phi-translate.ll (removed)
@@ -1,57 +0,0 @@
-; RUN: opt -basicaa -gvn -S < %s | FileCheck %s
-
-target datalayout = "e-p:64:64:64"
-
-; CHECK-LABEL: @foo(
-; CHECK: entry.end_crit_edge:
-; CHECK: %j.phi.trans.insert = sext i32 %x to i64, !dbg [[J_LOC:![0-9]+]]
-; CHECK: %q.phi.trans.insert = getelementptr {{.*}}, !dbg [[Q_LOC:![0-9]+]]
-; CHECK: %n.pre = load i32, i32* %q.phi.trans.insert, !dbg [[N_LOC:![0-9]+]]
-; CHECK: then:
-; CHECK: store i32 %z
-; CHECK: end:
-; CHECK: %n = phi i32 [ %n.pre, %entry.end_crit_edge ], [ %z, %then ], !dbg [[N_LOC]]
-; CHECK: ret i32 %n
-
-; CHECK-DAG: [[J_LOC]] = !DILocation(line: 45, column: 1, scope: !{{.*}})
-; CHECK-DAG: [[Q_LOC]] = !DILocation(line: 46, column: 1, scope: !{{.*}})
-; CHECK-DAG: [[N_LOC]] = !DILocation(line: 47, column: 1, scope: !{{.*}})
-
- at G = external global [100 x i32]
-define i32 @foo(i32 %x, i32 %z) !dbg !6 {
-entry:
- %tobool = icmp eq i32 %z, 0, !dbg !7
- br i1 %tobool, label %end, label %then, !dbg !7
-
-then:
- %i = sext i32 %x to i64, !dbg !8
- %p = getelementptr [100 x i32], [100 x i32]* @G, i64 0, i64 %i, !dbg !8
- store i32 %z, i32* %p, !dbg !8
- br label %end, !dbg !8
-
-end:
- %j = sext i32 %x to i64, !dbg !9
- %q = getelementptr [100 x i32], [100 x i32]* @G, i64 0, i64 %j, !dbg !10
- %n = load i32, i32* %q, !dbg !11
- ret i32 %n, !dbg !11
-}
-
-!llvm.module.flags = !{!0, !1, !2}
-!llvm.dbg.cu = !{!12}
-!0 = !{i32 2, !"Dwarf Version", i32 4}
-!1 = !{i32 2, !"Debug Info Version", i32 3}
-!2 = !{i32 1, !"PIC Level", i32 2}
-
-!3 = !{}
-!4 = !DISubroutineType(types: !3)
-!5 = !DIFile(filename: "a.cc", directory: "/tmp")
-!6 = distinct !DISubprogram(name: "foo", scope: !5, file: !5, line: 42, type: !4, isLocal: false, isDefinition: true, scopeLine: 43, flags: DIFlagPrototyped, isOptimized: false, unit: !12, variables: !3)
-!7 = !DILocation(line: 43, column: 1, scope: !6)
-!8 = !DILocation(line: 44, column: 1, scope: !6)
-!9 = !DILocation(line: 45, column: 1, scope: !6)
-!10 = !DILocation(line: 46, column: 1, scope: !6)
-!11 = !DILocation(line: 47, column: 1, scope: !6)
-!12 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang",
- file: !5,
- isOptimized: true, flags: "-O2",
- splitDebugFilename: "abc.debug", emissionKind: 2)
Removed: llvm/trunk/test/Transforms/GVN/pre-gep-load.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/pre-gep-load.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/pre-gep-load.ll (original)
+++ llvm/trunk/test/Transforms/GVN/pre-gep-load.ll (removed)
@@ -1,82 +0,0 @@
-; RUN: opt < %s -basicaa -gvn -enable-load-pre -S | FileCheck %s
-; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn -enable-load-pre -S | FileCheck %s
-
-target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
-target triple = "aarch64--linux-gnu"
-
-define double @foo(i32 %stat, i32 %i, double** %p) {
-; CHECK-LABEL: @foo(
-entry:
- switch i32 %stat, label %sw.default [
- i32 0, label %sw.bb
- i32 1, label %sw.bb
- i32 2, label %sw.bb2
- ]
-
-sw.bb: ; preds = %entry, %entry
- %idxprom = sext i32 %i to i64
- %arrayidx = getelementptr inbounds double*, double** %p, i64 0
- %0 = load double*, double** %arrayidx, align 8
- %arrayidx1 = getelementptr inbounds double, double* %0, i64 %idxprom
- %1 = load double, double* %arrayidx1, align 8
- %sub = fsub double %1, 1.000000e+00
- %cmp = fcmp olt double %sub, 0.000000e+00
- br i1 %cmp, label %if.then, label %if.end
-
-if.then: ; preds = %sw.bb
- br label %return
-
-if.end: ; preds = %sw.bb
- br label %sw.bb2
-
-sw.bb2: ; preds = %if.end, %entry
- %idxprom3 = sext i32 %i to i64
- %arrayidx4 = getelementptr inbounds double*, double** %p, i64 0
- %2 = load double*, double** %arrayidx4, align 8
- %arrayidx5 = getelementptr inbounds double, double* %2, i64 %idxprom3
- %3 = load double, double* %arrayidx5, align 8
-; CHECK: sw.bb2:
-; CHECK-NOT: sext
-; CHECK-NEXT: phi double [
-; CHECK-NOT: load
- %sub6 = fsub double 3.000000e+00, %3
- br label %return
-
-sw.default: ; preds = %entry
- br label %return
-
-return: ; preds = %sw.default, %sw.bb2, %if.then
- %retval.0 = phi double [ 0.000000e+00, %sw.default ], [ %sub6, %sw.bb2 ], [ %sub, %if.then ]
- ret double %retval.0
-}
-
-; The load causes the GEP's operands to be PREd earlier than normal. The
-; resulting sext ends up in pre.dest and in the GVN system before that BB is
-; actually processed. Make sure we can deal with the situation.
-
-define void @test_shortcut_safe(i1 %tst, i32 %p1, i32* %a) {
-; CHECK-LABEL: define void @test_shortcut_safe
-; CHECK: [[SEXT1:%.*]] = sext i32 %p1 to i64
-; CHECK: [[PHI1:%.*]] = phi i64 [ [[SEXT1]], {{%.*}} ], [ [[PHI2:%.*]], {{%.*}} ]
-; CHECK: [[SEXT2:%.*]] = sext i32 %p1 to i64
-; CHECK: [[PHI2]] = phi i64 [ [[SEXT2]], {{.*}} ], [ [[PHI1]], {{%.*}} ]
-; CHECK: getelementptr inbounds i32, i32* %a, i64 [[PHI2]]
-
- br i1 %tst, label %sext1, label %pre.dest
-
-pre.dest:
- br label %sext.use
-
-sext1:
- %idxprom = sext i32 %p1 to i64
- br label %sext.use
-
-sext.use:
- %idxprom2 = sext i32 %p1 to i64
- %arrayidx3 = getelementptr inbounds i32, i32* %a, i64 %idxprom2
- %val = load i32, i32* %arrayidx3, align 4
- tail call void (i32) @g(i32 %val)
- br label %pre.dest
-}
-
-declare void @g(i32)
Removed: llvm/trunk/test/Transforms/GVN/pre-load.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/pre-load.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/pre-load.ll (original)
+++ llvm/trunk/test/Transforms/GVN/pre-load.ll (removed)
@@ -1,432 +0,0 @@
-; RUN: opt < %s -basicaa -gvn -enable-load-pre -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"
-
-define i32 @test1(i32* %p, i1 %C) {
-; CHECK-LABEL: @test1(
-block1:
- br i1 %C, label %block2, label %block3
-
-block2:
- br label %block4
-; CHECK: block2:
-; CHECK-NEXT: load i32, i32* %p
-
-block3:
- store i32 0, i32* %p
- br label %block4
-
-block4:
- %PRE = load i32, i32* %p
- ret i32 %PRE
-; CHECK: block4:
-; CHECK-NEXT: phi i32
-; CHECK-NEXT: ret i32
-}
-
-; This is a simple phi translation case.
-define i32 @test2(i32* %p, i32* %q, i1 %C) {
-; CHECK-LABEL: @test2(
-block1:
- br i1 %C, label %block2, label %block3
-
-block2:
- br label %block4
-; CHECK: block2:
-; CHECK-NEXT: load i32, i32* %q
-
-block3:
- store i32 0, i32* %p
- br label %block4
-
-block4:
- %P2 = phi i32* [%p, %block3], [%q, %block2]
- %PRE = load i32, i32* %P2
- ret i32 %PRE
-; CHECK: block4:
-; CHECK-NEXT: phi i32 [
-; CHECK-NOT: load
-; CHECK: ret i32
-}
-
-; This is a PRE case that requires phi translation through a GEP.
-define i32 @test3(i32* %p, i32* %q, i32** %Hack, i1 %C) {
-; CHECK-LABEL: @test3(
-block1:
- %B = getelementptr i32, i32* %q, i32 1
- store i32* %B, i32** %Hack
- br i1 %C, label %block2, label %block3
-
-block2:
- br label %block4
-; CHECK: block2:
-; CHECK-NEXT: load i32, i32* %B
-
-block3:
- %A = getelementptr i32, i32* %p, i32 1
- store i32 0, i32* %A
- br label %block4
-
-block4:
- %P2 = phi i32* [%p, %block3], [%q, %block2]
- %P3 = getelementptr i32, i32* %P2, i32 1
- %PRE = load i32, i32* %P3
- ret i32 %PRE
-; CHECK: block4:
-; CHECK-NEXT: phi i32 [
-; CHECK-NOT: load
-; CHECK: ret i32
-}
-
-;; Here the loaded address is available, but the computation is in 'block3'
-;; which does not dominate 'block2'.
-define i32 @test4(i32* %p, i32* %q, i32** %Hack, i1 %C) {
-; CHECK-LABEL: @test4(
-block1:
- br i1 %C, label %block2, label %block3
-
-block2:
- br label %block4
-; CHECK: block2:
-; CHECK: load i32, i32*
-; CHECK: br label %block4
-
-block3:
- %B = getelementptr i32, i32* %q, i32 1
- store i32* %B, i32** %Hack
-
- %A = getelementptr i32, i32* %p, i32 1
- store i32 0, i32* %A
- br label %block4
-
-block4:
- %P2 = phi i32* [%p, %block3], [%q, %block2]
- %P3 = getelementptr i32, i32* %P2, i32 1
- %PRE = load i32, i32* %P3
- ret i32 %PRE
-; CHECK: block4:
-; CHECK-NEXT: phi i32 [
-; CHECK-NOT: load
-; CHECK: ret i32
-}
-
-;void test5(int N, double *G) {
-; int j;
-; for (j = 0; j < N - 1; j++)
-; G[j] = G[j] + G[j+1];
-;}
-
-define void @test5(i32 %N, double* nocapture %G) nounwind ssp {
-; CHECK-LABEL: @test5(
-entry:
- %0 = add i32 %N, -1
- %1 = icmp sgt i32 %0, 0
- br i1 %1, label %bb.nph, label %return
-
-bb.nph:
- %tmp = zext i32 %0 to i64
- br label %bb
-
-; CHECK: bb.nph:
-; CHECK: load double, double*
-; CHECK: br label %bb
-
-bb:
- %indvar = phi i64 [ 0, %bb.nph ], [ %tmp6, %bb ]
- %tmp6 = add i64 %indvar, 1
- %scevgep = getelementptr double, double* %G, i64 %tmp6
- %scevgep7 = getelementptr double, double* %G, i64 %indvar
- %2 = load double, double* %scevgep7, align 8
- %3 = load double, double* %scevgep, align 8
- %4 = fadd double %2, %3
- store double %4, double* %scevgep7, align 8
- %exitcond = icmp eq i64 %tmp6, %tmp
- br i1 %exitcond, label %return, label %bb
-
-; Should only be one load in the loop.
-; CHECK: bb:
-; CHECK: load double, double*
-; CHECK-NOT: load double, double*
-; CHECK: br i1 %exitcond
-
-return:
- ret void
-}
-
-;void test6(int N, double *G) {
-; int j;
-; for (j = 0; j < N - 1; j++)
-; G[j+1] = G[j] + G[j+1];
-;}
-
-define void @test6(i32 %N, double* nocapture %G) nounwind ssp {
-; CHECK-LABEL: @test6(
-entry:
- %0 = add i32 %N, -1
- %1 = icmp sgt i32 %0, 0
- br i1 %1, label %bb.nph, label %return
-
-bb.nph:
- %tmp = zext i32 %0 to i64
- br label %bb
-
-; CHECK: bb.nph:
-; CHECK: load double, double*
-; CHECK: br label %bb
-
-bb:
- %indvar = phi i64 [ 0, %bb.nph ], [ %tmp6, %bb ]
- %tmp6 = add i64 %indvar, 1
- %scevgep = getelementptr double, double* %G, i64 %tmp6
- %scevgep7 = getelementptr double, double* %G, i64 %indvar
- %2 = load double, double* %scevgep7, align 8
- %3 = load double, double* %scevgep, align 8
- %4 = fadd double %2, %3
- store double %4, double* %scevgep, align 8
- %exitcond = icmp eq i64 %tmp6, %tmp
- br i1 %exitcond, label %return, label %bb
-
-; Should only be one load in the loop.
-; CHECK: bb:
-; CHECK: load double, double*
-; CHECK-NOT: load double, double*
-; CHECK: br i1 %exitcond
-
-return:
- ret void
-}
-
-;void test7(int N, double* G) {
-; long j;
-; G[1] = 1;
-; for (j = 1; j < N - 1; j++)
-; G[j+1] = G[j] + G[j+1];
-;}
-
-; This requires phi translation of the adds.
-define void @test7(i32 %N, double* nocapture %G) nounwind ssp {
-entry:
- %0 = getelementptr inbounds double, double* %G, i64 1
- store double 1.000000e+00, double* %0, align 8
- %1 = add i32 %N, -1
- %2 = icmp sgt i32 %1, 1
- br i1 %2, label %bb.nph, label %return
-
-bb.nph:
- %tmp = sext i32 %1 to i64
- %tmp7 = add i64 %tmp, -1
- br label %bb
-
-bb:
- %indvar = phi i64 [ 0, %bb.nph ], [ %tmp9, %bb ]
- %tmp8 = add i64 %indvar, 2
- %scevgep = getelementptr double, double* %G, i64 %tmp8
- %tmp9 = add i64 %indvar, 1
- %scevgep10 = getelementptr double, double* %G, i64 %tmp9
- %3 = load double, double* %scevgep10, align 8
- %4 = load double, double* %scevgep, align 8
- %5 = fadd double %3, %4
- store double %5, double* %scevgep, align 8
- %exitcond = icmp eq i64 %tmp9, %tmp7
- br i1 %exitcond, label %return, label %bb
-
-; Should only be one load in the loop.
-; CHECK: bb:
-; CHECK: load double, double*
-; CHECK-NOT: load double, double*
-; CHECK: br i1 %exitcond
-
-return:
- ret void
-}
-
-;; Here the loaded address isn't available in 'block2' at all, requiring a new
-;; GEP to be inserted into it.
-define i32 @test8(i32* %p, i32* %q, i32** %Hack, i1 %C) {
-; CHECK-LABEL: @test8(
-block1:
- br i1 %C, label %block2, label %block3
-
-block2:
- br label %block4
-; CHECK: block2:
-; CHECK: load i32, i32*
-; CHECK: br label %block4
-
-block3:
- %A = getelementptr i32, i32* %p, i32 1
- store i32 0, i32* %A
- br label %block4
-
-block4:
- %P2 = phi i32* [%p, %block3], [%q, %block2]
- %P3 = getelementptr i32, i32* %P2, i32 1
- %PRE = load i32, i32* %P3
- ret i32 %PRE
-; CHECK: block4:
-; CHECK-NEXT: phi i32 [
-; CHECK-NOT: load
-; CHECK: ret i32
-}
-
-;void test9(int N, double* G) {
-; long j;
-; for (j = 1; j < N - 1; j++)
-; G[j+1] = G[j] + G[j+1];
-;}
-
-; This requires phi translation of the adds.
-define void @test9(i32 %N, double* nocapture %G) nounwind ssp {
-entry:
- add i32 0, 0
- %1 = add i32 %N, -1
- %2 = icmp sgt i32 %1, 1
- br i1 %2, label %bb.nph, label %return
-
-bb.nph:
- %tmp = sext i32 %1 to i64
- %tmp7 = add i64 %tmp, -1
- br label %bb
-
-; CHECK: bb.nph:
-; CHECK: load double, double*
-; CHECK: br label %bb
-
-bb:
- %indvar = phi i64 [ 0, %bb.nph ], [ %tmp9, %bb ]
- %tmp8 = add i64 %indvar, 2
- %scevgep = getelementptr double, double* %G, i64 %tmp8
- %tmp9 = add i64 %indvar, 1
- %scevgep10 = getelementptr double, double* %G, i64 %tmp9
- %3 = load double, double* %scevgep10, align 8
- %4 = load double, double* %scevgep, align 8
- %5 = fadd double %3, %4
- store double %5, double* %scevgep, align 8
- %exitcond = icmp eq i64 %tmp9, %tmp7
- br i1 %exitcond, label %return, label %bb
-
-; Should only be one load in the loop.
-; CHECK: bb:
-; CHECK: load double, double*
-; CHECK-NOT: load double, double*
-; CHECK: br i1 %exitcond
-
-return:
- ret void
-}
-
-;void test10(int N, double* G) {
-; long j;
-; for (j = 1; j < N - 1; j++)
-; G[j] = G[j] + G[j+1] + G[j-1];
-;}
-
-; PR5501
-define void @test10(i32 %N, double* nocapture %G) nounwind ssp {
-entry:
- %0 = add i32 %N, -1
- %1 = icmp sgt i32 %0, 1
- br i1 %1, label %bb.nph, label %return
-
-bb.nph:
- %tmp = sext i32 %0 to i64
- %tmp8 = add i64 %tmp, -1
- br label %bb
-; CHECK: bb.nph:
-; CHECK: load double, double*
-; CHECK: load double, double*
-; CHECK: br label %bb
-
-
-bb:
- %indvar = phi i64 [ 0, %bb.nph ], [ %tmp11, %bb ]
- %scevgep = getelementptr double, double* %G, i64 %indvar
- %tmp9 = add i64 %indvar, 2
- %scevgep10 = getelementptr double, double* %G, i64 %tmp9
- %tmp11 = add i64 %indvar, 1
- %scevgep12 = getelementptr double, double* %G, i64 %tmp11
- %2 = load double, double* %scevgep12, align 8
- %3 = load double, double* %scevgep10, align 8
- %4 = fadd double %2, %3
- %5 = load double, double* %scevgep, align 8
- %6 = fadd double %4, %5
- store double %6, double* %scevgep12, align 8
- %exitcond = icmp eq i64 %tmp11, %tmp8
- br i1 %exitcond, label %return, label %bb
-
-; Should only be one load in the loop.
-; CHECK: bb:
-; CHECK: load double, double*
-; CHECK-NOT: load double, double*
-; CHECK: br i1 %exitcond
-
-return:
- ret void
-}
-
-; Test critical edge splitting.
-define i32 @test11(i32* %p, i1 %C, i32 %N) {
-; CHECK-LABEL: @test11(
-block1:
- br i1 %C, label %block2, label %block3
-
-block2:
- %cond = icmp sgt i32 %N, 1
- br i1 %cond, label %block4, label %block5
-; CHECK: load i32, i32* %p
-; CHECK-NEXT: br label %block4
-
-block3:
- store i32 0, i32* %p
- br label %block4
-
-block4:
- %PRE = load i32, i32* %p
- br label %block5
-
-block5:
- %ret = phi i32 [ 0, %block2 ], [ %PRE, %block4 ]
- ret i32 %ret
-; CHECK: block4:
-; CHECK-NEXT: phi i32
-}
-
-declare void @f()
-declare void @g(i32)
-declare i32 @__CxxFrameHandler3(...)
-
-; Test that loads aren't PRE'd into EH pads.
-define void @test12(i32* %p) personality i32 (...)* @__CxxFrameHandler3 {
-; CHECK-LABEL: @test12(
-block1:
- invoke void @f()
- to label %block2 unwind label %catch.dispatch
-
-block2:
- invoke void @f()
- to label %block3 unwind label %cleanup
-
-block3:
- ret void
-
-catch.dispatch:
- %cs1 = catchswitch within none [label %catch] unwind label %cleanup2
-
-catch:
- %c = catchpad within %cs1 []
- catchret from %c to label %block2
-
-cleanup:
- %c1 = cleanuppad within none []
- store i32 0, i32* %p
- cleanupret from %c1 unwind label %cleanup2
-
-; CHECK: cleanup2:
-; CHECK-NOT: phi
-; CHECK-NEXT: %c2 = cleanuppad within none []
-; CHECK-NEXT: %NOTPRE = load i32, i32* %p
-cleanup2:
- %c2 = cleanuppad within none []
- %NOTPRE = load i32, i32* %p
- call void @g(i32 %NOTPRE)
- cleanupret from %c2 unwind to caller
-}
Removed: llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll (original)
+++ llvm/trunk/test/Transforms/GVN/pre-no-cost-phi.ll (removed)
@@ -1,31 +0,0 @@
-; RUN: opt < %s -gvn -S | FileCheck %s
-; This testcase tests insertion of no-cost phis. That is,
-; when the value is already available in every predecessor,
-; and we just need to insert a phi node to merge the available values.
-
- at c = global i32 0, align 4
- at d = global i32 0, align 4
-
-
-define i32 @mai(i32 %foo, i32 %a, i32 %b) {
- %1 = icmp ne i32 %foo, 0
- br i1 %1, label %bb1, label %bb2
-
-bb1:
- %2 = add nsw i32 %a, %b
- store i32 %2, i32* @c, align 4
- br label %mergeblock
-
-bb2:
- %3 = add nsw i32 %a, %b
- store i32 %3, i32* @d, align 4
- br label %mergeblock
-
-mergeblock:
-; CHECK: pre-phi = phi i32 [ %3, %bb2 ], [ %2, %bb1 ]
-; CHECK-NEXT: ret i32 %.pre-phi
- %4 = add nsw i32 %a, %b
- ret i32 %4
-}
-
-
Removed: llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll (original)
+++ llvm/trunk/test/Transforms/GVN/preserve-tbaa.ll (removed)
@@ -1,31 +0,0 @@
-; RUN: opt -tbaa -basicaa -gvn -S < %s | FileCheck %s
-
-target datalayout = "e-p:64:64:64"
-
-; GVN should preserve the TBAA tag on loads when doing PRE.
-
-; CHECK-LABEL: @test(
-; CHECK: %tmp33.pre = load i16, i16* %P, align 2, !tbaa !0
-; CHECK: br label %for.body
-define void @test(i16 *%P, i16* %Q) nounwind {
-entry:
- br i1 undef, label %bb.nph, label %for.end
-
-bb.nph: ; preds = %entry
- br label %for.body
-
-for.body: ; preds = %for.body, %bb.nph
- %tmp33 = load i16, i16* %P, align 2, !tbaa !0
- store i16 %tmp33, i16* %Q
-
- store i16 0, i16* %P, align 2, !tbaa !0
- br i1 false, label %for.end, label %for.body
-
-for.end: ; preds = %for.body, %entry
- ret void
-}
-
-!0 = !{!3, !3, i64 0}
-!1 = !{!"omnipotent char", !2}
-!2 = !{!"Simple C/C++ TBAA", null}
-!3 = !{!"short", !1}
Removed: llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll (original)
+++ llvm/trunk/test/Transforms/GVN/rle-phi-translate.ll (removed)
@@ -1,146 +0,0 @@
-; RUN: opt < %s -gvn -S | FileCheck %s
-
-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 = "i386-apple-darwin7"
-
-define i32 @test1(i32* %b, i32* %c) nounwind {
-; CHECK-LABEL: @test1(
-entry:
- %g = alloca i32
- %t1 = icmp eq i32* %b, null
- br i1 %t1, label %bb, label %bb1
-
-bb:
- %t2 = load i32, i32* %c, align 4
- %t3 = add i32 %t2, 1
- store i32 %t3, i32* %g, align 4
- br label %bb2
-
-bb1: ; preds = %entry
- %t5 = load i32, i32* %b, align 4
- %t6 = add i32 %t5, 1
- store i32 %t6, i32* %g, align 4
- br label %bb2
-
-bb2: ; preds = %bb1, %bb
- %c_addr.0 = phi i32* [ %g, %bb1 ], [ %c, %bb ]
- %b_addr.0 = phi i32* [ %b, %bb1 ], [ %g, %bb ]
- %cv = load i32, i32* %c_addr.0, align 4
- %bv = load i32, i32* %b_addr.0, align 4
-; CHECK: %bv = phi i32
-; CHECK: %cv = phi i32
-; CHECK-NOT: load
-; CHECK: ret i32
- %ret = add i32 %cv, %bv
- ret i32 %ret
-}
-
-define i8 @test2(i1 %cond, i32* %b, i32* %c) nounwind {
-; CHECK-LABEL: @test2(
-entry:
- br i1 %cond, label %bb, label %bb1
-
-bb:
- %b1 = bitcast i32* %b to i8*
- store i8 4, i8* %b1
- br label %bb2
-
-bb1:
- %c1 = bitcast i32* %c to i8*
- store i8 92, i8* %c1
- br label %bb2
-
-bb2:
- %d = phi i32* [ %c, %bb1 ], [ %b, %bb ]
- %d1 = bitcast i32* %d to i8*
- %dv = load i8, i8* %d1
-; CHECK: %dv = phi i8 [ 92, %bb1 ], [ 4, %bb ]
-; CHECK-NOT: load
-; CHECK: ret i8 %dv
- ret i8 %dv
-}
-
-define i32 @test3(i1 %cond, i32* %b, i32* %c) nounwind {
-; CHECK-LABEL: @test3(
-entry:
- br i1 %cond, label %bb, label %bb1
-
-bb:
- %b1 = getelementptr i32, i32* %b, i32 17
- store i32 4, i32* %b1
- br label %bb2
-
-bb1:
- %c1 = getelementptr i32, i32* %c, i32 7
- store i32 82, i32* %c1
- br label %bb2
-
-bb2:
- %d = phi i32* [ %c, %bb1 ], [ %b, %bb ]
- %i = phi i32 [ 7, %bb1 ], [ 17, %bb ]
- %d1 = getelementptr i32, i32* %d, i32 %i
- %dv = load i32, i32* %d1
-; CHECK: %dv = phi i32 [ 82, %bb1 ], [ 4, %bb ]
-; CHECK-NOT: load
-; CHECK: ret i32 %dv
- ret i32 %dv
-}
-
-; PR5313
-define i32 @test4(i1 %cond, i32* %b, i32* %c) nounwind {
-; CHECK-LABEL: @test4(
-entry:
- br i1 %cond, label %bb, label %bb1
-
-bb:
- store i32 4, i32* %b
- br label %bb2
-
-bb1:
- %c1 = getelementptr i32, i32* %c, i32 7
- store i32 82, i32* %c1
- br label %bb2
-
-bb2:
- %d = phi i32* [ %c, %bb1 ], [ %b, %bb ]
- %i = phi i32 [ 7, %bb1 ], [ 0, %bb ]
- %d1 = getelementptr i32, i32* %d, i32 %i
- %dv = load i32, i32* %d1
-; CHECK: %dv = phi i32 [ 82, %bb1 ], [ 4, %bb ]
-; CHECK-NOT: load
-; CHECK: ret i32 %dv
- ret i32 %dv
-}
-
-
-
-; void test5(int N, double* G) {
-; for (long j = 1; j < 1000; j++)
-; G[j] = G[j] + G[j-1];
-; }
-;
-; Should compile into one load in the loop.
-define void @test5(i32 %N, double* nocapture %G) nounwind ssp {
-; CHECK-LABEL: @test5(
-bb.nph:
- br label %for.body
-
-for.body:
- %indvar = phi i64 [ 0, %bb.nph ], [ %tmp, %for.body ]
- %arrayidx6 = getelementptr double, double* %G, i64 %indvar
- %tmp = add i64 %indvar, 1
- %arrayidx = getelementptr double, double* %G, i64 %tmp
- %tmp3 = load double, double* %arrayidx
- %tmp7 = load double, double* %arrayidx6
- %add = fadd double %tmp3, %tmp7
- store double %add, double* %arrayidx
- %exitcond = icmp eq i64 %tmp, 999
- br i1 %exitcond, label %for.end, label %for.body
-; CHECK: for.body:
-; CHECK: phi double
-; CHECK: load double
-; CHECK-NOT: load double
-; CHECK: br i1
-for.end:
- ret void
-}
Removed: llvm/trunk/test/Transforms/GVN/rle-semidominated.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/rle-semidominated.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/rle-semidominated.ll (original)
+++ llvm/trunk/test/Transforms/GVN/rle-semidominated.ll (removed)
@@ -1,36 +0,0 @@
-; RUN: opt < %s -basicaa -gvn -S | FileCheck %s
-
-define i32 @main(i32* %p, i32 %x, i32 %y) {
-block1:
- %z = load i32, i32* %p
- %cmp = icmp eq i32 %x, %y
- br i1 %cmp, label %block2, label %block3
-
-block2:
- br label %block4
-
-block3:
- %b = bitcast i32 0 to i32
- store i32 %b, i32* %p
- br label %block4
-
-block4:
- %DEAD = load i32, i32* %p
- ret i32 %DEAD
-}
-
-; CHECK: define i32 @main(i32* %p, i32 %x, i32 %y) {
-; CHECK-NEXT: block1:
-; CHECK-NOT: %z = load i32, i32* %p
-; CHECK-NEXT: %cmp = icmp eq i32 %x, %y
-; CHECK-NEXT: br i1 %cmp, label %block2, label %block3
-; CHECK: block2:
-; CHECK-NEXT: %DEAD.pre = load i32, i32* %p
-; CHECK-NEXT: br label %block4
-; CHECK: block3:
-; CHECK-NEXT: store i32 0, i32* %p
-; CHECK-NEXT: br label %block4
-; CHECK: block4:
-; CHECK-NEXT: %DEAD = phi i32 [ 0, %block3 ], [ %DEAD.pre, %block2 ]
-; CHECK-NEXT: ret i32 %DEAD
-; CHECK-NEXT: }
Removed: llvm/trunk/test/Transforms/GVN/rle.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/rle.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/rle.ll (original)
+++ llvm/trunk/test/Transforms/GVN/rle.ll (removed)
@@ -1,702 +0,0 @@
-; RUN: opt < %s -default-data-layout="e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-n8:16:32" -basicaa -gvn -S -die | FileCheck %s
-; RUN: opt < %s -default-data-layout="E-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:64:64-n32" -basicaa -gvn -S -die | FileCheck %s
-
-;; Trivial RLE test.
-define i32 @test0(i32 %V, i32* %P) {
- store i32 %V, i32* %P
-
- %A = load i32, i32* %P
- ret i32 %A
-; CHECK-LABEL: @test0(
-; CHECK: ret i32 %V
-}
-
-
-;;===----------------------------------------------------------------------===;;
-;; Tests for crashers
-;;===----------------------------------------------------------------------===;;
-
-;; PR5016
-define i8 @crash0({i32, i32} %A, {i32, i32}* %P) {
- store {i32, i32} %A, {i32, i32}* %P
- %X = bitcast {i32, i32}* %P to i8*
- %Y = load i8, i8* %X
- ret i8 %Y
-}
-
-;; No PR filed, crashed in CaptureTracker.
-declare void @helper()
-define void @crash1() {
- tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* undef, i64 undef, i32 1, i1 false) nounwind
- %tmp = load i8, i8* bitcast (void ()* @helper to i8*)
- %x = icmp eq i8 %tmp, 15
- ret void
-}
-
-
-;;===----------------------------------------------------------------------===;;
-;; Store -> Load and Load -> Load forwarding where src and dst are different
-;; types, but where the base pointer is a must alias.
-;;===----------------------------------------------------------------------===;;
-
-;; i32 -> f32 forwarding.
-define float @coerce_mustalias1(i32 %V, i32* %P) {
- store i32 %V, i32* %P
-
- %P2 = bitcast i32* %P to float*
-
- %A = load float, float* %P2
- ret float %A
-; CHECK-LABEL: @coerce_mustalias1(
-; CHECK-NOT: load
-; CHECK: ret float
-}
-
-;; i32* -> float forwarding.
-define float @coerce_mustalias2(i32* %V, i32** %P) {
- store i32* %V, i32** %P
-
- %P2 = bitcast i32** %P to float*
-
- %A = load float, float* %P2
- ret float %A
-; CHECK-LABEL: @coerce_mustalias2(
-; CHECK-NOT: load
-; CHECK: ret float
-}
-
-;; float -> i32* forwarding.
-define i32* @coerce_mustalias3(float %V, float* %P) {
- store float %V, float* %P
-
- %P2 = bitcast float* %P to i32**
-
- %A = load i32*, i32** %P2
- ret i32* %A
-; CHECK-LABEL: @coerce_mustalias3(
-; CHECK-NOT: load
-; CHECK: ret i32*
-}
-
-;; i32 -> f32 load forwarding.
-define float @coerce_mustalias4(i32* %P, i1 %cond) {
- %A = load i32, i32* %P
-
- %P2 = bitcast i32* %P to float*
- %B = load float, float* %P2
- br i1 %cond, label %T, label %F
-T:
- ret float %B
-
-F:
- %X = bitcast i32 %A to float
- ret float %X
-
-; CHECK-LABEL: @coerce_mustalias4(
-; CHECK: %A = load i32, i32* %P
-; CHECK-NOT: load
-; CHECK: ret float
-; CHECK: F:
-}
-
-;; i32 -> i8 forwarding
-define i8 @coerce_mustalias5(i32 %V, i32* %P) {
- store i32 %V, i32* %P
-
- %P2 = bitcast i32* %P to i8*
-
- %A = load i8, i8* %P2
- ret i8 %A
-; CHECK-LABEL: @coerce_mustalias5(
-; CHECK-NOT: load
-; CHECK: ret i8
-}
-
-;; i64 -> float forwarding
-define float @coerce_mustalias6(i64 %V, i64* %P) {
- store i64 %V, i64* %P
-
- %P2 = bitcast i64* %P to float*
-
- %A = load float, float* %P2
- ret float %A
-; CHECK-LABEL: @coerce_mustalias6(
-; CHECK-NOT: load
-; CHECK: ret float
-}
-
-;; i64 -> i8* (32-bit) forwarding
-define i8* @coerce_mustalias7(i64 %V, i64* %P) {
- store i64 %V, i64* %P
-
- %P2 = bitcast i64* %P to i8**
-
- %A = load i8*, i8** %P2
- ret i8* %A
-; CHECK-LABEL: @coerce_mustalias7(
-; CHECK-NOT: load
-; CHECK: ret i8*
-}
-
-; memset -> i16 forwarding.
-define signext i16 @memset_to_i16_local(i16* %A) nounwind ssp {
-entry:
- %conv = bitcast i16* %A to i8*
- tail call void @llvm.memset.p0i8.i64(i8* %conv, i8 1, i64 200, i32 1, i1 false)
- %arrayidx = getelementptr inbounds i16, i16* %A, i64 42
- %tmp2 = load i16, i16* %arrayidx
- ret i16 %tmp2
-; CHECK-LABEL: @memset_to_i16_local(
-; CHECK-NOT: load
-; CHECK: ret i16 257
-}
-
-; memset -> float forwarding.
-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.p0i8.i64(i8* %conv, i8 %Val, i64 400, i32 1, i1 false)
- %arrayidx = getelementptr inbounds float, float* %A, i64 42 ; <float*> [#uses=1]
- %tmp2 = load float, float* %arrayidx ; <float> [#uses=1]
- ret float %tmp2
-; CHECK-LABEL: @memset_to_float_local(
-; CHECK-NOT: load
-; CHECK: zext
-; CHECK-NEXT: shl
-; CHECK-NEXT: or
-; CHECK-NEXT: shl
-; CHECK-NEXT: or
-; CHECK-NEXT: bitcast
-; CHECK-NEXT: ret float
-}
-
-;; non-local memset -> i16 load forwarding.
-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.p0i8.i64(i8* %P3, i8 1, i64 400, i32 1, i1 false)
- br label %Cont
-
-F:
- tail call void @llvm.memset.p0i8.i64(i8* %P3, i8 2, i64 400, i32 1, i1 false)
- br label %Cont
-
-Cont:
- %P2 = getelementptr i16, i16* %P, i32 4
- %A = load i16, i16* %P2
- ret i16 %A
-
-; CHECK-LABEL: @memset_to_i16_nonlocal0(
-; CHECK: Cont:
-; CHECK-NEXT: %A = phi i16 [ 514, %F ], [ 257, %T ]
-; CHECK-NOT: load
-; CHECK: ret i16 %A
-}
-
- at GCst = constant {i32, float, i32 } { i32 42, float 14., i32 97 }
- at GCst_as1 = addrspace(1) constant {i32, float, i32 } { i32 42, float 14., i32 97 }
-
-; memset -> float forwarding.
-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.p0i8.p0i8.i64(i8* %conv, i8* bitcast ({i32, float, i32 }* @GCst to i8*), i64 12, i32 1, i1 false)
- %arrayidx = getelementptr inbounds float, float* %A, i64 1 ; <float*> [#uses=1]
- %tmp2 = load float, float* %arrayidx ; <float> [#uses=1]
- ret float %tmp2
-; CHECK-LABEL: @memcpy_to_float_local(
-; CHECK-NOT: load
-; CHECK: ret float 1.400000e+01
-}
-
-; memcpy from address space 1
-define float @memcpy_to_float_local_as1(float* %A) nounwind ssp {
-entry:
- %conv = bitcast float* %A to i8* ; <i8*> [#uses=1]
- tail call void @llvm.memcpy.p0i8.p1i8.i64(i8* %conv, i8 addrspace(1)* bitcast ({i32, float, i32 } addrspace(1)* @GCst_as1 to i8 addrspace(1)*), i64 12, i32 1, i1 false)
- %arrayidx = getelementptr inbounds float, float* %A, i64 1 ; <float*> [#uses=1]
- %tmp2 = load float, float* %arrayidx ; <float> [#uses=1]
- ret float %tmp2
-; CHECK-LABEL: @memcpy_to_float_local_as1(
-; CHECK-NOT: load
-; CHECK: ret float 1.400000e+01
-}
-
-;; non-local i32/float -> i8 load forwarding.
-define i8 @coerce_mustalias_nonlocal0(i32* %P, i1 %cond) {
- %P2 = bitcast i32* %P to float*
- %P3 = bitcast i32* %P to i8*
- br i1 %cond, label %T, label %F
-T:
- store i32 42, i32* %P
- br label %Cont
-
-F:
- store float 1.0, float* %P2
- br label %Cont
-
-Cont:
- %A = load i8, i8* %P3
- ret i8 %A
-
-; CHECK-LABEL: @coerce_mustalias_nonlocal0(
-; CHECK: Cont:
-; CHECK: %A = phi i8 [
-; CHECK-NOT: load
-; CHECK: ret i8 %A
-}
-
-
-;; non-local i32/float -> i8 load forwarding. This also tests that the "P3"
-;; bitcast equivalence can be properly phi translated.
-define i8 @coerce_mustalias_nonlocal1(i32* %P, i1 %cond) {
- %P2 = bitcast i32* %P to float*
- br i1 %cond, label %T, label %F
-T:
- store i32 42, i32* %P
- br label %Cont
-
-F:
- store float 1.0, float* %P2
- br label %Cont
-
-Cont:
- %P3 = bitcast i32* %P to i8*
- %A = load i8, i8* %P3
- ret i8 %A
-
-; CHECK-LABEL: @coerce_mustalias_nonlocal1(
-; CHECK: Cont:
-; CHECK: %A = phi i8 [
-; CHECK-NOT: load
-; CHECK: ret i8 %A
-}
-
-
-;; non-local i32 -> i8 partial redundancy load forwarding.
-define i8 @coerce_mustalias_pre0(i32* %P, i1 %cond) {
- %P3 = bitcast i32* %P to i8*
- br i1 %cond, label %T, label %F
-T:
- store i32 42, i32* %P
- br label %Cont
-
-F:
- br label %Cont
-
-Cont:
- %A = load i8, i8* %P3
- ret i8 %A
-
-; CHECK-LABEL: @coerce_mustalias_pre0(
-; CHECK: F:
-; CHECK: load i8, i8* %P3
-; CHECK: Cont:
-; CHECK: %A = phi i8 [
-; CHECK-NOT: load
-; CHECK: ret i8 %A
-}
-
-;;===----------------------------------------------------------------------===;;
-;; Store -> Load and Load -> Load forwarding where src and dst are different
-;; types, and the reload is an offset from the store pointer.
-;;===----------------------------------------------------------------------===;;
-
-;; i32 -> i8 forwarding.
-;; PR4216
-define i8 @coerce_offset0(i32 %V, i32* %P) {
- store i32 %V, i32* %P
-
- %P2 = bitcast i32* %P to i8*
- %P3 = getelementptr i8, i8* %P2, i32 2
-
- %A = load i8, i8* %P3
- ret i8 %A
-; CHECK-LABEL: @coerce_offset0(
-; CHECK-NOT: load
-; CHECK: ret i8
-}
-
-define i8 @coerce_offset0_addrspacecast(i32 %V, i32* %P) {
- store i32 %V, i32* %P
-
- %P2 = addrspacecast i32* %P to i8 addrspace(1)*
- %P3 = getelementptr i8, i8 addrspace(1)* %P2, i32 2
-
- %A = load i8, i8 addrspace(1)* %P3
- ret i8 %A
-; CHECK-LABEL: @coerce_offset0_addrspacecast(
-; CHECK-NOT: load
-; CHECK: ret i8
-}
-
-;; non-local i32/float -> i8 load forwarding.
-define i8 @coerce_offset_nonlocal0(i32* %P, i1 %cond) {
- %P2 = bitcast i32* %P to float*
- %P3 = bitcast i32* %P to i8*
- %P4 = getelementptr i8, i8* %P3, i32 2
- br i1 %cond, label %T, label %F
-T:
- store i32 57005, i32* %P
- br label %Cont
-
-F:
- store float 1.0, float* %P2
- br label %Cont
-
-Cont:
- %A = load i8, i8* %P4
- ret i8 %A
-
-; CHECK-LABEL: @coerce_offset_nonlocal0(
-; CHECK: Cont:
-; CHECK: %A = phi i8 [
-; CHECK-NOT: load
-; CHECK: ret i8 %A
-}
-
-
-;; non-local i32 -> i8 partial redundancy load forwarding.
-define i8 @coerce_offset_pre0(i32* %P, i1 %cond) {
- %P3 = bitcast i32* %P to i8*
- %P4 = getelementptr i8, i8* %P3, i32 2
- br i1 %cond, label %T, label %F
-T:
- store i32 42, i32* %P
- br label %Cont
-
-F:
- br label %Cont
-
-Cont:
- %A = load i8, i8* %P4
- ret i8 %A
-
-; CHECK-LABEL: @coerce_offset_pre0(
-; CHECK: F:
-; CHECK: load i8, i8* %P4
-; CHECK: Cont:
-; CHECK: %A = phi i8 [
-; CHECK-NOT: load
-; CHECK: ret i8 %A
-}
-
-define i32 @chained_load(i32** %p, i32 %x, i32 %y) {
-block1:
- %A = alloca i32*
-
- %z = load i32*, i32** %p
- store i32* %z, i32** %A
- %cmp = icmp eq i32 %x, %y
- br i1 %cmp, label %block2, label %block3
-
-block2:
- %a = load i32*, i32** %p
- br label %block4
-
-block3:
- %b = load i32*, i32** %p
- br label %block4
-
-block4:
- %c = load i32*, i32** %p
- %d = load i32, i32* %c
- ret i32 %d
-
-; CHECK-LABEL: @chained_load(
-; CHECK: %z = load i32*, i32** %p
-; CHECK-NOT: load
-; CHECK: %d = load i32, i32* %z
-; CHECK-NEXT: ret i32 %d
-}
-
-
-declare i1 @cond() readonly
-declare i1 @cond2() readonly
-
-define i32 @phi_trans2() {
-; CHECK-LABEL: @phi_trans2(
-entry:
- %P = alloca i32, i32 400
- br label %F1
-
-F1:
- %A = phi i32 [1, %entry], [2, %F]
- %cond2 = call i1 @cond()
- br i1 %cond2, label %T1, label %TY
-
-T1:
- %P2 = getelementptr i32, i32* %P, i32 %A
- %x = load i32, i32* %P2
- %cond = call i1 @cond2()
- br i1 %cond, label %TX, label %F
-
-F:
- %P3 = getelementptr i32, i32* %P, i32 2
- store i32 17, i32* %P3
-
- store i32 42, i32* %P2 ; Provides "P[A]".
- br label %F1
-
-TX:
- ; This load should not be compiled to 'ret i32 42'. An overly clever
- ; implementation of GVN would see that we're returning 17 if the loop
- ; executes once or 42 if it executes more than that, but we'd have to do
- ; loop restructuring to expose this, and GVN shouldn't do this sort of CFG
- ; transformation.
-
-; CHECK: TX:
-; CHECK: ret i32 %x
- ret i32 %x
-TY:
- ret i32 0
-}
-
-define i32 @phi_trans3(i32* %p, i32 %x, i32 %y, i32 %z) {
-; CHECK-LABEL: @phi_trans3(
-block1:
- %cmpxy = icmp eq i32 %x, %y
- br i1 %cmpxy, label %block2, label %block3
-
-block2:
- store i32 87, i32* %p
- br label %block4
-
-block3:
- %p2 = getelementptr i32, i32* %p, i32 43
- store i32 97, i32* %p2
- br label %block4
-
-block4:
- %A = phi i32 [-1, %block2], [42, %block3]
- br i1 %cmpxy, label %block5, label %exit
-
-; CHECK: block4:
-; CHECK-NEXT: %D = phi i32 [ 87, %block2 ], [ 97, %block3 ]
-; CHECK-NOT: load
-
-block5:
- %B = add i32 %A, 1
- br i1 %cmpxy, label %block6, label %exit
-
-block6:
- %C = getelementptr i32, i32* %p, i32 %B
- br i1 %cmpxy, label %block7, label %exit
-
-block7:
- %D = load i32, i32* %C
- ret i32 %D
-
-; CHECK: block7:
-; CHECK-NEXT: ret i32 %D
-
-exit:
- ret i32 -1
-}
-
-define i8 @phi_trans4(i8* %p) {
-; CHECK-LABEL: @phi_trans4(
-entry:
- %X3 = getelementptr i8, i8* %p, i32 192
- store i8 192, i8* %X3
-
- %X = getelementptr i8, i8* %p, i32 4
- %Y = load i8, i8* %X
- br label %loop
-
-loop:
- %i = phi i32 [4, %entry], [192, %loop]
- %X2 = getelementptr i8, i8* %p, i32 %i
- %Y2 = load i8, i8* %X2
-
-; CHECK: loop:
-; CHECK-NEXT: %Y2 = phi i8 [ %Y, %entry ], [ 0, %loop ]
-; CHECK-NOT: load i8
-
- %cond = call i1 @cond2()
-
- %Z = bitcast i8 *%X3 to i32*
- store i32 0, i32* %Z
- br i1 %cond, label %loop, label %out
-
-out:
- %R = add i8 %Y, %Y2
- ret i8 %R
-}
-
-define i8 @phi_trans5(i8* %p) {
-; CHECK-LABEL: @phi_trans5(
-entry:
-
- %X4 = getelementptr i8, i8* %p, i32 2
- store i8 19, i8* %X4
-
- %X = getelementptr i8, i8* %p, i32 4
- %Y = load i8, i8* %X
- br label %loop
-
-loop:
- %i = phi i32 [4, %entry], [3, %cont]
- %X2 = getelementptr i8, i8* %p, i32 %i
- %Y2 = load i8, i8* %X2 ; Ensure this load is not being incorrectly replaced.
- %cond = call i1 @cond2()
- br i1 %cond, label %cont, label %out
-
-cont:
- %Z = getelementptr i8, i8* %X2, i32 -1
- %Z2 = bitcast i8 *%Z to i32*
- store i32 50462976, i32* %Z2 ;; (1 << 8) | (2 << 16) | (3 << 24)
-
-
-; CHECK: store i32
-; CHECK-NEXT: getelementptr i8, i8* %p, i32 3
-; CHECK-NEXT: load i8, i8*
- br label %loop
-
-out:
- %R = add i8 %Y, %Y2
- ret i8 %R
-}
-
-
-; PR6642
-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.p0i8.i64(i8* %tmp, i8 0, i64 1024, i32 4, i1 false)
- %arraydecay = getelementptr inbounds [256 x i32], [256 x i32]* %x, i32 0, i32 0 ; <i32*>
- %tmp1 = load i32, i32* %arraydecay ; <i32> [#uses=1]
- ret i32 %tmp1
-; CHECK-LABEL: @memset_to_load(
-; CHECK: ret i32 0
-}
-
-
-;;===----------------------------------------------------------------------===;;
-;; Load -> Load forwarding in partial alias case.
-;;===----------------------------------------------------------------------===;;
-
-define i32 @load_load_partial_alias(i8* %P) nounwind ssp {
-entry:
- %0 = bitcast i8* %P to i32*
- %tmp2 = load i32, i32* %0
- %add.ptr = getelementptr inbounds i8, i8* %P, i64 1
- %tmp5 = load i8, i8* %add.ptr
- %conv = zext i8 %tmp5 to i32
- %add = add nsw i32 %tmp2, %conv
- ret i32 %add
-
-; TEMPORARILYDISABLED-LABEL: @load_load_partial_alias(
-; TEMPORARILYDISABLED: load i32, i32*
-; TEMPORARILYDISABLED-NOT: load
-; TEMPORARILYDISABLED: lshr i32 {{.*}}, 8
-; TEMPORARILYDISABLED-NOT: load
-; TEMPORARILYDISABLED: trunc i32 {{.*}} to i8
-; TEMPORARILYDISABLED-NOT: load
-; TEMPORARILYDISABLED: ret i32
-}
-
-
-; Cross block partial alias case.
-define i32 @load_load_partial_alias_cross_block(i8* %P) nounwind ssp {
-entry:
- %xx = bitcast i8* %P to i32*
- %x1 = load i32, i32* %xx, align 4
- %cmp = icmp eq i32 %x1, 127
- br i1 %cmp, label %land.lhs.true, label %if.end
-
-land.lhs.true: ; preds = %entry
- %arrayidx4 = getelementptr inbounds i8, i8* %P, i64 1
- %tmp5 = load i8, i8* %arrayidx4, align 1
- %conv6 = zext i8 %tmp5 to i32
- ret i32 %conv6
-
-if.end:
- ret i32 52
-; TEMPORARILY_DISABLED-LABEL: @load_load_partial_alias_cross_block(
-; TEMPORARILY_DISABLED: land.lhs.true:
-; TEMPORARILY_DISABLED-NOT: load i8
-; TEMPORARILY_DISABLED: ret i32 %conv6
-}
-
-
-;;===----------------------------------------------------------------------===;;
-;; Load Widening
-;;===----------------------------------------------------------------------===;;
-
-%widening1 = type { i32, i8, i8, i8, i8 }
-
- at f = global %widening1 zeroinitializer, align 4
-
-define i32 @test_widening1(i8* %P) nounwind ssp noredzone {
-entry:
- %tmp = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 1), align 4
- %conv = zext i8 %tmp to i32
- %tmp1 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 2), align 1
- %conv2 = zext i8 %tmp1 to i32
- %add = add nsw i32 %conv, %conv2
- ret i32 %add
-; CHECK-LABEL: @test_widening1(
-; CHECK-NOT: load
-; CHECK: load i16, i16*
-; CHECK-NOT: load
-; CHECK: ret i32
-}
-
-define i32 @test_widening2() nounwind ssp noredzone {
-entry:
- %tmp = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 1), align 4
- %conv = zext i8 %tmp to i32
- %tmp1 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 2), align 1
- %conv2 = zext i8 %tmp1 to i32
- %add = add nsw i32 %conv, %conv2
-
- %tmp2 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 3), align 2
- %conv3 = zext i8 %tmp2 to i32
- %add2 = add nsw i32 %add, %conv3
-
- %tmp3 = load i8, i8* getelementptr inbounds (%widening1, %widening1* @f, i64 0, i32 4), align 1
- %conv4 = zext i8 %tmp3 to i32
- %add3 = add nsw i32 %add2, %conv3
-
- ret i32 %add3
-; CHECK-LABEL: @test_widening2(
-; CHECK-NOT: load
-; CHECK: load i32, i32*
-; CHECK-NOT: load
-; 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
-declare void @llvm.memcpy.p0i8.p1i8.i64(i8* nocapture, i8 addrspace(1)* nocapture, i64, i32, i1) nounwind
-
-
-;;===----------------------------------------------------------------------===;;
-;; Load -> Store dependency which isn't interfered with by a call that happens
-;; before the pointer was captured.
-;;===----------------------------------------------------------------------===;;
-
-%class.X = type { [8 x i8] }
-
- at _ZTV1X = weak_odr constant [5 x i8*] zeroinitializer
- at _ZTV1Y = weak_odr constant [5 x i8*] zeroinitializer
-
-declare void @use()
-declare void @use3(i8***, i8**)
-
-; PR8908
-define void @test_escape1() nounwind {
- %x = alloca i8**, align 8
- store i8** getelementptr inbounds ([5 x i8*], [5 x i8*]* @_ZTV1X, i64 0, i64 2), i8*** %x, align 8
- call void @use() nounwind
- %DEAD = load i8**, i8*** %x, align 8
- call void @use3(i8*** %x, i8** %DEAD) nounwind
- ret void
-; CHECK: test_escape1
-; CHECK-NOT: DEAD
-; CHECK: ret
-}
Removed: llvm/trunk/test/Transforms/GVN/volatile.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/GVN/volatile.ll?rev=275740&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/GVN/volatile.ll (original)
+++ llvm/trunk/test/Transforms/GVN/volatile.ll (removed)
@@ -1,167 +0,0 @@
-; Tests that check our handling of volatile instructions encountered
-; when scanning for dependencies
-; RUN: opt -basicaa -gvn -S < %s | FileCheck %s
-
-; Check that we can bypass a volatile load when searching
-; for dependencies of a non-volatile load
-define i32 @test1(i32* nocapture %p, i32* nocapture %q) {
-; CHECK-LABEL: test1
-; CHECK: %0 = load volatile i32, i32* %q
-; CHECK-NEXT: ret i32 0
-entry:
- %x = load i32, i32* %p
- load volatile i32, i32* %q
- %y = load i32, i32* %p
- %add = sub i32 %y, %x
- ret i32 %add
-}
-
-; We can not value forward if the query instruction is
-; volatile, this would be (in effect) removing the volatile load
-define i32 @test2(i32* nocapture %p, i32* nocapture %q) {
-; CHECK-LABEL: test2
-; CHECK: %x = load i32, i32* %p
-; CHECK-NEXT: %y = load volatile i32, i32* %p
-; CHECK-NEXT: %add = sub i32 %y, %x
-entry:
- %x = load i32, i32* %p
- %y = load volatile i32, i32* %p
- %add = sub i32 %y, %x
- ret i32 %add
-}
-
-; If the query instruction is itself volatile, we *cannot*
-; reorder it even if p and q are noalias
-define i32 @test3(i32* noalias nocapture %p, i32* noalias nocapture %q) {
-; CHECK-LABEL: test3
-; CHECK: %x = load i32, i32* %p
-; CHECK-NEXT: %0 = load volatile i32, i32* %q
-; CHECK-NEXT: %y = load volatile i32, i32* %p
-entry:
- %x = load i32, i32* %p
- load volatile i32, i32* %q
- %y = load volatile i32, i32* %p
- %add = sub i32 %y, %x
- ret i32 %add
-}
-
-; If an encountered instruction is both volatile and ordered,
-; we need to use the strictest ordering of either. In this
-; case, the ordering prevents forwarding.
-define i32 @test4(i32* noalias nocapture %p, i32* noalias nocapture %q) {
-; CHECK-LABEL: test4
-; CHECK: %x = load i32, i32* %p
-; CHECK-NEXT: %0 = load atomic volatile i32, i32* %q seq_cst
-; CHECK-NEXT: %y = load atomic i32, i32* %p seq_cst
-entry:
- %x = load i32, i32* %p
- load atomic volatile i32, i32* %q seq_cst, align 4
- %y = load atomic i32, i32* %p seq_cst, align 4
- %add = sub i32 %y, %x
- ret i32 %add
-}
-
-; Value forwarding from a volatile load is perfectly legal
-define i32 @test5(i32* nocapture %p, i32* nocapture %q) {
-; CHECK-LABEL: test5
-; CHECK: %x = load volatile i32, i32* %p
-; CHECK-NEXT: ret i32 0
-entry:
- %x = load volatile i32, i32* %p
- %y = load i32, i32* %p
- %add = sub i32 %y, %x
- ret i32 %add
-}
-
-; Does cross block redundancy elimination work with volatiles?
-define i32 @test6(i32* noalias nocapture %p, i32* noalias nocapture %q) {
-; CHECK-LABEL: test6
-; CHECK: %y1 = load i32, i32* %p
-; CHECK-LABEL: header
-; CHECK: %x = load volatile i32, i32* %q
-; CHECK-NEXT: %add = sub i32 %y1, %x
-entry:
- %y1 = load i32, i32* %p
- call void @use(i32 %y1)
- br label %header
-header:
- %x = load volatile i32, i32* %q
- %y = load i32, i32* %p
- %add = sub i32 %y, %x
- %cnd = icmp eq i32 %add, 0
- br i1 %cnd, label %exit, label %header
-exit:
- ret i32 %add
-}
-
-; Does cross block PRE work with volatiles?
-define i32 @test7(i1 %c, i32* noalias nocapture %p, i32* noalias nocapture %q) {
-; CHECK-LABEL: test7
-; CHECK-LABEL: entry.header_crit_edge:
-; CHECK: %y.pre = load i32, i32* %p
-; CHECK-LABEL: skip:
-; CHECK: %y1 = load i32, i32* %p
-; CHECK-LABEL: header:
-; CHECK: %y = phi i32
-; CHECK-NEXT: %x = load volatile i32, i32* %q
-; CHECK-NEXT: %add = sub i32 %y, %x
-entry:
- br i1 %c, label %header, label %skip
-skip:
- %y1 = load i32, i32* %p
- call void @use(i32 %y1)
- br label %header
-header:
- %x = load volatile i32, i32* %q
- %y = load i32, i32* %p
- %add = sub i32 %y, %x
- %cnd = icmp eq i32 %add, 0
- br i1 %cnd, label %exit, label %header
-exit:
- ret i32 %add
-}
-
-; Another volatile PRE case - two paths through a loop
-; load in preheader, one path read only, one not
-define i32 @test8(i1 %b, i1 %c, i32* noalias %p, i32* noalias %q) {
-; CHECK-LABEL: test8
-; CHECK-LABEL: entry
-; CHECK: %y1 = load i32, i32* %p
-; CHECK-LABEL: header:
-; CHECK: %y = phi i32
-; CHECK-NEXT: %x = load volatile i32, i32* %q
-; CHECK-NOT: load
-; CHECK-LABEL: skip.header_crit_edge:
-; CHECK: %y.pre = load i32, i32* %p
-entry:
- %y1 = load i32, i32* %p
- call void @use(i32 %y1)
- br label %header
-header:
- %x = load volatile i32, i32* %q
- %y = load i32, i32* %p
- call void @use(i32 %y)
- br i1 %b, label %skip, label %header
-skip:
- ; escaping the arguments is explicitly required since we marked
- ; them noalias
- call void @clobber(i32* %p, i32* %q)
- br i1 %c, label %header, label %exit
-exit:
- %add = sub i32 %y, %x
- ret i32 %add
-}
-
-define i32 @test9(i32* %V) {
-entry:
- %load = load volatile i32, i32* %V, !range !0
- ret i32 %load
-}
-; CHECK-LABEL: test9
-; CHECK: load volatile
-; CHECK: ret i32 0
-
-declare void @use(i32) readonly
-declare void @clobber(i32* %p, i32* %q)
-
-!0 = !{ i32 0, i32 1 }
More information about the llvm-commits
mailing list