summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2018-10-31 15:31:45 +0000
committerSanjay Patel <spatel@rotateright.com>2018-10-31 15:31:45 +0000
commitb9fe3fbb57c253ab341a95d2c87cb89090a55854 (patch)
tree1636f2b22f05815d748d53823a2116e5410e5454 /llvm/lib/Transforms
parent84484609751c52fb7ab087d79e13e87f10fa5287 (diff)
downloadbcm5719-llvm-b9fe3fbb57c253ab341a95d2c87cb89090a55854.tar.gz
bcm5719-llvm-b9fe3fbb57c253ab341a95d2c87cb89090a55854.zip
[InstCombine] add assertion that InstSimplify has folded a fabs+fcmp; NFC
The 'OLT' case was updated at rL266175, so I assume it was just an oversight that 'UGE' was not included because that patch handled both predicates in InstSimplify. llvm-svn: 345727
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index d3702a4885c..1ad648fe783 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -5431,10 +5431,13 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
switch (Pred) {
default:
break;
- // fabs(x) < 0 --> false
+ case FCmpInst::FCMP_UGE:
case FCmpInst::FCMP_OLT:
+ // fabs(x) >= 0.0 --> true
+ // fabs(x) < 0.0 --> false
llvm_unreachable("fcmp should have simplified");
- // fabs(x) > 0 --> x != 0
+
+ // fabs(x) > 0 --> x != 0
case FCmpInst::FCMP_OGT:
return new FCmpInst(FCmpInst::FCMP_ONE, CI->getArgOperand(0), RHSC);
// fabs(x) <= 0 --> x == 0
OpenPOWER on IntegriCloud