[PATCH] D15890: Unpack array of all sizes in InstCombine

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 1 17:32:22 PST 2016


majnemer added a comment.

Does this do the right thing with wacky stuff like arrays of `i3`?


================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:597
@@ +596,3 @@
+    auto *Addr = LI.getPointerOperand();
+    auto *IdxType = Type::getInt32Ty(T->getContext());
+    auto *Zero = ConstantInt::get(IdxType, 0);
----------------
Arrays can have more than `2**32` elements.

================
Comment at: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp:602
@@ +601,3 @@
+    uint64_t Offset = 0;
+    for (unsigned i = 0; i < NumElements; i++) {
+      Value *Indices[2] = {
----------------
You should use `uint64_t` here.


http://reviews.llvm.org/D15890





More information about the llvm-commits mailing list