forked from OSchip/llvm-project
Check for !isa<Constant> instead of isa<Instruction>. This
matches what the comment says, and it avoids spurious BitCast instructions for Argument values. llvm-svn: 78121
This commit is contained in:
parent
6faa1d2f8f
commit
298bce2aa9
|
@ -1637,7 +1637,7 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEV *const &Stride,
|
|||
// 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",
|
||||
|
|
Loading…
Reference in New Issue