The exit-on-error flag was necessary in order to avoid an assertion when handling DYNAMIC_STACKALLOC nodes in SelectionDAGLegalize.
We can avoid the assertion by creating some dummy nodes. This enables us to remove the exit-on-error flag on the first 2 run lines (SI), but on the third run line (R600) we would run into another assertion when trying to reserve indirect registers. This patch also replaces that assertion with an early exit from the function.
Fixes PR27761.
Last exit-on-error patch for AMDGPU
I would prefer not using getIntPtrConstant since I would like to remove it in general from LLVM. This would more preferrably be getConstant(-1, Op.getValueType())