[PATCH] D60942: Emit diagnostic if inline asm "n" constraint isn't an immediate

Joerg Sonnenberger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 16:54:41 PDT 2019


joerg added a comment.

On the frontend side:

- __builtin_constant_p is not expanded correctly in EvalConstant.cpp when used as part of codegen for -O0. This means that trivially unreachable branches are emitted (e.g. with a BR with a literal false as condition),
- The constant evaluator has a general problem with overly pessimistic analysis when it comes to possible side effects. Still have to discuss the correct handling with Richard for this.

On the backend side:

- The is_constant intrinsic is lowered too late. The prepare-isel pass it is currently part of is run after the last SimplifyCFG pass, so the now-dead basic blocks are never pruned and therefore the asm statements survive.

All that said, with the discussed generalization from literal 'n' to 'expects immediate', I think this code solves the part of the problem it is meant to solve.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60942





More information about the llvm-commits mailing list