[PATCH] D33345: [DAG] Mark SPOffset for static allocas attached to stack frame

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 15:06:41 PDT 2017


rnk added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp:160
+          SPOffset -= TySize;
+          MF->getFrameInfo().setObjectOffset(FrameIndex, SPOffset);
           StaticAllocaMap[AI] = FrameIndex;
----------------
I don't like setting SPOffset once and then setting it again later during PEI. Passes will get different results over time, and that seems bad.

Why does TCO cause frame index aliasing? That seems like a problem we might be able to address in TCO.

I'd much rather let alias analysis assume that loads and stores based on different non-fixed frame indices can't alias. Fixed frame indices can probably alias in things like va_arg handling, but in that case we should have a reliable fixed offset here. It should hold that fixed and un-fixed stack objects don't overlap.

These offsets here also don't account for alignment.


https://reviews.llvm.org/D33345





More information about the llvm-commits mailing list