[PATCH] D131158: [SystemZ] Improve handling of vector alignments
Jonas Paulsson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 4 05:11:39 PDT 2022
jonpa created this revision.
jonpa added a reviewer: uweigand.
Herald added subscribers: jdoerfert, hiraditya.
Herald added a project: All.
jonpa requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.
With these first experiments, I see:
- Clang seems to now emit a padding in the case of no-vx, like
%struct.S = type { i32, [12 x i8], <4 x i32> }
instead of
%struct.S = type { i32, <4 x i32> }
This should be equivalent, in the final output, I would hope, although I have not looked into that handling in detail.
- As seen in function-attributes-01.ll, if the IR has no alignment specified, it is 8-byte aligned now even with -vector.
- vec-abi-align.ll needed updating to include the padding in the struct - as now expected from clang - to work...
It seems that SPEC builds identically both for z15 and zEC12, which is promising. I however don't quite know if this is actually correct or not: what if some optimizer want to build a vector and adds the wrong alignment in the no-vx case? Is the alignment as specified by the front end and found in the I/R enough to make this work in all cases? I am a little worried that some optimizer might look up that alignment value in DataLayout and use that instead...
https://reviews.llvm.org/D131158
Files:
clang/lib/Basic/Targets/SystemZ.h
clang/test/CodeGen/SystemZ/align-systemz-02.c
clang/test/CodeGen/target-data.c
llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
llvm/test/CodeGen/SystemZ/function-attributes-01.ll
llvm/test/CodeGen/SystemZ/vec-abi-align.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131158.449935.patch
Type: text/x-patch
Size: 9829 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220804/56e24079/attachment.bin>
More information about the llvm-commits
mailing list