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

Zequan Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 12 13:28:11 PDT 2020


zequanwu marked an inline comment as done.
zequanwu 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;
----------------
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`.


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

https://reviews.llvm.org/D78659





More information about the cfe-commits mailing list