[PATCH] D78659: Add nomerge function attribute to supress tail merge optimization in simplifyCFG

Reid Kleckner via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 13 13:36:35 PDT 2020


rnk added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:1305
+    if (const auto *CB1 = dyn_cast<CallBase>(I1))
+      if (CB1->cannotMerge())
+        return Changed;
----------------
zequanwu wrote:
> rnk wrote:
> > It seems inconsistent that we don't apply the same logic to inline asm here. I think you should modify `cannotMerge` to return `isInlineAsm() || hasFnAttr(...NoMerge)`, and then remove the isInlineAsm case below.
> This changes breaks the test `AArch64/arm64-shrink-wrapping.ll` because the inlineAsm cannot be deleted. I think we should only check for `hasFnAttr(NoMerge)` for `CB1` and `CB2`.
Before pushing this patch, I undid the change to `cannotMerge` so that this stayed the same and the test passed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D78659





More information about the cfe-commits mailing list