[PATCH] D94155: [X86] Fix tile config register spill issue.
Pengfei Wang via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 19 01:17:30 PST 2021
pengfei added inline comments.
================
Comment at: llvm/lib/Target/X86/X86FrameLowering.cpp:2098
+ const TargetRegisterClass *RC = TRI->getRegClass(X86::TILERegClassID);
+ auto TileRegNum = RC->getNumRegs();
+ for (unsigned I = 0; I < TileRegNum; I++) {
----------------
Better to use `unsigned`
================
Comment at: llvm/lib/Target/X86/X86PreTileConfig.cpp:110
-static Register buildConfigMI(MachineBasicBlock::iterator MI, int FrameIdx,
- const TargetInstrInfo *TII,
- MachineRegisterInfo *MRI,
- const X86Subtarget *ST) {
- auto *MBB = MI->getParent();
-
- // FIXME: AMX should assume AVX512 enabled.
- if (ST->hasAVX512()) {
- // Zero stack slot.
- Register Zmm = MRI->createVirtualRegister(&X86::VR512RegClass);
- BuildMI(*MBB, MI, DebugLoc(), TII->get(X86::VPXORDZrr), Zmm)
- .addReg(Zmm, RegState::Undef)
- .addReg(Zmm, RegState::Undef);
- addFrameReference(BuildMI(*MBB, MI, DebugLoc(), TII->get(X86::VMOVUPSZmr)),
- FrameIdx)
- .addReg(Zmm);
- }
-
- // build psuedo ldtilecfg
- Register VReg = MRI->createVirtualRegister(&X86::TILECFGRegClass);
-
- addFrameReference(
- BuildMI(*MBB, MI, DebugLoc(), TII->get(X86::PLDTILECFG), VReg), FrameIdx);
-
- return VReg;
-}
-
static ShapeT getShape(const MachineInstr &MI, MachineRegisterInfo *MRI) {
unsigned Opcode = MI.getOpcode();
----------------
Better to keep the function the same place with before.
================
Comment at: llvm/lib/Target/X86/X86PreTileConfig.cpp:296-300
+ WorkList.push(MBB);
+ bool First = true;
+ while (!WorkList.empty()) {
+ MBB = WorkList.front();
+ WorkList.pop();
----------------
I think using `push_back` and `pop_front` seems more clear.
================
Comment at: llvm/lib/Target/X86/X86PreTileConfig.cpp:351
+ E = MBB->pred_end();
+ S != E; S++) {
+
----------------
Curly brackets can be removed.
================
Comment at: llvm/lib/Target/X86/X86PreTileConfig.cpp:353
+
+ WorkList.push(*S);
+ }
----------------
Better to use `push_back`
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