mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 13:11:39 +01:00
[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
This commit is contained in:
parent
f7ca7f6c70
commit
714cdb214a
@ -1,23 +1,24 @@
|
|||||||
; RUN: opt -S -reassociate < %s | FileCheck %s
|
; RUN: opt -S -reassociate -dce < %s | FileCheck %s
|
||||||
; rdar://8944681
|
; rdar://8944681
|
||||||
|
|
||||||
; Reassociate should clear optional flags like nsw when reassociating.
|
; Reassociate should clear optional flags like nsw when reassociating.
|
||||||
|
|
||||||
; CHECK-LABEL: @test0(
|
; CHECK-LABEL: @test0(
|
||||||
; CHECK: %y = add i64 %a, %b
|
; CHECK: %z = add i64 %b, 2
|
||||||
; CHECK: %z = add i64 %c, %y
|
define i64 @test0(i64 %a, i64 %b) {
|
||||||
define i64 @test0(i64 %a, i64 %b, i64 %c) {
|
%x = add nsw i64 %a, 2
|
||||||
%y = add nsw i64 %c, %b
|
%y = add nsw i64 %x, %b
|
||||||
%z = add i64 %y, %a
|
%z = sub nsw i64 %y, %a
|
||||||
ret i64 %z
|
ret i64 %z
|
||||||
}
|
}
|
||||||
|
|
||||||
; CHECK-LABEL: @test1(
|
; CHECK-LABEL: @test1(
|
||||||
; CHECK: %y = add i64 %a, %b
|
; CHECK: %y = mul i64 %a, 6
|
||||||
; CHECK: %z = add i64 %c, %y
|
; CHECK: %z = sub nsw i64 %y, %a
|
||||||
define i64 @test1(i64 %a, i64 %b, i64 %c) {
|
define i64 @test1(i64 %a, i64 %b) {
|
||||||
%y = add i64 %c, %b
|
%x = add nsw i64 %a, %a
|
||||||
%z = add nsw i64 %y, %a
|
%y = mul nsw i64 %x, 3
|
||||||
|
%z = sub nsw i64 %y, %a
|
||||||
ret i64 %z
|
ret i64 %z
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user