[PATCH] D114766: If constrained intrinsic is replaced, remove its side effect

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 07:58:40 PST 2021


nikic added a comment.

In D114766#3161680 <https://reviews.llvm.org/D114766#3161680>, @sepavloff wrote:

> In D114766#3160877 <https://reviews.llvm.org/D114766#3160877>, @nikic wrote:
>
>> This is likely not going to be particularly useful, as the InstSimplifyPass is not really used outside of testing. To be generally applicable, this logic would have to be in wouldInstructionBeTriviallyDead().
>
> Why? This pass is run when clang is executed. [...]

Yes, because we do happen to have a single InstSimplifyPass run at the very end of the pipeline (in https://github.com/llvm/llvm-project/blob/98dbcff19cfedb4e27d267310a76d616cd435447/llvm/lib/Passes/PassBuilderPipelines.cpp#L1194). However, mostly InstSimplify is only used as an analysis, with the most important consumer being InstCombine, which uses InstSimplify (the analysis, not the pass) and runs many times during the optimization pipeline. So while your code is indeed getting optimized, it is optimized very late, and you would likely see phase-ordering issues in a more practical example.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114766



More information about the llvm-commits mailing list