Skip to content

Commit 4ef1387

Browse files
committed
Correct case of m_UIToFp to m_UIToFP to match instruction name, add m_SIToFP for consistency.
llvm-svn: 187225
1 parent 299b878 commit 4ef1387

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

llvm/include/llvm/Support/PatternMatch.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,10 +696,17 @@ m_ZExt(const OpTy &Op) {
696696
/// m_UIToFP
697697
template<typename OpTy>
698698
inline CastClass_match<OpTy, Instruction::UIToFP>
699-
m_UIToFp(const OpTy &Op) {
699+
m_UIToFP(const OpTy &Op) {
700700
return CastClass_match<OpTy, Instruction::UIToFP>(Op);
701701
}
702702

703+
/// m_SIToFP
704+
template<typename OpTy>
705+
inline CastClass_match<OpTy, Instruction::SIToFP>
706+
m_SIToFP(const OpTy &Op) {
707+
return CastClass_match<OpTy, Instruction::SIToFP>(Op);
708+
}
709+
703710
//===----------------------------------------------------------------------===//
704711
// Matchers for unary operators
705712
//

llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,10 +560,10 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
560560
if (I.hasNoNaNs() && I.hasNoInfs() && I.hasNoSignedZeros()) {
561561
Value *LHS = Op0, *RHS = Op1;
562562
Value *B, *C;
563-
if (!match(RHS, m_UIToFp(m_Value(C))))
563+
if (!match(RHS, m_UIToFP(m_Value(C))))
564564
std::swap(LHS, RHS);
565565

566-
if (match(RHS, m_UIToFp(m_Value(C))) && C->getType()->isIntegerTy(1)) {
566+
if (match(RHS, m_UIToFP(m_Value(C))) && C->getType()->isIntegerTy(1)) {
567567
B = LHS;
568568
Value *Zero = ConstantFP::getNegativeZero(B->getType());
569569
return SelectInst::Create(C, B, Zero);
@@ -574,10 +574,10 @@ Instruction *InstCombiner::visitFMul(BinaryOperator &I) {
574574
if (I.hasNoNaNs() && I.hasNoInfs() && I.hasNoSignedZeros()) {
575575
Value *LHS = Op0, *RHS = Op1;
576576
Value *A, *C;
577-
if (!match(RHS, m_FSub(m_FPOne(), m_UIToFp(m_Value(C)))))
577+
if (!match(RHS, m_FSub(m_FPOne(), m_UIToFP(m_Value(C)))))
578578
std::swap(LHS, RHS);
579579

580-
if (match(RHS, m_FSub(m_FPOne(), m_UIToFp(m_Value(C)))) &&
580+
if (match(RHS, m_FSub(m_FPOne(), m_UIToFP(m_Value(C)))) &&
581581
C->getType()->isIntegerTy(1)) {
582582
A = LHS;
583583
Value *Zero = ConstantFP::getNegativeZero(A->getType());

0 commit comments

Comments
 (0)