Unverified Commit 87519a28 authored by Luke Lau's avatar Luke Lau Committed by GitHub
Browse files

[RISCV] Combine (mul (zext, zext)) -> (zext (mul (zext, zext))) (#86465)

Building on #86248, we can also narrow the width of a mul of zexts.

This is specifically legal because on RVV we always extend to the next
power of 2 width, and multiplying two N bit integers produces a maximum
value of 2\*N bits.
So as long as we keep an inner zext of 2\*N, we will have enough space
for the multiply and won't overflow.

Alive2 proof: https://alive2.llvm.org/ce/z/XteYyb
parent ecfffbfd
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment