[all-commits] [llvm/llvm-project] db836f: [RISCV] Narrow vector absolute value (#82041)

Philip Reames via All-commits all-commits at lists.llvm.org
Fri Feb 16 19:26:18 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db836f6094eafa5e60ca6395c8c195960108142a
      https://github.com/llvm/llvm-project/commit/db836f6094eafa5e60ca6395c8c195960108142a
  Author: Philip Reames <preames at rivosinc.com>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-abs.ll

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list