[PATCH] D34181: MachineInstr: Reason locally about some memory objects before going to AA.

Geoff Berry via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 16 13:58:14 PDT 2017


gberry added inline comments.


================
Comment at: lib/CodeGen/MachineInstr.cpp:1667
+  if (!SameVal) {
+    const PseudoSourceValue *PSVa = MMOa->getPseudoValue();
+    const PseudoSourceValue *PSVb = MMOb->getPseudoValue();
----------------
efriedma wrote:
> bmakam wrote:
> > efriedma wrote:
> > > This looks weird.  If getPseudoValue() is non-null, getValue() is null; therefore PSVa is always null here.
> > getValue() will not be null here as we check for getValue() is null and return early at line 1638
> > 
> > ```
> >   if (!MMOa->getValue() || !MMOb->getValue())
> >     return true;
> > ```
> What I meant to say is "If getValue() is non-null, getPseudoValue() is null, therefore PSVa is always null here."
This is what I was trying to express in my previous comment.
I also think these Pseduo value checks could be expanded to handle cases other than isConstant by checking the mayAlias/isAliased as I outlined above.


https://reviews.llvm.org/D34181





More information about the llvm-commits mailing list