[PATCH] D101141: [SimplifyCFG] Preserve metadata when unconditionalizing branches (constant condition).
Michael Kruse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 25 19:20:05 PDT 2021
Meinersbur 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:
> > > 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.
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