summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/pr27332.ll
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2016-04-15 17:21:03 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2016-04-15 17:21:03 +0000
commit2e02ba78d5987592b110aa0b83c368262ccda17c (patch)
tree163605182fa5c9714514b04485bf2bd38a9fe8d7 /llvm/test/Transforms/InstCombine/pr27332.ll
parent1f696b316c705ec7236b3a14e7f5b274de5535c7 (diff)
downloadbcm5719-llvm-2e02ba78d5987592b110aa0b83c368262ccda17c.tar.gz
bcm5719-llvm-2e02ba78d5987592b110aa0b83c368262ccda17c.zip
[InstCombine] Don't transform compares of calls to functions named fabs{f,l,}
InstCombine wants to optimize compares of calls to fabs with zero. However, we didn't have the necessary legality checking to verify that the function call had the same behavior as fabs. llvm-svn: 266452
Diffstat (limited to 'llvm/test/Transforms/InstCombine/pr27332.ll')
-rw-r--r--llvm/test/Transforms/InstCombine/pr27332.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/test/Transforms/InstCombine/pr27332.ll b/llvm/test/Transforms/InstCombine/pr27332.ll
index 543ffbe1fa7..87e440eed1c 100644
--- a/llvm/test/Transforms/InstCombine/pr27332.ll
+++ b/llvm/test/Transforms/InstCombine/pr27332.ll
@@ -9,3 +9,15 @@ entry:
}
; CHECK-LABEL: define <4 x i1> @test1(
; CHECK: ret <4 x i1> zeroinitializer
+
+declare float @fabsf()
+
+define i1 @test2() {
+ %call = call float @fabsf()
+ %cmp = fcmp olt float %call, 0.000000e+00
+ ret i1 %cmp
+}
+; CHECK-LABEL: define i1 @test2(
+; CHECK: %[[call:.*]] = call float @fabsf()
+; CHECK: %[[cmp:.*]] = fcmp olt float %[[call]], 0.000000e+00
+; CHECK: ret i1 %[[cmp]]
OpenPOWER on IntegriCloud