summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineRegisterInfo.cpp
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2018-10-03 02:12:17 +0000
committerDaniel Sanders <daniel_l_sanders@apple.com>2018-10-03 02:12:17 +0000
commitc973ad1878f335fbb90fd1ac421fa6309746fe53 (patch)
treee7f10b7b21bc3568ee2298ef1fc21803b72829c2 /llvm/lib/CodeGen/MachineRegisterInfo.cpp
parenta01151294ae34da280379a76b4ba9a8f26c2e538 (diff)
downloadbcm5719-llvm-c973ad1878f335fbb90fd1ac421fa6309746fe53.tar.gz
bcm5719-llvm-c973ad1878f335fbb90fd1ac421fa6309746fe53.zip
Re-commit: [globalisel] Add a combiner helpers for extending loads and use them in a pre-legalize combiner for AArch64
Summary: Depends on D45541 Reviewers: ab, aditya_nandakumar, bogner, rtereshin, volkan, rovka, javed.absar, aemerson Subscribers: aemerson, rengolin, mgorny, javed.absar, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D45543 The previous commit failed portions of the test-suite on GreenDragon due to duplicate COPY instructions and iterator invalidation. Both issues have now been fixed. To assist with this, a helper (cloneVirtualRegister) has been added to MachineRegisterInfo that can be used to get another register that has the same type and class/bank as an existing one. llvm-svn: 343654
Diffstat (limited to 'llvm/lib/CodeGen/MachineRegisterInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineRegisterInfo.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineRegisterInfo.cpp b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
index f632a9bd457..1da99d91760 100644
--- a/llvm/lib/CodeGen/MachineRegisterInfo.cpp
+++ b/llvm/lib/CodeGen/MachineRegisterInfo.cpp
@@ -177,6 +177,16 @@ MachineRegisterInfo::createVirtualRegister(const TargetRegisterClass *RegClass,
return Reg;
}
+unsigned MachineRegisterInfo::cloneVirtualRegister(unsigned VReg,
+ StringRef Name) {
+ unsigned Reg = createIncompleteVirtualRegister(Name);
+ VRegInfo[Reg].first = VRegInfo[VReg].first;
+ setType(Reg, getType(VReg));
+ if (TheDelegate)
+ TheDelegate->MRI_NoteNewVirtualRegister(Reg);
+ return Reg;
+}
+
void MachineRegisterInfo::setType(unsigned VReg, LLT Ty) {
// Check that VReg doesn't have a class.
assert((getRegClassOrRegBank(VReg).isNull() ||
OpenPOWER on IntegriCloud