[PATCH] D129735: [RISCV] Add new pass to transform undef to zero-init for vector values.

Kito Cheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 00:38:36 PDT 2022


kito-cheng created this revision.
Herald added subscribers: sunshaoce, VincentWu, luke957, vkmr, frasercrmck, evandro, luismarques, apazos, sameer.abuasal, s.egerton, Jim, benna, psnobl, jocewei, PkmX, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, niosHD, sabuasal, simoncook, johnrusso, rbar, asb, hiraditya, arichardson, mgorny.
Herald added a project: All.
kito-cheng requested review of this revision.
Herald added subscribers: llvm-commits, pcwang-thead, eopXD, MaskRay.
Herald added a project: LLVM.

RISC-V vector instruction has register overlapping constraint for certain
instructions, and will cause illegal instruction trap if violated, we use
early clobber to model this constraint, but it can't prevent register allocator
allocated same or overlapped if the input register is undef value, so convert
IMPLICIT_DEF to zero initialized could prevent that happen, it's not best way
to resolve this, and it might emit redundant zero initialized instruction for
undef value, so ideally we should model the constraint right, but before we
model the constraint right, it's the only way to prevent that happen.

See also: https://github.com/llvm/llvm-project/issues/50157


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129735

Files:
  llvm/lib/Target/RISCV/CMakeLists.txt
  llvm/lib/Target/RISCV/RISCV.h
  llvm/lib/Target/RISCV/RISCVRVVInitUndef.cpp
  llvm/lib/Target/RISCV/RISCVTargetMachine.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129735.444541.patch
Type: text/x-patch
Size: 7102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220714/df323a80/attachment.bin>


More information about the llvm-commits mailing list