[llvm] r285078 - fix formatting; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Tue Oct 25 09:12:31 PDT 2016
Author: spatel
Date: Tue Oct 25 11:12:31 2016
New Revision: 285078
URL: http://llvm.org/viewvc/llvm-project?rev=285078&view=rev
Log:
fix formatting; NFC
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp?rev=285078&r1=285077&r2=285078&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineSelect.cpp Tue Oct 25 11:12:31 2016
@@ -415,7 +415,7 @@ static Value *foldSelectCttzCtlz(ICmpIns
/// Visit a SelectInst that has an ICmpInst as its first operand.
Instruction *InstCombiner::foldSelectInstWithICmp(SelectInst &SI,
- ICmpInst *ICI) {
+ ICmpInst *ICI) {
bool Changed = false;
ICmpInst::Predicate Pred = ICI->getPredicate();
Value *CmpLHS = ICI->getOperand(0);
@@ -454,36 +454,36 @@ Instruction *InstCombiner::foldSelectIns
// Types do not match. Instead of calculating this with mixed types
// promote all to the larger type. This enables scalar evolution to
// analyze this expression.
- else if (CmpRHS->getType()->getScalarSizeInBits()
- < SelectTy->getBitWidth()) {
- Constant *sextRHS = ConstantExpr::getSExt(AdjustedRHS, SelectTy);
+ else if (CmpRHS->getType()->getScalarSizeInBits() <
+ SelectTy->getBitWidth()) {
+ Constant *SextRHS = ConstantExpr::getSExt(AdjustedRHS, SelectTy);
// X = sext x; x >s c ? X : C+1 --> X = sext x; X <s C+1 ? C+1 : X
// X = sext x; x <s c ? X : C-1 --> X = sext x; X >s C-1 ? C-1 : X
// X = sext x; x >u c ? X : C+1 --> X = sext x; X <u C+1 ? C+1 : X
// X = sext x; x <u c ? X : C-1 --> X = sext x; X >u C-1 ? C-1 : X
if (match(TrueVal, m_SExt(m_Specific(CmpLHS))) &&
- sextRHS == FalseVal) {
+ SextRHS == FalseVal) {
CmpLHS = TrueVal;
- AdjustedRHS = sextRHS;
+ AdjustedRHS = SextRHS;
} else if (match(FalseVal, m_SExt(m_Specific(CmpLHS))) &&
- sextRHS == TrueVal) {
+ SextRHS == TrueVal) {
CmpLHS = FalseVal;
- AdjustedRHS = sextRHS;
+ AdjustedRHS = SextRHS;
} else if (ICI->isUnsigned()) {
- Constant *zextRHS = ConstantExpr::getZExt(AdjustedRHS, SelectTy);
+ Constant *ZextRHS = ConstantExpr::getZExt(AdjustedRHS, SelectTy);
// X = zext x; x >u c ? X : C+1 --> X = zext x; X <u C+1 ? C+1 : X
// X = zext x; x <u c ? X : C-1 --> X = zext x; X >u C-1 ? C-1 : X
// zext + signed compare cannot be changed:
// 0xff <s 0x00, but 0x00ff >s 0x0000
if (match(TrueVal, m_ZExt(m_Specific(CmpLHS))) &&
- zextRHS == FalseVal) {
+ ZextRHS == FalseVal) {
CmpLHS = TrueVal;
- AdjustedRHS = zextRHS;
+ AdjustedRHS = ZextRHS;
} else if (match(FalseVal, m_ZExt(m_Specific(CmpLHS))) &&
- zextRHS == TrueVal) {
+ ZextRHS == TrueVal) {
CmpLHS = FalseVal;
- AdjustedRHS = zextRHS;
+ AdjustedRHS = ZextRHS;
} else
break;
} else
More information about the llvm-commits
mailing list