OSDN Git Service

MIR: Print the register class or bank in vreg defs
authorJustin Bogner <mail@justinbogner.com>
Tue, 24 Oct 2017 18:04:54 +0000 (18:04 +0000)
committerJustin Bogner <mail@justinbogner.com>
Tue, 24 Oct 2017 18:04:54 +0000 (18:04 +0000)
commitedab7579664b13faad3680c676c6b8a49d2ea00b
treedee3b97d46f3325ed2ceb0ddedb5e54e151a3676
parent7c330fabaedaba3d02c58bc3cc1198896c895f34
MIR: Print the register class or bank in vreg defs

This updates the MIRPrinter to include the regclass when printing
virtual register defs, which is already valid syntax for the
parser. That is, given 64 bit %0 and %1 in a "gpr" regbank,

  %1(s64) = COPY %0(s64)

would now be written as

  %1:gpr(s64) = COPY %0(s64)

While this change alone introduces a bit of redundancy with the
registers block, it allows us to update the tests to be more concise
and understandable and brings us closer to being able to remove the
registers block completely.

Note: We generally only print the class in defs, but there is one
exception. If there are uses without any defs whatsoever, we'll print
the class on all uses. I'm not completely convinced this comes up in
meaningful machine IR, but for now the MIRParser and MachineVerifier
both accept that kind of stuff, so we don't want to have a situation
where we can print something we can't parse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316479 91177308-0d34-0410-b5e6-96231b3b80d8
246 files changed:
lib/CodeGen/MIRPrinter.cpp
test/CodeGen/AArch64/GlobalISel/arm64-callingconv-ios.ll
test/CodeGen/AArch64/GlobalISel/arm64-callingconv.ll
test/CodeGen/AArch64/GlobalISel/arm64-irtranslator-stackprotect.ll
test/CodeGen/AArch64/GlobalISel/arm64-irtranslator.ll
test/CodeGen/AArch64/GlobalISel/arm64-regbankselect.mir
test/CodeGen/AArch64/GlobalISel/call-translator-ios.ll
test/CodeGen/AArch64/GlobalISel/call-translator.ll
test/CodeGen/AArch64/GlobalISel/debug-insts.ll
test/CodeGen/AArch64/GlobalISel/dynamic-alloca.ll
test/CodeGen/AArch64/GlobalISel/irtranslator-bitcast.ll
test/CodeGen/AArch64/GlobalISel/irtranslator-exceptions.ll
test/CodeGen/AArch64/GlobalISel/legalize-add.mir
test/CodeGen/AArch64/GlobalISel/legalize-and.mir
test/CodeGen/AArch64/GlobalISel/legalize-cmp.mir
test/CodeGen/AArch64/GlobalISel/legalize-combines.mir
test/CodeGen/AArch64/GlobalISel/legalize-constant.mir
test/CodeGen/AArch64/GlobalISel/legalize-div.mir
test/CodeGen/AArch64/GlobalISel/legalize-exceptions.ll
test/CodeGen/AArch64/GlobalISel/legalize-ext.mir
test/CodeGen/AArch64/GlobalISel/legalize-extracts.mir
test/CodeGen/AArch64/GlobalISel/legalize-fcmp.mir
test/CodeGen/AArch64/GlobalISel/legalize-fneg.mir
test/CodeGen/AArch64/GlobalISel/legalize-fptoi.mir
test/CodeGen/AArch64/GlobalISel/legalize-gep.mir
test/CodeGen/AArch64/GlobalISel/legalize-ignore-non-generic.mir
test/CodeGen/AArch64/GlobalISel/legalize-inserts.mir
test/CodeGen/AArch64/GlobalISel/legalize-itofp.mir
test/CodeGen/AArch64/GlobalISel/legalize-load-store.mir
test/CodeGen/AArch64/GlobalISel/legalize-mul.mir
test/CodeGen/AArch64/GlobalISel/legalize-nonpowerof2eltsvec.mir
test/CodeGen/AArch64/GlobalISel/legalize-or.mir
test/CodeGen/AArch64/GlobalISel/legalize-phi.mir
test/CodeGen/AArch64/GlobalISel/legalize-pow.mir
test/CodeGen/AArch64/GlobalISel/legalize-rem.mir
test/CodeGen/AArch64/GlobalISel/legalize-shift.mir
test/CodeGen/AArch64/GlobalISel/legalize-simple.mir
test/CodeGen/AArch64/GlobalISel/legalize-sub.mir
test/CodeGen/AArch64/GlobalISel/legalize-undef.mir
test/CodeGen/AArch64/GlobalISel/legalize-vaarg.mir
test/CodeGen/AArch64/GlobalISel/legalize-xor.mir
test/CodeGen/AArch64/GlobalISel/localizer-in-O0-pipeline.mir
test/CodeGen/AArch64/GlobalISel/localizer.mir
test/CodeGen/AArch64/GlobalISel/no-regclass.mir
test/CodeGen/AArch64/GlobalISel/regbankselect-default.mir
test/CodeGen/AArch64/GlobalISel/select-binop.mir
test/CodeGen/AArch64/GlobalISel/select-bitcast.mir
test/CodeGen/AArch64/GlobalISel/select-br.mir
test/CodeGen/AArch64/GlobalISel/select-bswap.mir
test/CodeGen/AArch64/GlobalISel/select-cbz.mir
test/CodeGen/AArch64/GlobalISel/select-constant.mir
test/CodeGen/AArch64/GlobalISel/select-dbg-value.mir
test/CodeGen/AArch64/GlobalISel/select-fma.mir
test/CodeGen/AArch64/GlobalISel/select-fp-casts.mir
test/CodeGen/AArch64/GlobalISel/select-imm.mir
test/CodeGen/AArch64/GlobalISel/select-implicit-def.mir
test/CodeGen/AArch64/GlobalISel/select-insert-extract.mir
test/CodeGen/AArch64/GlobalISel/select-int-ext.mir
test/CodeGen/AArch64/GlobalISel/select-int-ptr-casts.mir
test/CodeGen/AArch64/GlobalISel/select-intrinsic-aarch64-sdiv.mir
test/CodeGen/AArch64/GlobalISel/select-load.mir
test/CodeGen/AArch64/GlobalISel/select-muladd.mir
test/CodeGen/AArch64/GlobalISel/select-neon-vcvtfxu2fp.mir
test/CodeGen/AArch64/GlobalISel/select-phi.mir
test/CodeGen/AArch64/GlobalISel/select-pr32733.mir
test/CodeGen/AArch64/GlobalISel/select-store.mir
test/CodeGen/AArch64/GlobalISel/select-trunc.mir
test/CodeGen/AArch64/GlobalISel/select-xor.mir
test/CodeGen/AArch64/GlobalISel/select.mir
test/CodeGen/AArch64/GlobalISel/translate-gep.ll
test/CodeGen/AArch64/GlobalISel/varargs-ios-translator.ll
test/CodeGen/AArch64/GlobalISel/vastart.ll
test/CodeGen/AArch64/arm64-regress-opt-cmp.mir
test/CodeGen/AArch64/regcoal-physreg.mir
test/CodeGen/AArch64/spill-undef.mir
test/CodeGen/AMDGPU/GlobalISel/amdgpu-irtranslator.ll
test/CodeGen/AMDGPU/GlobalISel/inst-select-load-flat.mir
test/CodeGen/AMDGPU/GlobalISel/inst-select-load-smrd.mir
test/CodeGen/AMDGPU/GlobalISel/inst-select-store-flat.mir
test/CodeGen/AMDGPU/GlobalISel/irtranslator-amdgpu_vs.ll
test/CodeGen/AMDGPU/GlobalISel/legalize-add.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-and.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-bitcast.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-constant.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-fmul.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-icmp.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-or.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-select.mir
test/CodeGen/AMDGPU/GlobalISel/legalize-shl.mir
test/CodeGen/AMDGPU/clamp-omod-special-case.mir
test/CodeGen/AMDGPU/constant-fold-imm-immreg.mir
test/CodeGen/AMDGPU/detect-dead-lanes.mir
test/CodeGen/AMDGPU/endpgm-dce.mir
test/CodeGen/AMDGPU/fold-cndmask.mir
test/CodeGen/AMDGPU/fold-immediate-output-mods.mir
test/CodeGen/AMDGPU/fold-operands-order.mir
test/CodeGen/AMDGPU/macro-fusion-cluster-vcc-uses.mir
test/CodeGen/AMDGPU/opt-sgpr-to-vgpr-copy.mir
test/CodeGen/AMDGPU/regcoal-subrange-join.mir
test/CodeGen/AMDGPU/regcoalesce-dbg.mir
test/CodeGen/AMDGPU/rename-independent-subregs-mac-operands.mir
test/CodeGen/AMDGPU/sdwa-gfx9.mir
test/CodeGen/AMDGPU/sdwa-peephole-instr.mir
test/CodeGen/AMDGPU/sdwa-vop2-64bit.mir
test/CodeGen/AMDGPU/shrink-vop3-carry-out.mir
test/CodeGen/AMDGPU/si-instr-info-correct-implicit-operands.ll
test/CodeGen/AMDGPU/spill-empty-live-interval.mir
test/CodeGen/AMDGPU/twoaddr-mad.mir
test/CodeGen/AMDGPU/vop-shrink-frame-index.mir
test/CodeGen/AMDGPU/vop-shrink-non-ssa.mir
test/CodeGen/ARM/GlobalISel/arm-instruction-select-cmp.mir
test/CodeGen/ARM/GlobalISel/arm-instruction-select-combos.mir
test/CodeGen/ARM/GlobalISel/arm-instruction-select.mir
test/CodeGen/ARM/GlobalISel/arm-irtranslator.ll
test/CodeGen/ARM/GlobalISel/arm-legalize-divmod.mir
test/CodeGen/ARM/GlobalISel/arm-legalize-fp.mir
test/CodeGen/ARM/GlobalISel/arm-legalizer.mir
test/CodeGen/ARM/GlobalISel/arm-select-globals-pic.mir
test/CodeGen/ARM/GlobalISel/arm-select-globals-ropi-rwpi.mir
test/CodeGen/ARM/GlobalISel/arm-select-globals-static.mir
test/CodeGen/ARM/imm-peephole-arm.mir
test/CodeGen/ARM/imm-peephole-thumb.mir
test/CodeGen/Hexagon/cext-opt-basic.mir
test/CodeGen/Hexagon/early-if-debug.mir
test/CodeGen/Hexagon/expand-condsets-def-undef.mir
test/CodeGen/Hexagon/expand-condsets-imm.mir
test/CodeGen/Hexagon/expand-condsets-impuse.mir
test/CodeGen/Hexagon/expand-condsets-rm-reg.mir
test/CodeGen/Hexagon/hwloop-redef-imm.mir
test/CodeGen/Hexagon/regalloc-liveout-undef.mir
test/CodeGen/Hexagon/unreachable-mbb-phi-subreg.mir
test/CodeGen/Lanai/peephole-compare.mir
test/CodeGen/MIR/AArch64/atomic-memoperands.mir
test/CodeGen/MIR/AArch64/spill-fold.mir
test/CodeGen/MIR/AArch64/target-memoperands.mir
test/CodeGen/MIR/AMDGPU/fold-imm-f16-f32.mir
test/CodeGen/MIR/AMDGPU/fold-multiple.mir
test/CodeGen/MIR/AMDGPU/intrinsics.mir
test/CodeGen/MIR/AMDGPU/target-flags.mir
test/CodeGen/MIR/NVPTX/floating-point-immediate-operands.mir
test/CodeGen/MIR/X86/generic-instr-type.mir
test/CodeGen/MIR/X86/metadata-operands.mir
test/CodeGen/MIR/X86/roundtrip.mir
test/CodeGen/MIR/X86/stack-object-operands.mir
test/CodeGen/MIR/X86/subregister-index-operands.mir
test/CodeGen/MIR/X86/subregister-operands.mir
test/CodeGen/MIR/X86/unreachable-mbb-undef-phi.mir
test/CodeGen/MIR/X86/virtual-registers.mir
test/CodeGen/PowerPC/debuginfo-split-int.ll
test/CodeGen/PowerPC/no-rlwimi-trivial-commute.mir
test/CodeGen/PowerPC/tls_get_addr_fence1.mir
test/CodeGen/X86/GlobalISel/irtranslator-callingconv.ll
test/CodeGen/X86/GlobalISel/legalize-GV.mir
test/CodeGen/X86/GlobalISel/legalize-add-v128.mir
test/CodeGen/X86/GlobalISel/legalize-add-v256.mir
test/CodeGen/X86/GlobalISel/legalize-add-v512.mir
test/CodeGen/X86/GlobalISel/legalize-add.mir
test/CodeGen/X86/GlobalISel/legalize-and-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-brcond.mir
test/CodeGen/X86/GlobalISel/legalize-cmp.mir
test/CodeGen/X86/GlobalISel/legalize-constant.mir
test/CodeGen/X86/GlobalISel/legalize-ext-x86-64.mir
test/CodeGen/X86/GlobalISel/legalize-ext.mir
test/CodeGen/X86/GlobalISel/legalize-fadd-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-fdiv-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-fmul-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-fpext-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-fsub-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-gep.mir
test/CodeGen/X86/GlobalISel/legalize-insert-vec256.mir
test/CodeGen/X86/GlobalISel/legalize-insert-vec512.mir
test/CodeGen/X86/GlobalISel/legalize-memop-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-mul-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-mul-v128.mir
test/CodeGen/X86/GlobalISel/legalize-mul-v256.mir
test/CodeGen/X86/GlobalISel/legalize-mul-v512.mir
test/CodeGen/X86/GlobalISel/legalize-or-scalar.mir
test/CodeGen/X86/GlobalISel/legalize-phi.mir
test/CodeGen/X86/GlobalISel/legalize-sub-v128.mir
test/CodeGen/X86/GlobalISel/legalize-sub-v256.mir
test/CodeGen/X86/GlobalISel/legalize-sub-v512.mir
test/CodeGen/X86/GlobalISel/legalize-sub.mir
test/CodeGen/X86/GlobalISel/legalize-trunc.mir
test/CodeGen/X86/GlobalISel/legalize-undef.mir
test/CodeGen/X86/GlobalISel/legalize-xor-scalar.mir
test/CodeGen/X86/GlobalISel/regbankselect-X86_64.mir
test/CodeGen/X86/GlobalISel/select-GV.mir
test/CodeGen/X86/GlobalISel/select-add-v128.mir
test/CodeGen/X86/GlobalISel/select-add-v256.mir
test/CodeGen/X86/GlobalISel/select-add-v512.mir
test/CodeGen/X86/GlobalISel/select-add-x32.mir
test/CodeGen/X86/GlobalISel/select-add.mir
test/CodeGen/X86/GlobalISel/select-and-scalar.mir
test/CodeGen/X86/GlobalISel/select-blsi.mir
test/CodeGen/X86/GlobalISel/select-blsr.mir
test/CodeGen/X86/GlobalISel/select-brcond.mir
test/CodeGen/X86/GlobalISel/select-cmp.mir
test/CodeGen/X86/GlobalISel/select-constant.mir
test/CodeGen/X86/GlobalISel/select-copy.mir
test/CodeGen/X86/GlobalISel/select-ext-x86-64.mir
test/CodeGen/X86/GlobalISel/select-ext.mir
test/CodeGen/X86/GlobalISel/select-extract-vec256.mir
test/CodeGen/X86/GlobalISel/select-extract-vec512.mir
test/CodeGen/X86/GlobalISel/select-fadd-scalar.mir
test/CodeGen/X86/GlobalISel/select-fconstant.mir
test/CodeGen/X86/GlobalISel/select-fdiv-scalar.mir
test/CodeGen/X86/GlobalISel/select-fmul-scalar.mir
test/CodeGen/X86/GlobalISel/select-fpext-scalar.mir
test/CodeGen/X86/GlobalISel/select-fsub-scalar.mir
test/CodeGen/X86/GlobalISel/select-gep.mir
test/CodeGen/X86/GlobalISel/select-inc.mir
test/CodeGen/X86/GlobalISel/select-insert-vec256.mir
test/CodeGen/X86/GlobalISel/select-insert-vec512.mir
test/CodeGen/X86/GlobalISel/select-intrinsic-x86-flags-read-u32.mir
test/CodeGen/X86/GlobalISel/select-leaf-constant.mir
test/CodeGen/X86/GlobalISel/select-memop-scalar-x32.mir
test/CodeGen/X86/GlobalISel/select-memop-scalar.mir
test/CodeGen/X86/GlobalISel/select-memop-v128.mir
test/CodeGen/X86/GlobalISel/select-memop-v256.mir
test/CodeGen/X86/GlobalISel/select-memop-v512.mir
test/CodeGen/X86/GlobalISel/select-merge-vec256.mir
test/CodeGen/X86/GlobalISel/select-merge-vec512.mir
test/CodeGen/X86/GlobalISel/select-mul-scalar.mir
test/CodeGen/X86/GlobalISel/select-mul-vec.mir
test/CodeGen/X86/GlobalISel/select-or-scalar.mir
test/CodeGen/X86/GlobalISel/select-phi.mir
test/CodeGen/X86/GlobalISel/select-sub-v128.mir
test/CodeGen/X86/GlobalISel/select-sub-v256.mir
test/CodeGen/X86/GlobalISel/select-sub-v512.mir
test/CodeGen/X86/GlobalISel/select-sub.mir
test/CodeGen/X86/GlobalISel/select-trunc.mir
test/CodeGen/X86/GlobalISel/select-undef.mir
test/CodeGen/X86/GlobalISel/select-unmerge-vec256.mir
test/CodeGen/X86/GlobalISel/select-unmerge-vec512.mir
test/CodeGen/X86/GlobalISel/select-xor-scalar.mir
test/CodeGen/X86/debugloc-no-line-0.ll
test/CodeGen/X86/domain-reassignment.mir
test/CodeGen/X86/implicit-use-spill.mir
test/CodeGen/X86/lea-opt-with-debug.mir
test/CodeGen/X86/movtopush.mir
test/CodeGen/X86/peephole-recurrence.mir
test/CodeGen/X86/peephole.mir
test/CodeGen/X86/sqrt-fastmath-mir.ll
test/CodeGen/X86/tail-dup-debugloc.ll
test/CodeGen/X86/update-terminator-debugloc.ll
test/CodeGen/X86/xor-combine-debugloc.ll