AMDGPU: Produce error on dynamic_stackalloc
[oota-llvm.git] / lib / Target / AMDGPU / AMDGPUPromoteAlloca.cpp
index dae42acb41cb7d473ae832af8fb0f22e6ed77156..2e55a5dccaad0aae84a80407a51944a9e43f971e 100644 (file)
@@ -276,6 +276,9 @@ static bool collectUsesWithPtrTypes(Value *Val, std::vector<Value*> &WorkList) {
 }
 
 void AMDGPUPromoteAlloca::visitAlloca(AllocaInst &I) {
+  if (!I.isStaticAlloca())
+    return;
+
   IRBuilder<> Builder(&I);
 
   // First try to replace the alloca with a vector