[IndVarSimplify] `llvm::rewriteLoopExitValues` Generates `i33` for `riscv-32`
Open
llvm:optimizations
miscompilation
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Godbolt: https://c.godbolt.org/z/5zvnhab7M
IndVarSimplify's `llvm::rewriteLoopExitValues` generates 33 bit integers for 32 bit risc-v targets.
This unnecessary `zext i32 to i33` seems to originate from `SCEVExpander::visitZeroExtendExpr`.
This is problematic because 32 bit targets are not equipped to natively handle 33 bit integers.
I'd expect the final output to be void of all casts from and to odd sized data types like `i33`.
Contributor guide
Assessment
This issue has not been assessed yet.