summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine
diff options
context:
space:
mode:
authorArtur Pilipenko <apilipenko@azulsystems.com>2015-06-25 12:18:43 +0000
committerArtur Pilipenko <apilipenko@azulsystems.com>2015-06-25 12:18:43 +0000
commit0e21d54b516681edaed00ea7bd15dd0d1ee8bd4a (patch)
tree4ef472593011dd6990df4d545183b94694cde12c /llvm/test/Transforms/InstCombine
parent35a24ded0ae76ce3c2575b69a26461598465d74f (diff)
downloadbcm5719-llvm-0e21d54b516681edaed00ea7bd15dd0d1ee8bd4a.tar.gz
bcm5719-llvm-0e21d54b516681edaed00ea7bd15dd0d1ee8bd4a.zip
Take alignment into account in isSafeToLoadUnconditionally
Reviewed By: hfinkel Differential Revision: http://reviews.llvm.org/D10475 llvm-svn: 240636
Diffstat (limited to 'llvm/test/Transforms/InstCombine')
-rw-r--r--llvm/test/Transforms/InstCombine/select.ll17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/select.ll b/llvm/test/Transforms/InstCombine/select.ll
index 8be247228b8..fdf1199a66f 100644
--- a/llvm/test/Transforms/InstCombine/select.ll
+++ b/llvm/test/Transforms/InstCombine/select.ll
@@ -1296,6 +1296,23 @@ entry:
ret i32 %v
}
+define i32 @test78_neg(i1 %flag, i32* %x, i32* %y, i32* %z) {
+; The same as @test78 but we can't speculate the load because it can trap
+; if under-aligned.
+; CHECK-LABEL: @test78_neg(
+; CHECK: %p = select i1 %flag, i32* %x, i32* %y
+; CHECK-NEXT: %v = load i32, i32* %p, align 16
+; CHECK-NEXT: ret i32 %v
+entry:
+ store i32 0, i32* %x
+ store i32 0, i32* %y
+ ; Block forwarding by storing to %z which could alias either %x or %y.
+ store i32 42, i32* %z
+ %p = select i1 %flag, i32* %x, i32* %y
+ %v = load i32, i32* %p, align 16
+ ret i32 %v
+}
+
define float @test79(i1 %flag, float* %x, i32* %y, i32* %z) {
; Test that we can speculate the loads around the select even when we can't
; fold the load completely away.
OpenPOWER on IntegriCloud