diff options
author | Philip Reames <listmail@philipreames.com> | 2018-08-21 00:55:35 +0000 |
---|---|---|
committer | Philip Reames <listmail@philipreames.com> | 2018-08-21 00:55:35 +0000 |
commit | a5a8546ac6ada30b59d3237d77fa74dc496f344c (patch) | |
tree | 8c280a82427eeb0caa35c4811ec447a3ff718dec /llvm/test | |
parent | 578c64da0c41b2f6186f69036aa0ed7f4ad2b70e (diff) | |
download | bcm5719-llvm-a5a8546ac6ada30b59d3237d77fa74dc496f344c.tar.gz bcm5719-llvm-a5a8546ac6ada30b59d3237d77fa74dc496f344c.zip |
[AST] Mark invariant.starts as being readonly
These intrinsics are modelled as writing for control flow purposes, but they don't actually write to any location. Marking these - as we did for guards - allows LICM to hoist loads out of loops containing invariant.starts.
Differential Revision: https://reviews.llvm.org/D50861
llvm-svn: 340245
Diffstat (limited to 'llvm/test')
-rw-r--r-- | llvm/test/Transforms/LICM/invariant.start.ll | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/test/Transforms/LICM/invariant.start.ll b/llvm/test/Transforms/LICM/invariant.start.ll index 3ac6793d185..9049e54ab85 100644 --- a/llvm/test/Transforms/LICM/invariant.start.ll +++ b/llvm/test/Transforms/LICM/invariant.start.ll @@ -7,9 +7,9 @@ define void @test1(i1 %cond, i32* %ptr) { ; CHECK-LABEL: @test1( ; CHECK-LABEL: entry: +; CHECK: %val = load i32, i32* %ptr ; CHECK-LABEL: loop: ; CHECK: call {}* @llvm.invariant.start.p0i32(i64 4, i32* %ptr) -; CHECK: %val = load i32, i32* %ptr ; ALIAS-N2-LABEL: @test1( ; ALIAS-N2-LABEL: entry: @@ -28,14 +28,14 @@ loop: br label %loop } -;; TODO: By default, despite the loop varying invariant.start, we should be +;; despite the loop varying invariant.start, we should be ;; able to hoist the load define void @test2(i1 %cond, i32* %ptr) { ; CHECK-LABEL: @test2( ; CHECK-LABEL: entry: +; CHECK: %val = load i32, i32* %ptr ; CHECK-LABEL: loop: ; CHECK: call {}* @llvm.invariant.start.p0i32(i64 4, i32* %piv) -; CHECK: %val = load i32, i32* %ptr ; ALIAS-N2-LABEL: @test2( ; ALIAS-N2-LABEL: entry: @@ -54,13 +54,12 @@ loop: br label %loop } -; By default, should be able to hoist since store doesn't alias define void @test3(i1 %cond, i32* %ptr) { ; CHECK-LABEL: @test3( ; CHECK-LABEL: entry: +; CHECK: %val = load i32, i32* %ptr ; CHECK-LABEL: loop: ; CHECK: call {}* @llvm.invariant.start.p0i32(i64 4, i32* %ptr) -; CHECK: %val = load i32, i32* %ptr ; ALIAS-N2-LABEL: @test3( ; ALIAS-N2-LABEL: entry: |