aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGen.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2021-12-07 15:48:45 -0500
committerSanjay Patel <spatel@rotateright.com>2021-12-07 15:48:45 -0500
commitf65be726ab50ff13ccafd2f134599edb33cb1e7e (patch)
treeed86558d3f66c556181212ceb42ecf193b97fb61 /llvm/lib/CodeGen/CodeGen.cpp
parent51d3cb0ab15de7acb7131b5f967cf7fc84def99e (diff)
downloadllvm-f65be726ab50ff13ccafd2f134599edb33cb1e7e.zip
llvm-f65be726ab50ff13ccafd2f134599edb33cb1e7e.tar.gz
llvm-f65be726ab50ff13ccafd2f134599edb33cb1e7e.tar.bz2
[InstCombine] try to fold rem with constant dividend and select-of-constants divisor
We avoid this fold in the more general cases where we use `FoldOpIntoSelect`. That's because -- unlike most binary opcodes -- 'rem' can't usually be speculated with a variable divisor since it can have immediate UB. But in the case where both arms of the select are constants, we can safely evaluate both sides and eliminate 'rem' completely. This should fix: https://llvm.org/PR52102 The same optimization for 'div' is planned as a follow-up patch. Differential Revision: https://reviews.llvm.org/D115173
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
0 files changed, 0 insertions, 0 deletions