Correct case of m_UIToFp to m_UIToFP to match instruction name, add m_SIToFP for consistency.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187225 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Stephen Lin 2013-07-26 17:55:00 +00:00
parent d4afa8bbab
commit 3b6bb79578
2 changed files with 12 additions and 5 deletions

View File

@ -696,10 +696,17 @@ m_ZExt(const OpTy &Op) {
/// m_UIToFP
template<typename OpTy>
inline CastClass_match<OpTy, Instruction::UIToFP>
m_UIToFp(const OpTy &Op) {
m_UIToFP(const OpTy &Op) {
return CastClass_match<OpTy, Instruction::UIToFP>(Op);
}
/// m_SIToFP
template<typename OpTy>
inline CastClass_match<OpTy, Instruction::SIToFP>
m_SIToFP(const OpTy &Op) {
return CastClass_match<OpTy, Instruction::SIToFP>(Op);
}
//===----------------------------------------------------------------------===//
// Matchers for unary operators
//

View File

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