diff options
author | Andrew Trick <atrick@apple.com> | 2012-05-03 01:14:37 +0000 |
---|---|---|
committer | Andrew Trick <atrick@apple.com> | 2012-05-03 01:14:37 +0000 |
commit | f12f6dff9784805e8f89309787231c1ec53a8c6e (patch) | |
tree | 2cff0b5f490ffbf44c24d6aaeac8620c10107033 /lib/CodeGen/TwoAddressInstructionPass.cpp | |
parent | e8cd3f249133406c9b2a8dc6b6dbd2752fc605b4 (diff) | |
download | llvm-f12f6dff9784805e8f89309787231c1ec53a8c6e.tar.gz llvm-f12f6dff9784805e8f89309787231c1ec53a8c6e.tar.bz2 llvm-f12f6dff9784805e8f89309787231c1ec53a8c6e.tar.xz |
Added TargetRegisterInfo::getAllocatableClass.
The ensures that virtual registers always belong to an allocatable class.
If your target attempts to create a vreg for an operand that has no
allocatable register subclass, you will crash quickly.
This ensures that targets define register classes as intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r-- | lib/CodeGen/TwoAddressInstructionPass.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index c30b1333bb..f98e059ed8 100644 --- a/lib/CodeGen/TwoAddressInstructionPass.cpp +++ b/lib/CodeGen/TwoAddressInstructionPass.cpp @@ -1298,7 +1298,8 @@ TryInstructionTransform(MachineBasicBlock::iterator &mi, // Unfold the load. DEBUG(dbgs() << "2addr: UNFOLDING: " << MI); const TargetRegisterClass *RC = - TII->getRegClass(UnfoldMCID, LoadRegIndex, TRI); + TRI->getAllocatableClass( + TII->getRegClass(UnfoldMCID, LoadRegIndex, TRI)); unsigned Reg = MRI->createVirtualRegister(RC); SmallVector<MachineInstr *, 2> NewMIs; if (!TII->unfoldMemoryOperand(MF, &MI, Reg, |