From 099d49099e1bd3ebb9da4905ef6bbefc683302f0 Mon Sep 17 00:00:00 2001 From: akashk4 <akashk4@illinois.edu> Date: Tue, 31 Dec 2019 08:24:37 -0600 Subject: [PATCH] Assert that the VISC launch's function argument is a defined constant. --- llvm/tools/hpvm/lib/Transforms/GenVISC/GenVISC.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/tools/hpvm/lib/Transforms/GenVISC/GenVISC.cpp b/llvm/tools/hpvm/lib/Transforms/GenVISC/GenVISC.cpp index ecd1d460ea..b1d265b132 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."); -- GitLab