[PATCH] D42100: Fix codegen of stores of vectors with non byte-sized elements.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 20 10:00:49 PST 2018


efriedma added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/TargetLowering.cpp:3466
+                        ST->getAlignment(), ST->getMemOperand()->getFlags(),
+                        ST->getAAInfo());
+  }
----------------
I just realized there's a problem here.  I guess I've spent too much time on little-endian targets.

Specifically, the problem is that this code will store the elements in the wrong order on big-endian targets.  This will lead to inconsistent, and generally messy, results.

I think you can solve this by reversing the loop on big-endian targets, so high element of the vector is in the low bits of the integer.


https://reviews.llvm.org/D42100





More information about the llvm-commits mailing list