summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/Reassociate/optional-flags.ll
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2014-11-18 20:34:01 +0000
committerChad Rosier <mcrosier@codeaurora.org>2014-11-18 20:34:01 +0000
commitb83c6d9c08b86947094891a81237a6db965d243d (patch)
tree36e861ed39072e842b93e7f32c167926040d3a9a /llvm/test/Transforms/Reassociate/optional-flags.ll
parentefa74e0280b28916b101d4e332b90b472d73172e (diff)
downloadbcm5719-llvm-b83c6d9c08b86947094891a81237a6db965d243d.tar.gz
bcm5719-llvm-b83c6d9c08b86947094891a81237a6db965d243d.zip
[Reassociate] Use test cases that can actually be optimized to verify optional
flags are cleared. The reassociation pass was just reordering the leaf nodes in the previous test cases. llvm-svn: 222250
Diffstat (limited to 'llvm/test/Transforms/Reassociate/optional-flags.ll')
-rw-r--r--llvm/test/Transforms/Reassociate/optional-flags.ll23
1 files changed, 12 insertions, 11 deletions
diff --git a/llvm/test/Transforms/Reassociate/optional-flags.ll b/llvm/test/Transforms/Reassociate/optional-flags.ll
index b8cd03e8cf4..d8bb29a0954 100644
--- a/llvm/test/Transforms/Reassociate/optional-flags.ll
+++ b/llvm/test/Transforms/Reassociate/optional-flags.ll
@@ -1,23 +1,24 @@
-; RUN: opt -S -reassociate < %s | FileCheck %s
+; RUN: opt -S -reassociate -dce < %s | FileCheck %s
; rdar://8944681
; Reassociate should clear optional flags like nsw when reassociating.
; CHECK-LABEL: @test0(
-; CHECK: %y = add i64 %a, %b
-; CHECK: %z = add i64 %c, %y
-define i64 @test0(i64 %a, i64 %b, i64 %c) {
- %y = add nsw i64 %c, %b
- %z = add i64 %y, %a
+; CHECK: %z = add i64 %b, 2
+define i64 @test0(i64 %a, i64 %b) {
+ %x = add nsw i64 %a, 2
+ %y = add nsw i64 %x, %b
+ %z = sub nsw i64 %y, %a
ret i64 %z
}
; CHECK-LABEL: @test1(
-; CHECK: %y = add i64 %a, %b
-; CHECK: %z = add i64 %c, %y
-define i64 @test1(i64 %a, i64 %b, i64 %c) {
- %y = add i64 %c, %b
- %z = add nsw i64 %y, %a
+; CHECK: %y = mul i64 %a, 6
+; CHECK: %z = sub nsw i64 %y, %a
+define i64 @test1(i64 %a, i64 %b) {
+ %x = add nsw i64 %a, %a
+ %y = mul nsw i64 %x, 3
+ %z = sub nsw i64 %y, %a
ret i64 %z
}
OpenPOWER on IntegriCloud