[PATCH] D50260: [X86] Fix liveness information when expanding X86::EH_SjLj_LongJmp64

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 3 09:05:58 PDT 2018


thegameg created this revision.
thegameg added reviewers: MatzeB, mike.dvoretsky, craig.topper, aivchenk.

`test/CodeGen/X86/shadow-stack.ll` has the following machine verifier errors:

  *** Bad machine code: Using a killed virtual register ***
  - function:    bar
  - basic block: %bb.6 entry (0x7fdc81857818)
  - instruction: %3:gr64 = MOV64rm killed %2:gr64, 1, $noreg, 8, $noreg
  - operand 1:   killed %2:gr64
  
  *** Bad machine code: Using a killed virtual register ***
  - function:    bar
  - basic block: %bb.6 entry (0x7fdc81857818)
  - instruction: $rsp = MOV64rm killed %2:gr64, 1, $noreg, 16, $noreg
  - operand 1:   killed %2:gr64
  
  *** Bad machine code: Virtual register killed in block, but needed live out. ***
  - function:    bar
  - basic block: %bb.2 entry (0x7fdc818574f8)
  Virtual register %2 is used after the block.

The fix here is to only copy the machine operand's register without the
kill flags for all the instructions except the very last one of the
sequence.

I had to insert dummy PHIs in the test case to force the NoPHI function
property to be set to false. More on this here: https://llvm.org/PR38439


https://reviews.llvm.org/D50260

Files:
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/sjlj-shadow-stack-liveness.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D50260.159023.patch
Type: text/x-patch
Size: 3433 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180803/88a4f917/attachment.bin>


More information about the llvm-commits mailing list