forked from OSchip/llvm-project
LICM uses AliasSet information to hoist and sink instructions. However, other passes, such as LoopRotate
may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly. This patch teaches SSAUpdater to notify AliasSet that it made changes. The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size. rdar://11872059 PR12901 llvm-svn: 161803
This commit is contained in:
parent
5d4e205874
commit
8d80452076
|
@ -110,11 +110,12 @@ protected:
|
|||
V != DenseMapInfo<Value *>::getTombstoneKey();
|
||||
}
|
||||
|
||||
private:
|
||||
public:
|
||||
// Callbacks made from Value.
|
||||
static void ValueIsDeleted(Value *V);
|
||||
static void ValueIsRAUWd(Value *Old, Value *New);
|
||||
|
||||
private:
|
||||
// Internal implementation details.
|
||||
ValueHandleBase **getPrevPtr() const { return PrevPair.getPointer(); }
|
||||
HandleBaseKind getKind() const { return PrevPair.getInt(); }
|
||||
|
|
|
@ -214,6 +214,11 @@ void SSAUpdater::RewriteUse(Use &U) {
|
|||
else
|
||||
V = GetValueInMiddleOfBlock(User->getParent());
|
||||
|
||||
// Notify that users of the existing value that it is being replaced.
|
||||
Value *OldVal = U.get();
|
||||
if (OldVal != V && OldVal->hasValueHandle())
|
||||
ValueHandleBase::ValueIsRAUWd(OldVal, V);
|
||||
|
||||
U.set(V);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue