Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: src/IceCfgNode.cpp

Issue 1179313004: Fix a bug that would cause subzero to fail when --threads=0. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Addresses code review comments. Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/IceCompiler.cpp » ('j') | src/IceCompiler.cpp » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===// 1 //===- subzero/src/IceCfgNode.cpp - Basic block (node) implementation -----===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 // 9 //
10 // This file implements the CfgNode class, including the complexities 10 // This file implements the CfgNode class, including the complexities
(...skipping 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after
1249 1249
1250 GlobalContext *Context = Func->getContext(); 1250 GlobalContext *Context = Func->getContext();
1251 1251
1252 bool BadIntrinsic = false; 1252 bool BadIntrinsic = false;
1253 const Intrinsics::FullIntrinsicInfo *Info = 1253 const Intrinsics::FullIntrinsicInfo *Info =
1254 Context->getIntrinsicsInfo().find(RMW_I64, BadIntrinsic); 1254 Context->getIntrinsicsInfo().find(RMW_I64, BadIntrinsic);
1255 assert(!BadIntrinsic); 1255 assert(!BadIntrinsic);
1256 assert(Info != nullptr); 1256 assert(Info != nullptr);
1257 1257
1258 Operand *RMWI64Name = Context->getConstantExternSym(RMW_I64); 1258 Operand *RMWI64Name = Context->getConstantExternSym(RMW_I64);
1259 Constant *Counter = Context->getConstantExternSym(Var->getName()); 1259 constexpr RelocOffsetT Offset = 0;
1260 constexpr bool SuppressMangling = true;
1261 Constant *Counter =
1262 Context->getConstantSym(Offset, Var->getName(), SuppressMangling);
1260 Constant *AtomicRMWOp = Context->getConstantInt32(Intrinsics::AtomicAdd); 1263 Constant *AtomicRMWOp = Context->getConstantInt32(Intrinsics::AtomicAdd);
1261 Constant *One = Context->getConstantInt64(1); 1264 Constant *One = Context->getConstantInt64(1);
1262 Constant *OrderAcquireRelease = 1265 Constant *OrderAcquireRelease =
1263 Context->getConstantInt32(Intrinsics::MemoryOrderAcquireRelease); 1266 Context->getConstantInt32(Intrinsics::MemoryOrderAcquireRelease);
1264 1267
1265 InstIntrinsicCall *Inst = InstIntrinsicCall::create( 1268 InstIntrinsicCall *Inst = InstIntrinsicCall::create(
1266 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info); 1269 Func, 5, Func->makeVariable(IceType_i64), RMWI64Name, Info->Info);
1267 Inst->addArg(AtomicRMWOp); 1270 Inst->addArg(AtomicRMWOp);
1268 Inst->addArg(Counter); 1271 Inst->addArg(Counter);
1269 Inst->addArg(One); 1272 Inst->addArg(One);
1270 Inst->addArg(OrderAcquireRelease); 1273 Inst->addArg(OrderAcquireRelease);
1271 Insts.push_front(Inst); 1274 Insts.push_front(Inst);
1272 } 1275 }
1273 1276
1274 } // end of namespace Ice 1277 } // end of namespace Ice
OLDNEW
« no previous file with comments | « no previous file | src/IceCompiler.cpp » ('j') | src/IceCompiler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698