[llvm-commits] [llvm] r78121 - /llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Dan Gohman
gohman at apple.com
Tue Aug 4 16:24:02 PDT 2009
Author: djg
Date: Tue Aug 4 18:23:56 2009
New Revision: 78121
URL: http://llvm.org/viewvc/llvm-project?rev=78121&view=rev
Log:
Check for !isa<Constant> instead of isa<Instruction>. This
matches what the comment says, and it avoids spurious BitCast
instructions for Argument values.
Modified:
llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Modified: llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp?rev=78121&r1=78120&r2=78121&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopStrengthReduce.cpp Tue Aug 4 18:23:56 2009
@@ -1637,7 +1637,7 @@
// do this by forcing a BitCast (noop cast) to be inserted into the
// preheader in this case.
if (!fitsInAddressMode(Base, getAccessType(Inst), TLI, false) &&
- !isa<Instruction>(BaseV)) {
+ isa<Constant>(BaseV)) {
// We want this constant emitted into the preheader! This is just
// using cast as a copy so BitCast (no-op cast) is appropriate
BaseV = new BitCastInst(BaseV, BaseV->getType(), "preheaderinsert",
More information about the llvm-commits
mailing list