[PATCH] D15230: [BranchFolding] Merge MMOs during tail merge

Junmo Park via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 7 18:01:36 PST 2016


flyingforyou added a comment.

Hi Geoff.

I checked triple time after seeing your comment. I think I am not wrong with my comment.

In `mergeMemRefsWith()`

  if (hasIdenticalMMOs(*this, Other))
    return std::make_pair(MemRefs, NumMemRefs);
  -> If MMO lists are same, just return itself's MMOs.
  
  -> If MMO lists are not same, it starts merging likes below.
  
  // TODO: consider uniquing elements within the operand lists to reduce
  // space usage and fall back to conservative information less often.
  size_t CombinedNumMemRefs = NumMemRefs + Other.NumMemRefs;

After applying philip's commit, if the MMO lists are not same, we preserve MMOs.

Anyway, what I want to check is below part.

  if (MBBICommon->mayLoad() || MBBICommon->mayStore())
    MBBICommon->setMemRefs(MBBI->mergeMemRefsWith(*MBBI));

`MBBI->mergeMemRefsWith(*MBBI)` might be 
`MBBICommon->mergeMemRefsWith(*MBBI)` or `MBBI->mergeMemRefsWith(*MBBICommon)`.

I will upload new commit for this.

-Junmo.


http://reviews.llvm.org/D15230





More information about the llvm-commits mailing list