[llvm] [AMDGPU] Force the third source operand of the MAI instructions to VGPR if no AGPRs are used. (PR #69720)

Stanislav Mekhanoshin via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 20 12:04:30 PDT 2023


================
@@ -14147,9 +14149,14 @@ void SITargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
     // use between vgpr and agpr as agpr tuples tend to be big.
     if (!MI.getDesc().operands().empty()) {
       unsigned Opc = MI.getOpcode();
+      bool NoAGPRs = !Info->mayNeedAGPRs();
+      SmallVector<int> Opnds;
----------------
rampitec wrote:

Can you avoid using SmallVector here? I'd add src2 to the static array and break from the loop instead. This is cheaper. Actually I'd probably add isMAI() check too to the whole if (in a separate NFCI).

https://github.com/llvm/llvm-project/pull/69720


More information about the llvm-commits mailing list