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

Jun Wang via llvm-commits llvm-commits at lists.llvm.org
Mon May 27 20:38:05 PDT 2024


================
@@ -15979,6 +16022,28 @@ static bool isCopyFromRegOfInlineAsm(const SDNode *N) {
   return false;
 }
 
+LLVM_ATTRIBUTE_UNUSED
+static bool isCopyFromRegForI1Return(const SDNode *N) {
+  assert(N->getOpcode() == ISD::CopyFromReg);
+  SDNode *N1 = N->getOperand(0).getNode();
+  if (N1->getOpcode() != ISD::CopyToReg)
+    return false;
+  SDNode *N2 = N1->getOperand(0).getNode();
+  if (N2->getOpcode() != ISD::CopyFromReg)
+    return false;
+
+  // Possibly multiple CopyFromReg nodes before getting to CALLSEQ_END,
+  // e.g., when the return value is an array.
+  SDNode *N3 = N2;
+  do {
+    N3 = N3->getOperand(0).getNode();
+  } while (N3->getOpcode() == ISD::CopyFromReg);
+
+  if (N3->getOpcode() != ISD::CALLSEQ_END)
+    return false;
+  return true;
----------------
jwanggit86 wrote:

Done.

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


More information about the llvm-commits mailing list