[PATCH] D110046: [X86] Clear kill flags when rewriting SETCC uses in flag copy lowering.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 19 15:55:06 PDT 2021


craig.topper created this revision.
craig.topper added reviewers: chandlerc, RKSimon, spatel, pengfei.
Herald added a subscriber: hiraditya.
craig.topper requested review of this revision.
Herald added a project: LLVM.

When we rewrite the setcc we replace set old setcc output register
with the new CondReg. But since CondReg can be shared by other
replacements, we don't know if the kill flags for the old register
are valid for CondReg. So be conservative and remove them.

The test case has a SETCCr and a SETCCm on the same condition so
they end up sharing the same CondReg. The SETCCr had one use with
a kill flag. This kill flag isn't valid after the replacement because
CondReg needs a live range extending to the later SETCCm replacment.

Fixes PR51908.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110046

Files:
  llvm/lib/Target/X86/X86FlagsCopyLowering.cpp
  llvm/test/CodeGen/X86/flags-copy-lowering.mir
  llvm/test/CodeGen/X86/pr51908.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110046.373479.patch
Type: text/x-patch
Size: 6509 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210919/ab4c5ac7/attachment.bin>


More information about the llvm-commits mailing list