[PATCH] [StatepointLowering] Reuse stack slots across basic blocks
Igor Laevsky
igor at azulsystems.com
Wed Jun 10 05:16:41 PDT 2015
Thanks for the comments!
REPOSITORY
rL LLVM
================
Comment at: lib/CodeGen/SelectionDAG/StatepointLowering.cpp:135
@@ +134,3 @@
+ if (It == SpillMap.end())
+ return Optional<int>();
+
----------------
sanjoy wrote:
> When does this happen (derived pointer is not in SpillMap)?
It could happen if we have not visited this statepoint. For example if we looking through the loop backedge.
================
Comment at: lib/CodeGen/SelectionDAG/StatepointLowering.cpp:141
@@ +140,3 @@
+ // Look through cast instructions. Most of them are nops.
+ if (const CastInst *Cast = dyn_cast<CastInst>(Val)) {
+ return findPreviousSpillSlot(Cast->getOperand(0), Builder, LookUpDepth - 1);
----------------
sanjoy wrote:
> The `{` is redundant here.
>
> Also, is it okay to look through `addrspacecast`s? Perhaps we should just look through `bitcast`s for now and later generalize if needed.
I would prefer to keep braces here, if you don't mind. They make this case more visually distinctive from other cases.
I think you right about addrspace casts, theirs semantic is target dependant and they could be lowered into complicated expressions. I'll fix this case to look only through bitcasts. Anyway they should be a most common case.
http://reviews.llvm.org/D10251
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list