Fix builder for LLVM::Alloca operation.
authorStephan Herhut <herhut@google.com>
Thu, 9 May 2019 11:59:42 +0000 (04:59 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sat, 11 May 2019 02:25:28 +0000 (19:25 -0700)
--

PiperOrigin-RevId: 247402238

mlir/include/mlir/LLVMIR/LLVMOps.td

index 0b3968f..43b2bc5 100644 (file)
@@ -156,7 +156,8 @@ def LLVM_FRemOp : LLVM_ArithmeticOp<"frem", "CreateFRem">;
 def LLVM_AllocaOp : LLVM_OneResultOp<"alloca">,
                     Arguments<(ins LLVM_Type:$arraySize)> {
   string llvmBuilder = [{
-    $res = builder.CreateAlloca($_resultType, $arraySize);
+    $res = builder.CreateAlloca($_resultType->getPointerElementType(),
+                                $arraySize);
   }];
   let parser = [{ return parseAllocaOp(parser, result); }];
   let printer = [{ printAllocaOp(p, *this); }];