llvm / llvm/llvm-project

[IndVarSimplify] `llvm::rewriteLoopExitValues` Generates `i33` for `riscv-32`

Open
#166,246 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.