Skip to content
Snippets Groups Projects
Commit 76b50a97 authored by Akash Kothari's avatar Akash Kothari :speech_balloon:
Browse files

Added bug fix for root arguments passed to visc_launch

parent 470f716f
No related branches found
No related tags found
No related merge requests found
...@@ -945,8 +945,13 @@ bool GenVISC::runOnModule(Module &M) { ...@@ -945,8 +945,13 @@ bool GenVISC::runOnModule(Module &M) {
ConstantInt* Op = cast<ConstantInt>(CI->getArgOperand(0)); ConstantInt* Op = cast<ConstantInt>(CI->getArgOperand(0));
Value* isStreaming = Op->isZero()? ConstantInt::getFalse(Ctx) Value* isStreaming = Op->isZero()? ConstantInt::getFalse(Ctx)
: ConstantInt::getTrue(Ctx); : ConstantInt::getTrue(Ctx);
Value* LaunchArgs[] = {F, CI->getArgOperand(2), isStreaming}; auto *ArgTy = dyn_cast<PointerType>(CI->getArgOperand(2)->getType());
assert(ArgTy && "VISC launch argument should be pointer type.");
Value *Arg = CI->getArgOperand(2);
if(!ArgTy->getElementType()->isIntegerTy(8))
Arg = BitCastInst::CreatePointerCast(CI->getArgOperand(2), Type::getInt8PtrTy(Ctx), "", CI);
Value* LaunchArgs[] = {F, Arg, isStreaming};
CallInst* LaunchInst = CallInst::Create(LaunchF, CallInst* LaunchInst = CallInst::Create(LaunchF,
ArrayRef<Value*>(LaunchArgs, 3), ArrayRef<Value*>(LaunchArgs, 3),
"graphID", CI); "graphID", CI);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment