[PATCH] D100376: [ARM] Prevent phi-node-elimination from generating copy above t2WhileLoopStartLR

Malhar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 13 03:32:26 PDT 2021


malharJ created this revision.
malharJ added reviewers: dmgreen, SjoerdMeijer.
Herald added subscribers: danielkiss, hiraditya, kristof.beyls.
malharJ requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This patch prevents phi-node-elimination from generating a COPY operation for the register
defined by t2WhileLoopStartLR, as it is a terminator that defines a value.

This happens because of the presence of phi-nodes in the loop body (the Preheader
of which is the block containing the t2WhileLoopStartLR). If this is not done,
the COPY is generated above/before the terminator (t2WhileLoopStartLR here),
and since it uses the value defined by t2WhileLoopStartLR, MachineVerifier throws
a 'use before define' error.

This essentially adds on to the change in differential D91887 <https://reviews.llvm.org/D91887>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100376

Files:
  llvm/lib/Target/ARM/ARMBaseInstrInfo.h
  llvm/test/CodeGen/Thumb2/phi_prevent_copy.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100376.337089.patch
Type: text/x-patch
Size: 6423 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210413/1565c0a4/attachment.bin>


More information about the llvm-commits mailing list