summaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2022-08-29 15:45:30 -0700
committerCraig Topper <craig.topper@sifive.com>2022-08-29 15:52:08 -0700
commite25eb61d031bc01940aca1481adc05ad28f72628 (patch)
tree79dd0a4f4109dca2760c29f162ae275dd917ddda /clang/lib/CodeGen/CodeGenModule.cpp
parent5bd92d21b07e69c63f1bf91a0e7c350cc0a1ca92 (diff)
[RISCV] Enable (srl (and X, C2), C) to form SRLIW in more cases.
Don't require the AND has one use and don't depend on targetShrinkDemandedConstant turning C2 into 0xffffffff. Instead, check that the constant is 0xffffffff after replacing any bits that will be shifted out with 1s. Another way to fix this might be to prevent SimplifyDemandedBits from destroying the ANDI after type legalization using targetShrinkDemandedBits. That would prevent the CSE that created this mess. targetShrinkDemandedBits is currently only enable after legalize ops. Quick experiment shows we can't just change when it runs, we would need to try a different heuristic for post type legalization.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions