[all-commits] [llvm/llvm-project] d0f72f: [RISCV] Consider truncate semantics in performBUIL...

Philip Reames via All-commits all-commits at lists.llvm.org
Thu Feb 8 11:28:20 PST 2024


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

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-buildvec-of-binop.ll
    M llvm/test/CodeGen/RISCV/rvv/fixed-vectors-vselect.ll
    M llvm/test/CodeGen/RISCV/urem-seteq-illegal-types.ll

  Log Message:
  -----------
  [RISCV] Consider truncate semantics in performBUILD_VECTORCombine (#81168)

Fixes https://github.com/llvm/llvm-project/issues/80910.

Per the documentation in ISDOpcodes.h, for BUILD_VECTOR "The types of
the operands must match the vector element type, except that integer
types are allowed to be larger than the element type, in which case the
operands are implicitly truncated."

This transform was assuming that the scalar operand type matched the
result type. This resulted in essentially performing a truncate before a
binop, instead of after. As demonstrated by the test case changes, this
is often not legal.




More information about the All-commits mailing list