[PATCH] D41925: X86: Refactor type-splitting to target-legal size vector to a helper function

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 11 02:45:01 PST 2018


RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.

LGTM with a couple of minors



================
Comment at: lib/Target/X86/X86ISelLowering.cpp:33987
+// apply a function on each part.
+// Useful for operationa that are available on SSE2 in 128-bit, on AVX2 in
+// 256-bit and on AVX512BW in 512-bit.
----------------
operations


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:34001
+    if (VT.getSizeInBits() > 512)
+      NumSubs = VT.getSizeInBits() / 512;
+  } else if (Subtarget.hasAVX2()) {
----------------
As this is now a general function, please add an assertion (same for 256/128 cases):
```
assert((VT.getSizeInBits() % 512) == 0 && "Illegal vector size");
```


================
Comment at: lib/Target/X86/X86ISelLowering.cpp:34006
+  } else {
+    if (VT.getSizeInBits() > 128)
+      NumSubs = VT.getSizeInBits() / 128;
----------------
As this is now a general function, please add for the else clause:
```
assert(Subtarget.hasSSE2() && "SSE2 required");
```


https://reviews.llvm.org/D41925





More information about the llvm-commits mailing list