[llvm] r345727 - [InstCombine] add assertion that InstSimplify has folded a fabs+fcmp; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 31 08:31:45 PDT 2018
Author: spatel
Date: Wed Oct 31 08:31:45 2018
New Revision: 345727
URL: http://llvm.org/viewvc/llvm-project?rev=345727&view=rev
Log:
[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.
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp?rev=345727&r1=345726&r2=345727&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineCompares.cpp Wed Oct 31 08:31:45 2018
@@ -5431,10 +5431,13 @@ Instruction *InstCombiner::visitFCmpInst
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
More information about the llvm-commits
mailing list