diff options
| author | Warren Ristow <warren.ristow@sony.com> | 2018-04-14 19:18:28 +0000 |
|---|---|---|
| committer | Warren Ristow <warren.ristow@sony.com> | 2018-04-14 19:18:28 +0000 |
| commit | 8b2f27ce3a4f68ba6cc8301a4ace6dd2573efad8 (patch) | |
| tree | 6d0a5d304df805e885817f2b1902be5a4bd7d5f2 /llvm/test/Transforms/Reassociate/fast-MissedTree.ll | |
| parent | 2120d3eacefeea470c4acbedcd9e75e8424d4552 (diff) | |
| download | bcm5719-llvm-8b2f27ce3a4f68ba6cc8301a4ace6dd2573efad8.tar.gz bcm5719-llvm-8b2f27ce3a4f68ba6cc8301a4ace6dd2573efad8.zip | |
[InstCombine] Enable Add/Sub simplifications with only 'reassoc' FMF
These simplifications were previously enabled only with isFast(), but that
is more restrictive than required. Since r317488, FMF has 'reassoc' to
control these cases at a finer level.
llvm-svn: 330089
Diffstat (limited to 'llvm/test/Transforms/Reassociate/fast-MissedTree.ll')
| -rw-r--r-- | llvm/test/Transforms/Reassociate/fast-MissedTree.ll | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/llvm/test/Transforms/Reassociate/fast-MissedTree.ll b/llvm/test/Transforms/Reassociate/fast-MissedTree.ll index a87c7f4a2d1..021c48a293e 100644 --- a/llvm/test/Transforms/Reassociate/fast-MissedTree.ll +++ b/llvm/test/Transforms/Reassociate/fast-MissedTree.ll @@ -12,7 +12,19 @@ define float @test1(float %A, float %B) { } ; Check again using minimal subset of FMF. +; Both 'reassoc' and 'nsz' are required. +define float @test1_reassoc_nsz(float %A, float %B) { +; CHECK-LABEL: @test1_reassoc_nsz( +; CHECK-NEXT: [[Z:%.*]] = fadd reassoc nsz float %A, %B +; CHECK-NEXT: ret float [[Z]] +; + %W = fadd reassoc nsz float %B, -5.0 + %Y = fadd reassoc nsz float %A, 5.0 + %Z = fadd reassoc nsz float %W, %Y + ret float %Z +} +; Verify the fold is not done with only 'reassoc' ('nsz' is required). define float @test1_reassoc(float %A, float %B) { ; CHECK-LABEL: @test1_reassoc( ; CHECK-NEXT: [[W:%.*]] = fadd reassoc float %B, -5.000000e+00 @@ -25,4 +37,3 @@ define float @test1_reassoc(float %A, float %B) { %Z = fadd reassoc float %W, %Y ret float %Z } - |

