mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-13 19:40:26 +00:00
LSR cleanup: potential bug caught by PVS-Studio.
Thanks Andrey. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153451 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f64282145e
commit
81748bc320
@ -2497,13 +2497,14 @@ void LSRInstance::ChainInstruction(Instruction *UserInst, Instruction *IVOper,
|
|||||||
for (Value::use_iterator UseIter = IVOper->use_begin(),
|
for (Value::use_iterator UseIter = IVOper->use_begin(),
|
||||||
UseEnd = IVOper->use_end(); UseIter != UseEnd; ++UseIter) {
|
UseEnd = IVOper->use_end(); UseIter != UseEnd; ++UseIter) {
|
||||||
Instruction *OtherUse = dyn_cast<Instruction>(*UseIter);
|
Instruction *OtherUse = dyn_cast<Instruction>(*UseIter);
|
||||||
|
if (!OtherUse || OtherUse == UserInst)
|
||||||
|
continue;
|
||||||
if (SE.isSCEVable(OtherUse->getType())
|
if (SE.isSCEVable(OtherUse->getType())
|
||||||
&& !isa<SCEVUnknown>(SE.getSCEV(OtherUse))
|
&& !isa<SCEVUnknown>(SE.getSCEV(OtherUse))
|
||||||
&& IU.isIVUserOrOperand(OtherUse)) {
|
&& IU.isIVUserOrOperand(OtherUse)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (OtherUse && OtherUse != UserInst)
|
NearUsers.insert(OtherUse);
|
||||||
NearUsers.insert(OtherUse);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Since this user is part of the chain, it's no longer considered a use
|
// Since this user is part of the chain, it's no longer considered a use
|
||||||
|
Loading…
x
Reference in New Issue
Block a user