| Index: src/IceCfgNode.cpp
|
| diff --git a/src/IceCfgNode.cpp b/src/IceCfgNode.cpp
|
| index c7a3d8164dbac270c6aab547970f4a6277afb81f..02b9aacb75f564ee48c0fe655c7c9ad7b0493e45 100644
|
| --- a/src/IceCfgNode.cpp
|
| +++ b/src/IceCfgNode.cpp
|
| @@ -901,8 +901,9 @@ class BundleEmitHelper {
|
| BundleEmitHelper &operator=(const BundleEmitHelper &) = delete;
|
|
|
| public:
|
| - BundleEmitHelper(Assembler *Asm, const InstList &Insts)
|
| - : Asm(Asm), End(Insts.end()), BundleLockStart(End),
|
| + BundleEmitHelper(Assembler *Asm, TargetLowering *Target,
|
| + const InstList &Insts)
|
| + : Asm(Asm), Target(Target), End(Insts.end()), BundleLockStart(End),
|
| BundleSize(1 << Asm->getBundleAlignLog2Bytes()),
|
| BundleMaskLo(BundleSize - 1), BundleMaskHi(~BundleMaskLo),
|
| SizeSnapshotPre(0), SizeSnapshotPost(0) {}
|
| @@ -948,6 +949,7 @@ public:
|
| BundleLockStart = I;
|
| SizeSnapshotPre = Asm->getBufferSize();
|
| Asm->setPreliminary(true);
|
| + Target->snapshotEmitState();
|
| assert(isInBundleLockRegion());
|
| }
|
| // Update bookkeeping when the bundle_unlock instruction is
|
| @@ -989,10 +991,12 @@ public:
|
| assert(isInBundleLockRegion());
|
| Asm->setBufferSize(SizeSnapshotPre);
|
| Asm->setPreliminary(false);
|
| + Target->rollbackEmitState();
|
| }
|
|
|
| private:
|
| Assembler *const Asm;
|
| + TargetLowering *const Target;
|
| // End is a sentinel value such that BundleLockStart==End implies
|
| // that we are not in a bundle_lock region.
|
| const InstList::const_iterator End;
|
| @@ -1047,7 +1051,7 @@ void CfgNode::emitIAS(Cfg *Func) const {
|
| // of label bindings, label links, and relocation fixups. Instead,
|
| // the first pass just disables all mutation of that state.
|
|
|
| - BundleEmitHelper Helper(Asm, Insts);
|
| + BundleEmitHelper Helper(Asm, Func->getTarget(), Insts);
|
| InstList::const_iterator End = Insts.end();
|
| // Retrying indicates that we had to roll back to the bundle_lock
|
| // instruction to apply padding before the bundle_lock sequence.
|
|
|