[PATCH] D84225: [CFE] Add nomerge function attribute to inline assembly.

Phoebe Wang via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 8 01:26:21 PST 2022


pengfei added a comment.

In D84225#3302142 <https://reviews.llvm.org/D84225#3302142>, @rnk wrote:

> I think LLVM already doesn't do some tail merging optimizations on inline asm, but allowing the use of the attribute is more principled, and will block more optimizations (CSE).

IIRC, the initial requirment is to avoid the CSE like optimizations. We usually use inline asm for sepcial proposes. We have to stop the merge some time.



================
Comment at: clang/lib/Sema/SemaStmtAttr.cpp:186
   void VisitCallExpr(const CallExpr *E) { FoundCallExpr = true; }
+  void VisitAsmStmt(const AsmStmt *S) { FoundCallExpr = true; }
 
----------------
xbolva00 wrote:
> This is totally wrong, just big hack to smuggle it here.
Could you explain more? Is there any unexpect sideeffect by this?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84225



More information about the cfe-commits mailing list