Skip to content

Commit 9f620b8

Browse files
authored
[InstCombine] Slightly optimize visitFcmp (NFC) (#156097)
Studying the code related to float found a slightly optimal sequence of actions.
1 parent 2259a80 commit 9f620b8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8944,14 +8944,14 @@ Instruction *InstCombinerImpl::visitFCmpInst(FCmpInst &I) {
89448944
}
89458945

89468946
{
8947-
Value *CanonLHS = nullptr, *CanonRHS = nullptr;
8947+
Value *CanonLHS = nullptr;
89488948
match(Op0, m_Intrinsic<Intrinsic::canonicalize>(m_Value(CanonLHS)));
8949-
match(Op1, m_Intrinsic<Intrinsic::canonicalize>(m_Value(CanonRHS)));
8950-
89518949
// (canonicalize(x) == x) => (x == x)
89528950
if (CanonLHS == Op1)
89538951
return new FCmpInst(Pred, Op1, Op1, "", &I);
89548952

8953+
Value *CanonRHS = nullptr;
8954+
match(Op1, m_Intrinsic<Intrinsic::canonicalize>(m_Value(CanonRHS)));
89558955
// (x == canonicalize(x)) => (x == x)
89568956
if (CanonRHS == Op0)
89578957
return new FCmpInst(Pred, Op0, Op0, "", &I);

0 commit comments

Comments
 (0)