For vector * scalar + vector, we emit fmuladd directly from clang.
This enables it also for matrix * scalar + matrix.
Paths
| Differential D158883
[Matrix] Try to emit fmuladd for both vector and matrix types ClosedPublic Authored by thegameg on Aug 25 2023, 1:05 PM.
Details Summary For vector * scalar + vector, we emit fmuladd directly from clang. This enables it also for matrix * scalar + matrix.
Diff Detail
Event TimelineThis revision is now accepted and ready to land.Aug 31 2023, 11:20 AM Closed by commit rGc987f9d7fdc7: [Matrix] Try to emit fmuladd for both vector and matrix types (authored by thegameg). · Explain WhyAug 31 2023, 5:13 PM This revision was automatically updated to reflect the committed changes. Comment Actions The newly added test cases in ffp-model.c fail on SystemZ, making CI red: The root cause seems to be that by default, the SystemZ back-end targets a machine without SIMD support, and therefore vector return types are passed via implicit reference according to the ABI: /home/uweigand/sandbox/buildbot/clang-s390x-linux/llvm/clang/test/CodeGen/ffp-model.c:121:12: error: CHECK: expected string not found in input // CHECK: define{{.*}} <4 x float> @my_m22_muladd ^ <stdin>:62:28: note: scanning from here %4 = fadd fast <2 x float> %2, %3 ^ <stdin>:67:1: note: possible intended match here define dso_local void @my_m22_muladd(ptr noalias sret([4 x float]) align 4 %agg.result, ptr noundef %0, float noundef nofpclass(nan inf) %y, ptr noundef %1) #0 { ^ Comment Actions
Should be fixed, thanks for the report and sorry for the delay. Comment Actions
Thanks, this fixes the problem for me locally. (Build bot is unfortunately still down because of this: https://github.com/llvm/llvm-project/pull/65267#issuecomment-1707318337)
Revision Contents
Diff 555200 clang/lib/CodeGen/CGExprScalar.cpp
clang/test/CodeGen/ffp-model.c
|