[ConstantRange] Calculate precise range for multiply by -1
authorNikita Popov <npopov@redhat.com>
Fri, 23 Jun 2023 10:15:02 +0000 (12:15 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 23 Jun 2023 10:17:48 +0000 (12:17 +0200)
commit7cf567d46121f4aa8f659554b5e8584cd0fac056
tree901efb30a2c2bb9366264d1e6aacbe575a5157bc
parent04a8070b46da2bcd47d0a134922409dc16bb9d57
[ConstantRange] Calculate precise range for multiply by -1

These are pretty common in SCEV, so make sure we get a precise
result by mapping to the sub() operation.
llvm/lib/IR/ConstantRange.cpp
llvm/unittests/IR/ConstantRangeTest.cpp