[PATCH] D22701: [test-suite] Bitcode simd tests: align memory to 128.

Eric Christopher via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 16:21:48 PDT 2016


echristo added a subscriber: echristo.

================
Comment at: Bitcode/simd_ops/simd_ops.cpp:19
@@ +18,3 @@
+#else
+    T *mem = (T *)memalign(128, w*h*sizeof(T));
+#endif
----------------
asbirlea wrote:
> mehdi_amini wrote:
> > Will this work on Windows?
> I looked it up and I think I need to use "_aligned_malloc()".
> Looking for ways to test it, I don't have one handy.
For portability there's nothing specific that will work across everything until C++17. _aligned_malloc is the right way for windows.

Perhaps abstract it out into an aligned allocation function. Also, if you wouldn't mind commenting this routine as well as to why we're allocating aligned memory :)


https://reviews.llvm.org/D22701





More information about the llvm-commits mailing list