This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by asbirlea on Jul 22 2016, 2:10 PM.

Details

Summary

Patch preparing the addition of more tests.
Some require 128 alignment, so update driver to allocate aligned memory.

Diff Detail

Repository
rL LLVM

Event Timeline

asbirlea updated this revision to Diff 65153.Jul 22 2016, 2:10 PM
asbirlea retitled this revision from to [test-suite] Bitcode simd tests: align memory to 128..
asbirlea updated this object.
asbirlea added reviewers: llvm-commits, mehdi_amini.

I tested the change on Linux and OSX.
Suggestions on if there are other architecture specific changes I missed are welcome.

mehdi_amini added inline comments.Jul 22 2016, 2:56 PM
Bitcode/simd_ops/simd_ops.cpp
19 ↗(On Diff #65153)

Will this work on Windows?

asbirlea added inline comments.Jul 22 2016, 3:00 PM
Bitcode/simd_ops/simd_ops.cpp
19 ↗(On Diff #65153)

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.

echristo added inline comments.
Bitcode/simd_ops/simd_ops.cpp
19 ↗(On Diff #65153)

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 :)

asbirlea updated this revision to Diff 65558.Jul 26 2016, 11:04 AM

Update for Windows. Merge options for OSX/Linux.

asbirlea updated this revision to Diff 65560.Jul 26 2016, 11:07 AM

Add comment.

One inline comment :)

Bitcode/simd_ops/simd_ops.cpp
6 ↗(On Diff #65560)

Comment what's going on here and why we're allocating memory if you wouldn't mind? It might be nicer for this to be a function rather than a macro? Just call it alloc_aligned or something and have the functionality for all 3 platforms in there?

asbirlea updated this revision to Diff 65805.Jul 27 2016, 2:28 PM

Address comment.

asbirlea added inline comments.Jul 27 2016, 2:30 PM
Bitcode/simd_ops/simd_ops.cpp
6 ↗(On Diff #65805)

Moved the comment from below here and created a function instead of the macro.
There are just two cases, since I can unify OSX and Linux with the posix method.

echristo accepted this revision.Jul 27 2016, 2:31 PM
echristo added a reviewer: echristo.

good enough. Thanks!

LGTM.

-eric

This revision is now accepted and ready to land.Jul 27 2016, 2:31 PM
This revision was automatically updated to reflect the committed changes.