[PATCH] D42886: [GlobalISel][AArch64] Adding -disable-legality-check CL option

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 3 12:20:26 PST 2018


rtereshin created this revision.
rtereshin added reviewers: ab, dsanders, qcolombet.
Herald added subscribers: javed.absar, rovka, rengolin, aemerson.

Currently it's impossible to test functional parts of InstructionSelect
pass with MIR which is considered illegal by the Legalizer in Assert
builds. In early stages of porting an existing backend from
SelectionDAG ISel to GlobalISel, however, we would have very basic
CallLowering, Legalizer, and RegBankSelect implementations, but rather
functional Instruction Select with quite a few patterns selectable due
to the semi-automatic porting process borrowing them from SelectionDAG
ISel.

As we are trying to define legality as a property of being able to be
selected by the instruction selector, it would be nice to be able to
easily check what the selector can do in its current state w/o getting
the legality check provided by the Legalizer in the way. It also seems
beneficial to have a regression testing set up that would not allow the
selector to silently regress in its support of the MIR not supported
yet by the previous passes in the GlobalISel pipeline.

This commit adds -disable-legality-check command line option to llc
that disables those legality checks in RegBankSelect and
InstructionSelect passes.

It also adds quite a few MIR test cases for AArch64's Instruction
Selector. Every one of them would fail on the legality check at the
moment, but will select just fine if the check is disabled. Every test
MachineFunction is intended to exercise a specific selection rule and
that rule only, encoded in the MachineFunction's name by the rule's
number and index of its GIM_Try opcode in TableGen'erated MatchTable
(-optimize-match-table=false).


Repository:
  rL LLVM

https://reviews.llvm.org/D42886

Files:
  include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
  lib/CodeGen/GlobalISel/InstructionSelect.cpp
  lib/CodeGen/GlobalISel/LegalizerInfo.cpp
  lib/CodeGen/GlobalISel/RegBankSelect.cpp
  test/CodeGen/AArch64/GlobalISel/select-with-no-legality-check.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42886.132749.patch
Type: text/x-patch
Size: 181486 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180203/41c125d2/attachment-0001.bin>


More information about the llvm-commits mailing list