R600/SI: Set correct number of user sgprs for HSA runtime
[oota-llvm.git] / lib / Target / R600 / SIISelLowering.cpp
index 2733e09cd10f579d283b882d9b671b3749e9bf91..85ef37d99b14264a7e5b760769bd8e3e26cd29b8 100644 (file)
@@ -489,7 +489,10 @@ SDValue SITargetLowering::LowerFormalArguments(
   // The pointer to the list of arguments is stored in SGPR0, SGPR1
        // The pointer to the scratch buffer is stored in SGPR2, SGPR3
   if (Info->getShaderType() == ShaderType::COMPUTE) {
-    Info->NumUserSGPRs = 4;
+    if (Subtarget->isAmdHsaOS())
+      Info->NumUserSGPRs = 2;  // FIXME: Need to support scratch buffers.
+    else
+      Info->NumUserSGPRs = 4;
 
     unsigned InputPtrReg =
         TRI->getPreloadedValue(MF, SIRegisterInfo::INPUT_PTR);