This is an archive of the discontinued LLVM Phabricator instance.

[X86] Pass to transform tdpbsud&tdpbusd&tdpbuud intrinsics to scalar operation
ClosedPublic

Authored by yubing on Mar 24 2021, 1:54 AM.

Diff Detail

Event Timeline

yubing created this revision.Mar 24 2021, 1:54 AM
yubing requested review of this revision.Mar 24 2021, 1:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2021, 1:54 AM
pengfei added inline comments.Mar 27 2021, 9:19 PM
llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
357

What's this used for? Would it fails when some buildbot only has lower C++ libraries?

llvm/test/CodeGen/X86/AMX/amx-low-intrinsics.ll
409

This change doesn't seem affected by this patch. Do you know which one affects it? Why it still passes without this change?

yubing added inline comments.Mar 28 2021, 10:19 PM
llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
357

Ah, you are right. llvm should be built with gcc>=5.1 but if constexpr is not supported in gcc5.1
https://llvm.org/docs/GettingStarted.html
I will delete "constexpr".

llvm/test/CodeGen/X86/AMX/amx-low-intrinsics.ll
409

In fact, the bb's name is not aligned with tiledpbssd. So I changed it to tiledpbf16ps.
You can see it in line255 llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp

yubing updated this revision to Diff 333816.Mar 29 2021, 4:33 AM

Address Pengfei's comments

pengfei accepted this revision.Mar 29 2021, 6:06 AM

LGTM.

This revision is now accepted and ready to land.Mar 29 2021, 6:06 AM
This revision was landed with ongoing or failed builds.Mar 30 2021, 1:21 AM
This revision was automatically updated to reflect the committed changes.

It seems there is buildfail, I will revert it and fix bugs.
https://lab.llvm.org/buildbot#builders/77/builds/5053

PTAL at this build bot breakage:
https://lab.llvm.org/buildbot/#/builders/57/builds/5728

FAILED: lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86LowerAMXIntrinsics.cpp.o 
/home/buildbots/clang.11.0.0/bin/clang++ --gcc-toolchain=/opt/rh/devtoolset-7/root/usr  -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/Target/X86 -I/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/lib/Target/X86 -Iinclude -I/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O3  -fPIC    -fno-exceptions -fno-rtti -UNDEBUG -std=c++14 -MD -MT lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86LowerAMXIntrinsics.cpp.o -MF lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86LowerAMXIntrinsics.cpp.o.d -o lib/Target/X86/CMakeFiles/LLVMX86CodeGen.dir/X86LowerAMXIntrinsics.cpp.o -c /home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:381:13: error: no case matching constant switch condition '9824' [-Werror]
    switch (IntrID) {
            ^~~~~~
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:485:19: note: in instantiation of function template specialization '(anonymous namespace)::X86LowerAMXIntrinsics::createTileDPLoops<9824>' requested here
  Value *ResVec = createTileDPLoops<IntrID>(Start, End, Builder, M, NDWord,
                  ^
/home/buildbots/docker-RHEL-buildbot/SetupBot/worker_env/ppc64le-clang-rhel-test/clang-ppc64le-rhel/llvm/llvm/lib/Target/X86/X86LowerAMXIntrinsics.cpp:607:11: note: in instantiation of function template specialization '(anonymous namespace)::X86LowerAMXIntrinsics::lowerTileDP<9824>' requested here
      C = lowerTileDP<Intrinsic::x86_tdpbf16ps_internal>(Inst) || C;
          ^
1 error generated.
yubing reopened this revision.Mar 31 2021, 12:58 AM
This revision is now accepted and ready to land.Mar 31 2021, 12:58 AM
yubing updated this revision to Diff 334438.Mar 31 2021, 7:36 AM

Just a rebase