[Mlir-commits] [mlir] ffe9473 - [ExecutionEngine] Fix GEP type

Nikita Popov llvmlistbot at llvm.org
Sat Jul 17 14:45:09 PDT 2021


Author: Nikita Popov
Date: 2021-07-17T23:45:00+02:00
New Revision: ffe94738ed330d727c66d519867ad79c39eccee7

URL: https://github.com/llvm/llvm-project/commit/ffe94738ed330d727c66d519867ad79c39eccee7
DIFF: https://github.com/llvm/llvm-project/commit/ffe94738ed330d727c66d519867ad79c39eccee7.diff

LOG: [ExecutionEngine] Fix GEP type

Fix bug introduced in 2c68ecccc9ee1fb37eca318a9b3572813a137cd5,
the GEP type was off-by-ptr. Apparently I didn't run the MLIR
tests.

Added: 
    

Modified: 
    mlir/lib/ExecutionEngine/ExecutionEngine.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
index dba1dd084e20..f664b5826a09 100644
--- a/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
+++ b/mlir/lib/ExecutionEngine/ExecutionEngine.cpp
@@ -180,7 +180,7 @@ static void packFunctionArguments(Module *module) {
       llvm::Value *argIndex = llvm::Constant::getIntegerValue(
           builder.getInt64Ty(), APInt(64, indexedArg.index()));
       llvm::Value *argPtrPtr = builder.CreateGEP(
-          builder.getInt8Ty(), argList, argIndex);
+          builder.getInt8PtrTy(), argList, argIndex);
       llvm::Value *argPtr = builder.CreateLoad(builder.getInt8PtrTy(),
                                                argPtrPtr);
       llvm::Type *argTy = indexedArg.value().getType();
@@ -197,7 +197,7 @@ static void packFunctionArguments(Module *module) {
       llvm::Value *retIndex = llvm::Constant::getIntegerValue(
           builder.getInt64Ty(), APInt(64, llvm::size(func.args())));
       llvm::Value *retPtrPtr =
-          builder.CreateGEP(builder.getInt8Ty(), argList, retIndex);
+          builder.CreateGEP(builder.getInt8PtrTy(), argList, retIndex);
       llvm::Value *retPtr = builder.CreateLoad(builder.getInt8PtrTy(),
                                                retPtrPtr);
       retPtr = builder.CreateBitCast(retPtr, result->getType()->getPointerTo());


        


More information about the Mlir-commits mailing list