[PATCH] D118426: [InstCombine] Remove side effect of replaced constrained intrinsics

Serge Pavlov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 27 19:48:59 PST 2022


sepavloff created this revision.
sepavloff added reviewers: kpn, nikic, spatel, craig.topper, andrew.w.kaylor.
Herald added a subscriber: hiraditya.
sepavloff requested review of this revision.
Herald added a project: LLVM.

If a constrained intrinsic call was replaced by some value, it was not
removed in some cases. The dangling instruction resulted in useless
instructions executed in runtime. It happened because constrained
intrinsics usually have side effect, it is used to model the interaction
with floating point-environment. In some cases it is correct behavior
but often the side effect is actually absent or can be ignored.

This change adds specific treatment of constrained intrinsics so that
their side effect can be removed if it actually absents.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D118426

Files:
  llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/test/Transforms/InstCombine/constrained.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118426.403863.patch
Type: text/x-patch
Size: 6795 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220128/cd441a38/attachment.bin>


More information about the llvm-commits mailing list