[PATCH] D118319: Pass for fixing dependencies of constrained intrinsics

Kevin P. Neal via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 09:27:29 PST 2022


kpn added a comment.

In D118319#3275319 <https://reviews.llvm.org/D118319#3275319>, @nikic wrote:

> I think it would be better to do this as part of InstCombine. I don't think having a single pass at the end of the pipeline would be a good solution to this, as it means that these dead calls will survive through most of the optimization pipeline, blocking cost models and other optimizations. This doesn't look expensive enough that including it in InstCombine would be a problem.

True, we don't want instructions sticking around nearly as long as this patch. I submit, though, that we should be removing instructions in the transform passes that have been taught how to remove them. I don't see the value keeping dead instructions around after a transform pass should have removed them.

And if an instruction will _never_ be executed then I don't see the harm in DCE removing it. We wouldn't be removing a potential trap from runtime because the code won't be executed and the DCE pass knows it.



================
Comment at: llvm/test/Transforms/FloatDependencyFixup/float-dep-fixup.ll:21
+; CHECK-NEXT:  entry:
+; CHECK-NEXT:    [[RESULT:%.*]] = call float @llvm.experimental.constrained.fdiv.f32(float 1.000000e+00, float 3.000000e+00, metadata !"round.tonearest", metadata !"fpexcept.strict") #[[ATTR0:[0-9]+]]
+; CHECK-NEXT:    ret float 1.000000e+00
----------------
Why is this not getting removed as well?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118319



More information about the llvm-commits mailing list