[PATCH] D101141: [SimplifyCFG] Preserve metadata when unconditionalizing branches (constant condition).

Jeroen Dobbelaere via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 00:26:46 PDT 2021


jeroen.dobbelaere added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/Local.cpp:175
+
+      // Transfer the metadata to the new branch instruction.
+      for (const auto &MDPair : BranchMetadata) {
----------------
lebedev.ri wrote:
> Meinersbur wrote:
> > lebedev.ri wrote:
> > > Meinersbur wrote:
> > > > lebedev.ri wrote:
> > > > > What about prof md?
> > > > Edge weights are not in the scope of this patch.
> > > Indeed.
> > > But my question is, this copies *all* metadata.
> > > What happens if the cond br had prof md?
> > > They won't really make sense on uncond br.
> > > Will verifier be ok with that, or should this specify which md to copy?
> > Thanks for the hint. Looking at the pre-merge fails, the sanitizer check indeed complains about "Wrong number of operands". I did not think it was related, all the LLVM checks succeed. I could not find a common handling of metadata for branches such as `llvm::copyMetadataForLoad` for loads.
> I'm guessing you are intentionally not copying `mustprocess`?
> I'm guessing you are intentionally not copying `mustprocess`?

`mustprogress` is part of MD_loop.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101141/new/

https://reviews.llvm.org/D101141



More information about the llvm-commits mailing list