[MIR-Canon] Skip the first N vreg names lazily.
authorPuyan Lotfi <puyan@puyan.org>
Fri, 31 May 2019 06:02:38 +0000 (06:02 +0000)
committerPuyan Lotfi <puyan@puyan.org>
Fri, 31 May 2019 06:02:38 +0000 (06:02 +0000)
commit0d63cef180ccc6f5afab824cc784949acb137713
tree444beaa5cd3d5ac30b80792700cd11f90d08cb02
parent30935ef0bcdc7703eb2199e3fc5095198497e889
[MIR-Canon] Skip the first N vreg names lazily.

This consolidates the vreg skip code into one function (SkipVRegs()).
SkipVRegs() now knows if it should skip as if it is the first initialization or
subsequent skips.

The first skip is also done the first time createVirtualRegister is called by
the cursor instead of by the cursor's constructor. This prevents verifier
errors on machine functions that have no vregs (where the verifier will
complain that there are vregs when the function uses none).

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

llvm-svn: 362195
llvm/lib/CodeGen/MIRCanonicalizerPass.cpp
llvm/test/CodeGen/MIR/AArch64/multiple-lhs-operands.mir