llvm-project
61e4d231 - [RISCV] Fold (X & -(1 << C1) & 0xffffffff) == C2 << C1 to sraiw X, C1 == C2. (#157617)

Commit
55 days ago
[RISCV] Fold (X & -(1 << C1) & 0xffffffff) == C2 << C1 to sraiw X, C1 == C2. (#157617) We had an existing fold for (X & -(1 << C1) & 0xffffffff) == 0 which we can generalize to support comparing to constants other than 0. Previously we used srliw, but this generalizes better using sraiw. I'm restricting to the case where C2 is simm12 or 2048 to allow sraiw+addi/xori+seqz/snez to be used. Other constants require a more careful analysis of the constants involved.
Author
Parents
Loading