summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2019-08-01 18:41:28 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2019-08-01 18:41:28 +0000
commite56a2ad85e381e86c9a9f6df0a8e79964ec14bb9 (patch)
tree3ec2278fa47744a265cee6d96d287497ee397b59 /llvm/lib
parent3af2a69575da80f5e7b9890509a072b5062fe7c7 (diff)
downloadbcm5719-llvm-e56a2ad85e381e86c9a9f6df0a8e79964ec14bb9.tar.gz
bcm5719-llvm-e56a2ad85e381e86c9a9f6df0a8e79964ec14bb9.zip
CodeGen: Allow virtual registers in bundles
The note in the documentation suggests this restriction is a compile time optimization for architectures that make heavy use of bundling. Allowing virtual registers in a bundle is useful for some (non-R600) AMDGPU use cases and are infrequent enough to matter. A more common AMDGPU use case has already been using virtual registers in bundles since r333691, although never calling finalizeBundle on them and manually creating the use/def list on the BUNDLE instruction. This is also relatively infrequent, and only happens for consecutive sequences of some load/store types. llvm-svn: 367597
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/MachineInstrBundle.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineInstrBundle.cpp b/llvm/lib/CodeGen/MachineInstrBundle.cpp
index 32e266e9401..22b7cbad119 100644
--- a/llvm/lib/CodeGen/MachineInstrBundle.cpp
+++ b/llvm/lib/CodeGen/MachineInstrBundle.cpp
@@ -157,7 +157,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
unsigned Reg = MO.getReg();
if (!Reg)
continue;
- assert(TargetRegisterInfo::isPhysicalRegister(Reg));
+
if (LocalDefSet.count(Reg)) {
MO.setIsInternalRead();
if (MO.isKill())
@@ -194,7 +194,7 @@ void llvm::finalizeBundle(MachineBasicBlock &MBB,
DeadDefSet.erase(Reg);
}
- if (!MO.isDead()) {
+ if (!MO.isDead() && TargetRegisterInfo::isPhysicalRegister(Reg)) {
for (MCSubRegIterator SubRegs(Reg, TRI); SubRegs.isValid(); ++SubRegs) {
unsigned SubReg = *SubRegs;
if (LocalDefSet.insert(SubReg).second)
OpenPOWER on IntegriCloud