[PATCH] D99027: [InstCombine] Whitelist non-refining folds in SimplifyWithOpReplaced
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 20 13:08:13 PDT 2021
nikic created this revision.
nikic added reviewers: aqjune, spatel, lebedev.ri.
Herald added a subscriber: hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
This is an alternative to D98391 <https://reviews.llvm.org/D98391>/D98585 <https://reviews.llvm.org/D98585>, playing things more conservatively. If `AllowRefinement == false`, then we don't use InstSimplify methods at all, and instead explicitly implement some non-refining folds. Most cases are handled by constant folding, and I only had to add two folds to cover our test cases. While this may lose some optimization power, I think it is safer to approach from this direction, given how many issues this has already caused.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D99027
Files:
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstCombine/select.ll
llvm/test/Transforms/InstSimplify/pr49495.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99027.332126.patch
Type: text/x-patch
Size: 9499 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210320/df8ebc5f/attachment.bin>
More information about the llvm-commits
mailing list