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

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 8 01:44:30 PST 2022

lebedev.ri added a comment.

In D84225#3303771 <https://reviews.llvm.org/D84225#3303771>, @pengfei wrote:

> 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.

Since the big hammer (`nomerge`) is already there i suppose this is fine,
but given that there is little context in the original description,
the wording makes it seem like it's being used to workaround
something that may or may not be a bug in the first place.

There isn't anything inherently wrong with merging inlineasm in general,
if that does not break the constraints, especially since
there's already a `sideeffect` keyword possible on the inlineasm.

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list