diff --git a/llvm/tools/hpvm/lib/Transforms/GenVISC/GenVISC.cpp b/llvm/tools/hpvm/lib/Transforms/GenVISC/GenVISC.cpp index ecd1d460eac68fe187f84269dc7b40552ccb118f..b1d265b132ff05289748efd6f131fdeac9ae54ab 100644 --- a/llvm/tools/hpvm/lib/Transforms/GenVISC/GenVISC.cpp +++ b/llvm/tools/hpvm/lib/Transforms/GenVISC/GenVISC.cpp @@ -941,6 +941,7 @@ bool GenVISC::runOnModule(Module &M) { Function* graphFunc = cast<Function>(CI->getArgOperand(1)); graphFunc = transformReturnTypeToStruct(graphFunc); Constant* F = ConstantExpr::getPointerCast(graphFunc, Type::getInt8PtrTy(Ctx)); + assert(F && "Function invoked by VISC launch has to be define and constant."); ConstantInt* Op = cast<ConstantInt>(CI->getArgOperand(0)); assert(Op && "VISC launch's streaming argument is a constant value.");