@@ -1403,11 +1403,11 @@ convertOmpParallel(omp::ParallelOp opInst, llvm::IRBuilderBase &builder,
14031403 llvm::Value *nonPrivateVar =
14041404 moduleTranslation.lookupValue (opInst.getPrivateVars ()[i]);
14051405 assert (nonPrivateVar);
1406- moduleTranslation.mapValue (allocRegion. getArgument ( 0 ), nonPrivateVar);
1406+ moduleTranslation.mapValue (privateDecls[i]. getAllocMoldArg ( ), nonPrivateVar);
14071407
14081408 // in-place convert the private allocation region
14091409 SmallVector<llvm::Value *, 1 > phis;
1410- if (allocRegion. getArgument ( 0 ).getUses ().empty ()) {
1410+ if (privateDecls[i]. getAllocMoldArg ( ).getUses ().empty ()) {
14111411 // TODO this should use
14121412 // allocaIP.getBlock()->getFirstNonPHIOrDbgOrAlloca() so it goes before
14131413 // the code for fetching the thread id. Not doing this for now to avoid
@@ -1475,10 +1475,10 @@ convertOmpParallel(omp::ParallelOp opInst, llvm::IRBuilderBase &builder,
14751475 llvm::Value *nonPrivateVar =
14761476 moduleTranslation.lookupValue (opInst.getPrivateVars ()[i]);
14771477 assert (nonPrivateVar);
1478- moduleTranslation.mapValue (copyRegion. getArgument ( 0 ), nonPrivateVar);
1478+ moduleTranslation.mapValue (privateDecls[i]. getCopyMoldArg ( ), nonPrivateVar);
14791479
14801480 // map copyRegion lhs arg
1481- moduleTranslation.mapValue (copyRegion. getArgument ( 1 ), llvmPrivateVars[i]);
1481+ moduleTranslation.mapValue (privateDecls[i]. getCopyPrivateArg ( ), llvmPrivateVars[i]);
14821482
14831483 // in-place convert copy region
14841484 builder.SetInsertPoint (builder.GetInsertBlock ()->getTerminator ());
0 commit comments