summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineFrameInfo.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-07-20 21:03:45 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-07-20 21:03:45 +0000
commitdb78273b6ea5cdce18c768fce5a1bdf55d61d91d (patch)
treed4669ed5cfc8ff241e204644a9380ab6c68ccdab /llvm/lib/CodeGen/MachineFrameInfo.cpp
parenteac8e7c08abbe4c8adefcceb429bd073ef172622 (diff)
downloadbcm5719-llvm-db78273b6ea5cdce18c768fce5a1bdf55d61d91d.tar.gz
bcm5719-llvm-db78273b6ea5cdce18c768fce5a1bdf55d61d91d.zip
Add an ID field to StackObjects
On AMDGPU SGPR spills are really spilled to another register. The spiller creates the spills to new frame index objects, which is used as a placeholder. This will eventually be replaced with a reference to a position in a VGPR to write to and the frame index deleted. It is most likely not a real stack location that can be shared with another stack object. This is a problem when StackSlotColoring decides it should combine a frame index used for a normal VGPR spill with a real stack location and a frame index used for an SGPR. Add an ID field so that StackSlotColoring has a way of knowing the different frame index types are incompatible. llvm-svn: 308673
Diffstat (limited to 'llvm/lib/CodeGen/MachineFrameInfo.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineFrameInfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineFrameInfo.cpp b/llvm/lib/CodeGen/MachineFrameInfo.cpp
index 73d778ff302..be8adf75fb7 100644
--- a/llvm/lib/CodeGen/MachineFrameInfo.cpp
+++ b/llvm/lib/CodeGen/MachineFrameInfo.cpp
@@ -47,11 +47,12 @@ static inline unsigned clampStackAlignment(bool ShouldClamp, unsigned Align,
}
int MachineFrameInfo::CreateStackObject(uint64_t Size, unsigned Alignment,
- bool isSS, const AllocaInst *Alloca) {
+ bool isSS, const AllocaInst *Alloca,
+ uint8_t ID) {
assert(Size != 0 && "Cannot allocate zero size stack objects!");
Alignment = clampStackAlignment(!StackRealignable, Alignment, StackAlignment);
Objects.push_back(StackObject(Size, Alignment, 0, false, isSS, Alloca,
- !isSS));
+ !isSS, ID));
int Index = (int)Objects.size() - NumFixedObjects - 1;
assert(Index >= 0 && "Bad frame index!");
ensureMaxAlignment(Alignment);
@@ -212,6 +213,10 @@ void MachineFrameInfo::print(const MachineFunction &MF, raw_ostream &OS) const{
for (unsigned i = 0, e = Objects.size(); i != e; ++i) {
const StackObject &SO = Objects[i];
OS << " fi#" << (int)(i-NumFixedObjects) << ": ";
+
+ if (SO.StackID != 0)
+ OS << "id=" << SO.StackID << ' ';
+
if (SO.Size == ~0ULL) {
OS << "dead\n";
continue;
OpenPOWER on IntegriCloud