[PATCH] D156346: CodeGen: Disable isCopyInstrImpl if there are implicit operands

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 26 09:40:23 PDT 2023


arsenm created this revision.
arsenm added reviewers: qcolombet, MatzeB, kparzysz, craig.topper, RKSimon, vitalybuka, lhames, bogner.
Herald added subscribers: pengfei, hiraditya.
Herald added a project: All.
arsenm requested review of this revision.
Herald added subscribers: wangpc, wdng.
Herald added a project: LLVM.

This is a conservative workaround for broken liveness tracking of
SUBREG_TO_REG to speculatively fix all targets. The current reported
failures are on X86 only, but this issue should appear for all targets
that use SUBREG_TO_REG. The next minimally correct refinement would be
to disallow only implicit defs.

      

The coalescer now introduces implicit-defs of the super register to
track the dependency on other subregisters. If we see such an implicit
operand, we cannot simply treat the subregister def as the result
operand in case downstream users depend on the implicitly defined
parts. Really target implementations should be considering the
implicit defs and trying to interpret them appropriately (maybe with
some generic helpers). The full implicit def could possibly be
reported as the move result, rather than the subregister def but that
requires additional work.

      

Hopefully fixes #64060 as well.

      

This needs to be applied to the release branch.


https://reviews.llvm.org/D156346

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/LiveDebugValues/InstrRefBasedImpl.cpp
  llvm/lib/CodeGen/LiveDebugValues/VarLocBasedImpl.cpp
  llvm/lib/Target/AArch64/AArch64InstrInfo.cpp
  llvm/test/CodeGen/X86/GlobalISel/add-ext.ll
  llvm/test/CodeGen/X86/coalescer-breaks-subreg-to-reg-liveness-reduced.ll
  llvm/test/CodeGen/X86/coalescer-breaks-subreg-to-reg-liveness.ll
  llvm/test/CodeGen/X86/dagcombine-cse.ll
  llvm/test/CodeGen/X86/fold-and-shift-x86_64.ll
  llvm/test/CodeGen/X86/unfold-masked-merge-scalar-constmask-lowhigh.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156346.544406.patch
Type: text/x-patch
Size: 12874 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230726/ecd734be/attachment-0001.bin>


More information about the llvm-commits mailing list