[PATCH] D102344: [SCEV]: Teach SCEV about llvm.annotation intrinsic

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 14 14:50:50 PDT 2021


Meinersbur added a comment.

In D102344#2757705 <https://reviews.llvm.org/D102344#2757705>, @etiotto wrote:

> It is not clear to me what side-effects the `llvm.annotation` intrinsic would need to have. The current documentation states that the intrinsic function can be ignored by code gen and optimizations.  That means I could  move instructions past the intrinsic since the intrinsic can be ignored.  If the intrinsics had side effects that optimization would be illegal, and it follows the intrinsic could not be ignored. Do I make any sense?

I am referring to the summary:

> The llvm.annotation intrinsic returns the first argument passed to it.

As mentioned, this is not a sufficient condition to be just ignored. The summary should also mention that by the LLVM language reference, " are ignored by code generation and optimization."

Suggestion:

As by the LLVM language reference, the `llvm.annotation` intrinsic and no effect on code generation and optimization (https://llvm.org/docs/LangRef.html) and therefore can be safely replaced by its first argument. This patch 'teaches' SCEV the semantics of that builtin function.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D102344



More information about the llvm-commits mailing list