Fixed formatting, removed bug reference, renamed testcase
Thanks to Duncan Exon Smith for reviewing and cleanup suggestions.
llvm-svn: 213205
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index f2c7e64..d5039b2 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -2036,7 +2036,8 @@
case Instruction::Shl: {
// Can only handle X*C and X << C.
ConstantInt *RHS = dyn_cast<ConstantInt>(AddrInst->getOperand(1));
- if (!RHS) return false;
+ if (!RHS)
+ return false;
int64_t Scale = RHS->getSExtValue();
if (Opcode == Instruction::Shl)
Scale = 1LL << Scale;
@@ -2130,9 +2131,9 @@
return true;
}
case Instruction::SExt: {
- // Make sure this isn't a ConstantExpr (PR20314).
Instruction *SExt = dyn_cast<Instruction>(AddrInst);
- if (!SExt) return false;
+ if (!SExt)
+ return false;
// Try to move this sext out of the way of the addressing mode.
// Ask for a method for doing so.