[RISCV] Narrow vector absolute value (#82041)
If we have a abs(sext a) we can legally perform this as a zext (abs a). (See the same combine in instcombine - note that the IntMinIsPoison flag doesn't exist in SDAG yet.) On RVV, this is likely profitable because it may allow us to perform the arithmetic operations involved in the abs at a narrower LMUL before widening for the user. We could arguably avoid narrowing below DLEN, but the transform should at worst move around the extend and create one extra vsetvli toggle if the source could previously be handled via loads explicit w/EEW.
parent
a8fdc93e
Please register or sign in to comment