[PATCH] D94155: [X86] Fix tile config register spill issue.
Pengfei Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 12 20:10:10 PST 2021
pengfei added inline comments.
================
Comment at: llvm/include/llvm/CodeGen/LiveIntervals.h:384
+ bool getInterferenceRegMasks(LiveInterval &LI,
+ SmallVector<SlotIndex, 8> &RegSlots,
+ SmallVector<const uint32_t *, 8> &RegMaskBits);
----------------
Seems we usually use `SmallVectorImpl<...>` here.
================
Comment at: llvm/lib/CodeGen/LiveIntervals.cpp:956
+bool LiveIntervals::getInterferenceRegMasks(
+ LiveInterval &LI, SmallVector<SlotIndex, 8> &RegSlots,
+ SmallVector<const uint32_t *, 8> &RegBits) {
----------------
The same here.
================
Comment at: llvm/lib/CodeGen/LiveIntervals.cpp:982
+
+ bool Found = false;
+ while (true) {
----------------
Should `Found` always be `true` in our case?
================
Comment at: llvm/test/CodeGen/X86/AMX/amx-across-func.ll:109
%4 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 8, i16 %1, i8* getelementptr inbounds ([3072 x i8], [3072 x i8]* @buf, i64 0, i64 1024), i64 32)
- tail call void (...) @foo()
+ call void @foo()
%5 = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %0, i16 %1, i8* getelementptr inbounds ([3072 x i8], [3072 x i8]* @buf, i64 0, i64 2048), i64 32)
----------------
How about if it is a tail call?
================
Comment at: llvm/test/CodeGen/X86/AMX/amx-across-func.ll:113
tail call void @llvm.x86.tilestored64.internal(i16 %0, i16 %1, i8* getelementptr inbounds ([3072 x i8], [3072 x i8]* @buf, i64 0, i64 2048), i64 32, x86_amx %6)
ret void
}
----------------
It's better to add another foo after all users of tmm registers to make sure no `ldtilecfg` been generated.
================
Comment at: llvm/test/CodeGen/X86/AMX/amx-spill-merge.ll:110
; CHECK-NEXT: retq
%c = tail call x86_amx @llvm.x86.tileloadd64.internal(i16 %0, i16 %1, i8* getelementptr inbounds ([3072 x i8], [3072 x i8]* @buf, i64 0, i64 2048), i64 32)
br i1 undef, label %if.true, label %if.false
----------------
It's better add a call before any user of tmm instructions to see if ldtilecfg can be sunk
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94155/new/
https://reviews.llvm.org/D94155
More information about the llvm-commits
mailing list