[llvm-commits] [llvm] r147399 - in /llvm/trunk: lib/CodeGen/SelectionDAG/LegalizeDAG.cpp test/CodeGen/X86/avx-shuffle-x86_32.ll Please review

Eli Friedman eli.friedman at gmail.com
Mon Jan 2 09:57:22 PST 2012


2012/1/2 Demikhovsky, Elena <elena.demikhovsky at intel.com>:
> I fixed the patch and want to commit it.
> I re-checked all and CodeGen/ARM/vext.ll passes now.
>
> Please review.

What changed to fix this patch?

For the following:
+        // EltVT gets smaller
+        assert(factor > 0);
+        SmallVector<int, 32> NewMask(32U, -1);

Where does the "32U" come from in "NewMask(32U, -1)"?

For the following:
+        for (unsigned i = 0; i < VT.getVectorNumElements(); ++i) {
+          if (Mask[i] < 0) {
+            for (unsigned fi = 0; fi < factor; ++fi)
+              NewMask[i*factor+fi] = Mask[i];
+          }
+          else {
+            for (unsigned fi = 0; fi < factor; ++fi)
+              NewMask[i*factor+fi] = Mask[i]*factor+fi;
+          }
+          Mask = NewMask;
+        }

The assignment Mask = NewMask inside the loop looks very suspicious:
are you sure that's correct?

-Eli



More information about the llvm-commits mailing list