This is an archive of the discontinued LLVM Phabricator instance.

[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 Timeline

thegameg created this revision.Aug 25 2023, 1:05 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2023, 1:05 PM
thegameg requested review of this revision.Aug 25 2023, 1:05 PM
arsenm accepted this revision.Aug 31 2023, 11:20 AM
This revision is now accepted and ready to land.Aug 31 2023, 11:20 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 31 2023, 5:13 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

The newly added test cases in ffp-model.c fail on SystemZ, making CI red:
https://lab.llvm.org/buildbot/#/builders/94/builds/16280

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 {
^

The newly added test cases in ffp-model.c fail on SystemZ, making CI red:

Should be fixed, thanks for the report and sorry for the delay.

The newly added test cases in ffp-model.c fail on SystemZ, making CI red:

Should be fixed, thanks for the report and sorry for the delay.

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)