[PATCH] D37740: [SelectionDAG] Pick correct frame index in LowerArguments

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 09:28:07 PDT 2017


bjope added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:8802
+      // We want to find the highest frame index involved here (associating
+      // the argument with the lowest stack address involved). The
+      // getCopyFromParts call above is swapping the order of the operands to
----------------
aprantl wrote:
> Always the highest or does this depend on the direction in which the stack grows?
Oh wait. I guess the frame indices are numbered "in the same way" even if the stack is growing in the other direction (considering negative/positive frame indices etc). So we probably want to find the lowest FI if the stack grows up.
So the comparison in the assert needs to be based on stack direction. And my comment is confusing at the moment. But I hope the pair will be built in the same way (regarding which part that contains the least/most significant bytes), so the rest should be ok.


https://reviews.llvm.org/D37740





More information about the llvm-commits mailing list