diff options
author | Sanjay Patel <spatel@rotateright.com> | 2022-05-26 08:23:36 -0400 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2022-05-26 09:08:47 -0400 |
commit | 3952c905ef08580de1ddc5d776177497407a6093 (patch) | |
tree | 7bc64817a6106bc73aefa4e609bc8dce93ffe53b /clang/lib/CodeGen/CodeGenModule.h | |
parent | ea6171c108c47c1ee486388adfa106e13e280e33 (diff) | |
download | llvm-3952c905ef08580de1ddc5d776177497407a6093.zip llvm-3952c905ef08580de1ddc5d776177497407a6093.tar.gz llvm-3952c905ef08580de1ddc5d776177497407a6093.tar.bz2 |
[InstCombine] fold icmp equality with udiv and large constant
With large compare constant:
(X u/ Y) == C --> (X == C) && (Y == 1)
(X u/ Y) != C --> (X != C) || (Y != 1)
https://alive2.llvm.org/ce/z/EhKwh6
There are various potential missing icmp (div) transforms shown here:
https://github.com/llvm/llvm-project/issues/55695
This is a generalization for part of the udiv + equality.
I didn't check in detail, but some of those may only make sense as
codegen transforms.
This results in one extra instruction in IR, but it is better for
analysis, and looks much better in codegen on all targets that I tried.
Differential Revision: https://reviews.llvm.org/D126410
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.h')
0 files changed, 0 insertions, 0 deletions