[PATCH] D54155: [CodeGen] Make branch funnels pass the machine verifier

Francis Visoiu Mistrih via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 07:08:43 PST 2018


thegameg created this revision.
thegameg added reviewers: pcc, MatzeB, chandlerc, echristo.
Herald added subscribers: dexonsmith, steven_wu, eraman, mehdi_amini.

We previously marked all the tests with branch funnels as `-verify-machineinstrs=0`.

This is an attempt to fix it.

1. `ICALL_BRANCH_FUNNEL` has no defs. Mark it as `let OutOperandList = (outs)`

2. After that we hit an assert:

  Assertion failed: (Op.getValueType() != MVT::Other && Op.getValueType() != MVT::Glue && "Chain and glue operands should occur at end of operand list!"), function AddOperand, file /Users/francisvm/llvm/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp,
  line 461.

The chain operand was added at the beginning of the operand list. Move that to the end.

3. After that we hit another verifier issue in the pseudo expansion where the registers used in the cmps and jmps are not added to the livein lists. Add the `EFLAGS` to all the new MBBs that we create.

PR39436


https://reviews.llvm.org/D54155

Files:
  include/llvm/Target/Target.td
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/Target/X86/X86ExpandPseudo.cpp
  test/CodeGen/X86/icall-branch-funnel.ll
  test/ThinLTO/X86/cfi-devirt.ll
  test/ThinLTO/X86/devirt-after-icp.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54155.172765.patch
Type: text/x-patch
Size: 4141 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181106/82963651/attachment.bin>


More information about the llvm-commits mailing list