diff options
author | Cameron McInally <cameron.mcinally@nyu.edu> | 2019-05-29 16:50:14 +0000 |
---|---|---|
committer | Cameron McInally <cameron.mcinally@nyu.edu> | 2019-05-29 16:50:14 +0000 |
commit | 98a797c224a6abb2218963f551185ffba057aa4b (patch) | |
tree | b3bd4f305d1d1acf0554819ed8951933324d6ce6 | |
parent | 78337420cd1b23b01eb0c96d9d27a5c6a44d8d71 (diff) | |
download | bcm5719-llvm-98a797c224a6abb2218963f551185ffba057aa4b.tar.gz bcm5719-llvm-98a797c224a6abb2218963f551185ffba057aa4b.zip |
[NFC][InstCombine] Add a unary FNeg test to fsub.ll.
llvm-svn: 361988
-rw-r--r-- | llvm/test/Transforms/InstCombine/fsub.ll | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/fsub.ll b/llvm/test/Transforms/InstCombine/fsub.ll index 33f994da29b..f4d971c7ff1 100644 --- a/llvm/test/Transforms/InstCombine/fsub.ll +++ b/llvm/test/Transforms/InstCombine/fsub.ll @@ -14,6 +14,17 @@ define float @test1(float %x, float %y) { ret float %t2 } +define float @test1_unary(float %x, float %y) { +; CHECK-LABEL: @test1_unary( +; CHECK-NEXT: [[T1:%.*]] = fsub float [[X:%.*]], [[Y:%.*]] +; CHECK-NEXT: [[T2:%.*]] = fneg float [[T1]] +; CHECK-NEXT: ret float [[T2]] +; + %t1 = fsub float %x, %y + %t2 = fneg float %t1 + ret float %t2 +} + ; Can't do anything with the test above because -0.0 - 0.0 = -0.0, but if we have nsz: ; -(X - Y) --> Y - X |