diff options
author | Sanjay Patel <spatel@rotateright.com> | 2022-09-07 11:44:27 -0400 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2022-09-07 11:56:29 -0400 |
commit | 85b289377bff14790f402e5ea84bb24168a68fc6 (patch) | |
tree | 6ddd825c19d2480d3641d1d4b22c385af06d14f4 /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | e5a8f50ab160c56a316e79f46e787afa15c1cbcc (diff) | |
download | llvm-85b289377bff14790f402e5ea84bb24168a68fc6.zip llvm-85b289377bff14790f402e5ea84bb24168a68fc6.tar.gz llvm-85b289377bff14790f402e5ea84bb24168a68fc6.tar.bz2 |
[SCCP] convert signed div/rem to unsigned for non-negative operands, 2nd try
The original commit ( fe1f3cfc2669 ) was reverted because it could
crash / assert when trying to fold a value that was replaced
by a constant. In that case, there might not be an entry for the
constant in the solver yet.
This version adds a check for that possibility along with tests to
exercise that pattern (they used to crash).
Original commit message:
This extends the transform added with D81756 to handle div/rem opcodes.
For example:
https://alive2.llvm.org/ce/z/cX6za6
This replicates part of what CVP already does, but the motivating example
from issue #57472 demonstrates a phase ordering problem - we convert
branches to select before CVP runs and miss the transform.
Differential Revision: https://reviews.llvm.org/D133198
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
0 files changed, 0 insertions, 0 deletions