mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-29 06:53:53 +00:00
Don't emit a redundant BitCastInst if the value to be defined in the
preheader is already an instruction. llvm-svn: 74031
This commit is contained in:
parent
446169df49
commit
1eb6954545
@ -1642,7 +1642,8 @@ void LoopStrengthReduce::StrengthReduceStridedIVUsers(const SCEV* const &Stride,
|
||||
// the preheader, instead of being forward substituted into the uses. We
|
||||
// do this by forcing a BitCast (noop cast) to be inserted into the
|
||||
// preheader in this case.
|
||||
if (!fitsInAddressMode(Base, getAccessType(Inst), TLI, false)) {
|
||||
if (!fitsInAddressMode(Base, getAccessType(Inst), TLI, false) &&
|
||||
!isa<Instruction>(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
Block a user