[PATCH] D138496: [OMPIRBuilder] Add OpenMPDefaultSimdAlignment field to TargetMachine class

Jan Sjödin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 6 10:25:16 PST 2022


jsjodin added a comment.

In D138496#3970344 <https://reviews.llvm.org/D138496#3970344>, @domada wrote:

> @jsjodin thanks for your remark. Let me add some more information to this patch.
>
> Currently clang emits information about preferred simd alignment only for X86, WebAssembly and PPC targets.

[snip]

> Your code looks elegant but in my opinion it will generate different code for ARM architecture where the vector alignment is set to 64 ( https://github.com/llvm-mirror/clang/blob/master/lib/Basic/Targets/ARM.cpp#L311 ), but simd default alignment is set to 0.

I wasn't exactly proposing to eliminate the TargetMachine function. We would need a default implementation in that returns 0, and override it in X86, WebAssembly and PPC to call the DataLayout function. The only difference is that we don't re-encode the sizes. It will only make a difference in the future e.g. if newer x86 targets have larger max alignment.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138496/new/

https://reviews.llvm.org/D138496



More information about the llvm-commits mailing list