Create subranges for new intervals resulting from live interval splitting
authorKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 24 Aug 2016 13:37:55 +0000 (13:37 +0000)
committerKrzysztof Parzyszek <kparzysz@codeaurora.org>
Wed, 24 Aug 2016 13:37:55 +0000 (13:37 +0000)
commita7ed090bba0261162ed1dd018be8a25ec4ba0f81
treece58b1afde5d6dbeb5977378877c62c9be41b114
parentf114820912b8484a9b40429dd58dd829a87d8c58
Create subranges for new intervals resulting from live interval splitting

The register allocator can split a live interval of a register into a set
of smaller intervals. After the allocation of registers is complete, the
rewriter will modify the IR to replace virtual registers with the corres-
ponding physical registers. At this stage, if a register corresponding
to a subregister of a virtual register is used, the rewriter will check
if that subregister is undefined, and if so, it will add the <undef> flag
to the machine operand. The function verifying liveness of the subregis-
ter would assume that it is undefined, unless any of the subranges of the
live interval proves otherwise.
The problem is that the live intervals created during splitting do not
have any subranges, even if the original parent interval did. This could
result in the <undef> flag placed on a register that is actually defined.

Differential Revision: http://reviews.llvm.org/D21189

llvm-svn: 279625
17 files changed:
llvm/include/llvm/CodeGen/LiveInterval.h
llvm/include/llvm/CodeGen/LiveIntervalAnalysis.h
llvm/lib/CodeGen/LiveInterval.cpp
llvm/lib/CodeGen/LiveIntervalAnalysis.cpp
llvm/lib/CodeGen/LiveRangeCalc.cpp
llvm/lib/CodeGen/LiveRangeCalc.h
llvm/lib/CodeGen/LiveRangeEdit.cpp
llvm/lib/CodeGen/MachineVerifier.cpp
llvm/lib/CodeGen/RegAllocBase.cpp
llvm/lib/CodeGen/RegisterCoalescer.cpp
llvm/lib/CodeGen/RenameIndependentSubregs.cpp
llvm/lib/CodeGen/SplitKit.cpp
llvm/lib/CodeGen/SplitKit.h
llvm/lib/CodeGen/VirtRegMap.cpp
llvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp
llvm/test/CodeGen/AMDGPU/subreg-intervals.mir [new file with mode: 0644]
llvm/test/CodeGen/Hexagon/regalloc-bad-undef.mir [new file with mode: 0644]