[all-commits] [llvm/llvm-project] 85abed: [TwoAddressInstruction] Pre-commit a test case for...

Jay Foad via All-commits all-commits at lists.llvm.org
Thu Oct 7 02:10:25 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 85abedd75074bf574e8b012883b5490674037093
      https://github.com/llvm/llvm-project/commit/85abedd75074bf574e8b012883b5490674037093
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2021-10-07 (Thu, 07 Oct 2021)

  Changed paths:
    A llvm/test/CodeGen/SystemZ/twoaddr-kill.mir

  Log Message:
  -----------
  [TwoAddressInstruction] Pre-commit a test case for D110848


  Commit: df2d4bc4cbc0626364bd4c5fc8203a00fabcd0d5
      https://github.com/llvm/llvm-project/commit/df2d4bc4cbc0626364bd4c5fc8203a00fabcd0d5
  Author: Jay Foad <jay.foad at amd.com>
  Date:   2021-10-07 (Thu, 07 Oct 2021)

  Changed paths:
    M llvm/lib/CodeGen/TwoAddressInstructionPass.cpp
    M llvm/test/CodeGen/SystemZ/twoaddr-kill.mir

  Log Message:
  -----------
  [TwoAddressInstruction] Fix ReplacedAllUntiedUses in processTiedPairs

Fix the calculation of ReplacedAllUntiedUses when any of the tied defs
are early-clobber. The effect of this is to fix the placement of kill
flags on an instruction like this (from @f2 in
 test/CodeGen/SystemZ/asm-18.ll):

  INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], killed %4:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit

After TwoAddressInstruction without this patch:

  %3:grh32bit = COPY killed %4:grh32bit
  INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit

Note that the COPY kills %4, even though there is a later use of %4 in
the INLINEASM. This fails machine verification if you force it to run
after TwoAddressInstruction (currently it is disabled for other
reasons).

After TwoAddressInstruction with this patch:

  %3:grh32bit = COPY %4:grh32bit
  INLINEASM &"stepb $1, $2" [attdialect], $0:[regdef-ec:GRH32Bit], def early-clobber %3:grh32bit, $1:[reguse tiedto:$0], %3:grh32bit(tied-def 3), $2:[reguse:GRH32Bit], %4:grh32bit

Differential Revision: https://reviews.llvm.org/D110848


Compare: https://github.com/llvm/llvm-project/compare/2bb208ddfd70...df2d4bc4cbc0


More information about the All-commits mailing list