aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/VirtualFileSystem.cpp
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2021-11-07 00:05:00 +0100
committerNikita Popov <nikita.ppv@gmail.com>2021-11-08 21:15:46 +0100
commit1376301c87274bccf5565eb892173442782b1de3 (patch)
tree8bf00c12846b0cb8831e3dbe2d2238f812628083 /llvm/lib/Support/VirtualFileSystem.cpp
parent6d44387e21a1b78eb7263f3610e7f11a42fecd24 (diff)
downloadllvm-1376301c87274bccf5565eb892173442782b1de3.zip
llvm-1376301c87274bccf5565eb892173442782b1de3.tar.gz
llvm-1376301c87274bccf5565eb892173442782b1de3.tar.bz2
[InstCombine] Canonicalize range test idiom
InstCombine converts range tests of the form (X > C1 && X < C2) or (X < C1 || X > C2) into checks of the form (X + C3 < C4) or (X + C3 > C4). It is possible to express all range tests in either of these forms (with different choices of constants), but currently neither of them is considered canonical. We may have equivalent range tests using either ult or ugt. This proposes to canonicalize all range tests to use ult. An alternative would be to canonicalize to either ult or ugt depending on the specific constants involved -- e.g. in practice we currently generate ult for && style ranges and ugt for || style ranges when going through the insertRangeTest() helper. In fact, the "clamp like" fold was relying on this, which is why I had to tweak it to not assume whether inversion is needed based on just the predicate. Proof: https://alive2.llvm.org/ce/z/_SP_rQ Differential Revision: https://reviews.llvm.org/D113366
Diffstat (limited to 'llvm/lib/Support/VirtualFileSystem.cpp')
0 files changed, 0 insertions, 0 deletions