[all-commits] [llvm/llvm-project] b81e26: Recommit "[X86] Clear kill flags when rewriting SE...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Sep 21 14:59:53 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b81e26c7f470ee324095f7adfbe0384974db4375
      https://github.com/llvm/llvm-project/commit/b81e26c7f470ee324095f7adfbe0384974db4375
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-09-21 (Tue, 21 Sep 2021)

  Changed paths:
    M llvm/lib/Target/X86/X86FlagsCopyLowering.cpp
    M llvm/test/CodeGen/X86/flags-copy-lowering.mir
    A llvm/test/CodeGen/X86/pr51903.mir

  Log Message:
  -----------
  Recommit "[X86] Clear kill flags when rewriting SETCC uses in flag copy lowering."

This time with the right bug number.

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 PR51903.




More information about the All-commits mailing list