This patch prevents argument promotion of types having
type size greater than 128 bits.
Fixes Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=49952
Differential D101188
[PowerPC] Prevent argument promotion of types with size greater than 128 bits saghir on Apr 23 2021, 11:17 AM. Authored by
Details
This patch prevents argument promotion of types having Fixes Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=49952
Diff Detail
Unit Tests Event Timeline
Comment Actions This will turn off argument promotion for all types wider than 128 bits. An example of a test case that might suffer from worse codegen: #include <stdio.h> typedef int __attribute__((vector_size(64))) v8si; static void __attribute__((noinline)) printWideVec(v8si *ptr) { v8si WideVec = *ptr; printf("Vector: { "); for (int i = 0; i < 7; i++) printf("%d, ", WideVec[i]); printf("%d }\n", WideVec[7]); } void test(vector signed int a, vector signed int b) { v8si WideVec = (v8si) { a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3] }; printWideVec(&WideVec); } Since we can actually check that the type is <N x i1> for N > 128, we should do that and ensure we are only disabling arg promotion on the MMA types.
Comment Actions Also, this is another one we should merge to 12.0.1 so please open the bug, mark it as a blocker and link it here. Comment Actions In the previous revision I suggested the following test case: #include <stdio.h> typedef int __attribute__((vector_size(64))) v8si; static void __attribute__((noinline)) printWideVec(v8si *ptr) { v8si WideVec = *ptr; printf("Vector: { "); for (int i = 0; i < 7; i++) printf("%d, ", WideVec[i]); printf("%d }\n", WideVec[7]); } void test(vector signed int a, vector signed int b) { v8si WideVec = (v8si) { a[0], a[1], a[2], a[3], b[0], b[1], b[2], b[3] }; printWideVec(&WideVec); } Can you please add it to this new test case to show that argument promotion is still happening for that case? |