[llvm] [AMDGPU] Set register bank for i1 arguments/return values (PR #96155)

Jun Wang via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 25 21:17:13 PDT 2024


================
@@ -3745,6 +3745,21 @@ AMDGPURegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
     if (!DstBank)
       DstBank = SrcBank;
 
+    // The calling convention is to be updated such that i1 function arguments
+    // or return values are assigned to SGPRs without promoting to i32. With
+    // this, for i1 function arguments, the call of getRegBank() above gives
+    // incorrect result. We set both src and dst banks to VCCRegBank.
+    if (!MI.getOperand(1).getReg().isVirtual() &&
----------------
jwanggit86 wrote:

One possibly missing piece in the IF is `MI.isCopy()` because the code actually can be reached for both COPY and FREEZE.

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


More information about the llvm-commits mailing list