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

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 23 10:02:15 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;
----------------
alex-t 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).

Done

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


More information about the llvm-commits mailing list