Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 123a45f

Browse files
committed
[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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345727 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 1ef057d commit 123a45f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5431,10 +5431,13 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
54315431
switch (Pred) {
54325432
default:
54335433
break;
5434-
// fabs(x) < 0 --> false
5434+
case FCmpInst::FCMP_UGE:
54355435
case FCmpInst::FCMP_OLT:
5436+
// fabs(x) >= 0.0 --> true
5437+
// fabs(x) < 0.0 --> false
54365438
llvm_unreachable("fcmp should have simplified");
5437-
// fabs(x) > 0 --> x != 0
5439+
5440+
// fabs(x) > 0 --> x != 0
54385441
case FCmpInst::FCMP_OGT:
54395442
return new FCmpInst(FCmpInst::FCMP_ONE, CI->getArgOperand(0), RHSC);
54405443
// fabs(x) <= 0 --> x == 0

0 commit comments

Comments
 (0)