diff --git a/bolt/include/bolt/Core/BinaryFunction.h b/bolt/include/bolt/Core/BinaryFunction.h index ca8b786f4ab69..af7149e49c840 100644 --- a/bolt/include/bolt/Core/BinaryFunction.h +++ b/bolt/include/bolt/Core/BinaryFunction.h @@ -1663,7 +1663,8 @@ class BinaryFunction { Offset = I->first; } assert(I->first == Offset && "CFI pointing to unknown instruction"); - if (I == Instructions.begin()) { + if (I == Instructions.begin() && + Inst.getOperation() != MCCFIInstruction::OpRememberState) { CIEFrameInstructions.emplace_back(std::forward(Inst)); return; }