[PATCH] D63068: [AVR] Fix incorrect stack parameter push order

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 13 19:44:56 PDT 2019


hfinkel added a comment.

> Transform all store nodes into one single node to ensure the order of all store nodes can't be changed.  So that the push instruction sequence generated would be correct.

The code here is probably correct - the various stores onto the stack seem to be independent - but the description here seems off. By grouping all of the stores into one TokenFactor, you're providing more ordering freedom, not less.



================
Comment at: lib/Target/AVR/AVRISelLowering.cpp:1263
+    // Reverse the order in MemOpChains to match the push order.
+    std::reverse(MemOpChains.begin(), MemOpChains.end());
+    Chain = DAG.getNode(ISD::TokenFactor, DL, MVT::Other, MemOpChains);
----------------
IIRC, the order of the operands of a TokenFactor don't carry any significance.


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63068/new/

https://reviews.llvm.org/D63068





More information about the llvm-commits mailing list