Chromium Code Reviews| Index: src/IceCfgNode.cpp |
| diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp |
| index a9017536485cbd1c45a834e99386c8966cb58bfd..44206f696f3afecfb9f724a4c16c644cd30617a3 100644 |
| --- a/src/IceCfgNode.cpp |
| +++ b/src/IceCfgNode.cpp |
| @@ -490,18 +490,22 @@ void CfgNode::doNopInsertion() { |
| TargetLowering *Target = Func->getTarget(); |
| LoweringContext &Context = Target->getContext(); |
| Context.init(this); |
| + Context.setInsertPoint(Context.getCur()); |
| + // Do not insert nop in bundle locked instructions. |
| + bool PauseNopInsertion = false; |
| while (!Context.atEnd()) { |
| - Target->doNopInsertion(); |
| + if (llvm::isa<InstBundleLock>(Context.getCur())) { |
| + PauseNopInsertion = true; |
| + } else if (llvm::isa<InstBundleUnlock>(Context.getCur())) { |
| + PauseNopInsertion = false; |
| + } |
| + if (!PauseNopInsertion) |
| + Target->doNopInsertion(); |
|
jvoung (off chromium)
2015/07/29 18:09:18
On BundleUnlock what happens? Does it insert nops
qining
2015/07/29 23:04:40
On BundleUnlock, we resume nop insertion. At that
|
| // Ensure Cur=Next, so that the nops are inserted before the current |
| // instruction rather than after. |
| - Context.advanceNext(); |
| Context.advanceCur(); |
| + Context.advanceNext(); |
| } |
| - // Insert before all instructions. |
| - Context.setInsertPoint(getInsts().begin()); |
| - Context.advanceNext(); |
| - Context.advanceCur(); |
| - Target->doNopInsertion(); |
| } |
| // Drives the target lowering. Passes the current instruction and the |