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

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 07:54:07 PST 2021


kpn added a comment.

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

> Moving this logic to `wouldInstructionBeTriviallyDead()` does not seem right, because the decision about removing side effect comes from constant evaluation and not from the state of call object.

I'm sympathetic to this argument. If a transformation pass determines that a constrained intrinsic can be removed then it would be helpful if that pass could note that fact. This doesn't help us with analysis passes, though. And I'm a little worried about having to explicitly mark constrained intrinsics as removable since I don't know that we do that for any other instruction. If constrained intrinsics are the only time we do this then it seems error prone. Maybe I'm wrong?


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