summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-07-29 01:26:21 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-07-29 01:26:21 +0000
commit9608a2891d51b2e08fa6a0c36931e4be423ad6f1 (patch)
tree9ff4249638196f4884375631a5cb990d2f347962 /llvm/lib/Target
parentdc8f5cc39c5277d600ea2a1e076f5bb37fab246a (diff)
downloadbcm5719-llvm-9608a2891d51b2e08fa6a0c36931e4be423ad6f1.tar.gz
bcm5719-llvm-9608a2891d51b2e08fa6a0c36931e4be423ad6f1.zip
AMDGPU: Make areMemAccessesTriviallyDisjoint more aware of segment flat
Checking the encoding is insufficient since now there can be global or scratch instructions. llvm-svn: 309472
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AMDGPU/SIInstrInfo.cpp2
-rw-r--r--llvm/lib/Target/AMDGPU/SIInstrInfo.h8
2 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
index 6cce7ca4175..204eeff54d1 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
@@ -1997,7 +1997,7 @@ bool SIInstrInfo::areMemAccessesTriviallyDisjoint(MachineInstr &MIa,
if (isDS(MIb))
return checkInstOffsetsDoNotOverlap(MIa, MIb);
- return !isFLAT(MIb);
+ return !isFLAT(MIb) || isSegmentSpecificFLAT(MIb);
}
if (isMUBUF(MIa) || isMTBUF(MIa)) {
diff --git a/llvm/lib/Target/AMDGPU/SIInstrInfo.h b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
index 57a5133e0ed..0dbe080bf6b 100644
--- a/llvm/lib/Target/AMDGPU/SIInstrInfo.h
+++ b/llvm/lib/Target/AMDGPU/SIInstrInfo.h
@@ -420,6 +420,14 @@ public:
return MI.getDesc().TSFlags & SIInstrFlags::FLAT;
}
+ // Is a FLAT encoded instruction which accesses a specific segment,
+ // i.e. global_* or scratch_*.
+ static bool isSegmentSpecificFLAT(const MachineInstr &MI) {
+ auto Flags = MI.getDesc().TSFlags;
+ return (Flags & SIInstrFlags::FLAT) && !(Flags & SIInstrFlags::LGKM_CNT);
+ }
+
+ // Any FLAT encoded instruction, including global_* and scratch_*.
bool isFLAT(uint16_t Opcode) const {
return get(Opcode).TSFlags & SIInstrFlags::FLAT;
}
OpenPOWER on IntegriCloud