summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2022-11-13 10:19:41 -0500
committerSanjay Patel <spatel@rotateright.com>2022-11-13 10:28:06 -0500
commit6eae6b3722d9204fa93b772e24afab93406cc143 (patch)
tree7446827a9c47854a7ead7bfcd5c4f4df29e11869 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parente5120a43d543041bd6ea3e7c6ae96d778799f07c (diff)
[InstCombine] allow more folds for multi-use selects (2nd try)
The 1st try ( 681a6a399022 ) was reverted because it caused a DataFlowSanitizer bot failure. This try modifies the existing calls to simplifyBinOp() to not use a query that sets the context instruction because that seems like a likely source of failure. Since we already try those simplifies with multi-use patterns in some cases, that means the bug is likely present even without this patch. However, I have not been able to reduce a test to prove that this was the bug, so if we see any bot failures with this patch, then it should be reverted again. The reduced simplify power does not affect any optimizations in existing, motivating regression tests. Original commit message: The 'and' case showed up in a recent bug report and prevented more follow-on transforms from happening. We could handle more patterns (for example, the select arms simplified, but not to constant values), but this seems like a safe, conservative enhancement. The backend can convert select-of-constants to math/logic in many cases if it is profitable. There is a lot of overlapping logic for these kinds of patterns (see SimplifySelectsFeedingBinaryOp() and FoldOpIntoSelect()), so there may be some opportunity to improve efficiency. There are also optimization gaps/inconsistency because we do not call this code for all bin-opcodes (see TODO for ashr test).
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions