llvm-project
d361f7b3 - [RISCV] Specially handle multiply by negative power-of-two cases (#244731)

Commit
8 hours ago
[RISCV] Specially handle multiply by negative power-of-two cases (#244731) Prior to this change, for power-of-two negative values in `expandMulToAddOrSubOfShl()`, the `Shift1` was calculated as a `SHL` by `32`, which for `i32` overflows, so is considered `undef`. In addition, for the `i64` negative power-of-two case, `MulAmt + MulAmtLowBit` overflowed in `uint64_t` causing a missed optimization. Fixes #244328 Based on discussions with @lenary. AI Usage: Reviewed by Codex.
Author
Parents
Loading