[llvm] r237978 - MergedLoadStoreMotion preserves MemoryDependenceAnalysis, it does not require it.

Daniel Berlin dberlin at dberlin.org
Thu May 21 17:36:58 PDT 2015


On Thu, May 21, 2015 at 5:30 PM, Quentin Colombet <qcolombet at apple.com> wrote:
> Hi Daniel,
>
>
>> On May 21, 2015, at 5:13 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
>>
>> Author: dannyb
>> Date: Thu May 21 19:13:05 2015
>> New Revision: 237978
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=237978&view=rev
>> Log:
>> MergedLoadStoreMotion preserves MemoryDependenceAnalysis, it does not require it.
>> (It already was coded assuming it can sometimes be null, so no other changes are necessary)
>
> What happens when the pass has the MemoryDependenceAnalysis?

Nothing.
It doesn't use it.
It calls the AA API directly.  MD has no effect on AA's results (if it
did, we would have  really serious problems).
The only calls to MD are to the update functions.
Here is the list of things it does with MD:

    MD->removeInstruction(Inst);

      MD->invalidateCachedPointerInfo(LI->getPointerOperand());

      MD->invalidateCachedPointerInfo(Inst);

        MD->invalidateCachedPointerInfo(NewPN);

None of these do anything but update MD.

It doesn't pass MD to any utilities or anything, either.


> If so, are we sure this commit does not regress anything?

Yes.
It performs exactly the same set of opts before or after.



More information about the llvm-commits mailing list