[llvm] [AMDGPU] Allocate i1 argument to SGPRs (PR #72461)

Jun Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 15:28:17 PDT 2024


================
@@ -15864,7 +15910,8 @@ bool SITargetLowering::isSDNodeSourceOfDivergence(const SDNode *N,
     if (const Value *V = FLI->getValueFromVirtualReg(R->getReg()))
       return UA->isDivergent(V);
 
-    assert(Reg == FLI->DemoteRegister || isCopyFromRegOfInlineAsm(N));
+    assert(Reg == FLI->DemoteRegister || isCopyFromRegOfInlineAsm(N) ||
+           isCopyFromRegForI1Return(N));
----------------
jwanggit86 wrote:

(1) For Debug build this is necessary. The reason is, for the i1 return value, when the additional CopyFromReg is created (line 3245 of SIISelLowering.cpp), the new virtual reg is used. Then the assert in line 15913 above would trigger without the new function `isCopyFromRegForI1Return`.
(2) Alternatively, when creating the additional CopyFromReg, we can use the physical reg from the original CopyFromReg, then the assert in line 15913 won't trigger and the new func is not needed.

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


More information about the llvm-commits mailing list