From 76b0ea7f2d5c935bc7975d6b77db20f947e13f9a Mon Sep 17 00:00:00 2001 From: Roman Tereshin Date: Mon, 10 Aug 2020 23:29:39 -0700 Subject: [PATCH] Reset NextFnNum in MachineModuleInfo::initialize In an env that reuses compiler instances for multiple compilations, this omission results in non-deterministic assembly output (names of the auto-generated labels) if the order or full set of Modules compiled varies. Differential Revision: https://reviews.llvm.org/D100797 --- llvm/lib/CodeGen/MachineModuleInfo.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp index b436633..776b7f5 100644 --- a/llvm/lib/CodeGen/MachineModuleInfo.cpp +++ b/llvm/lib/CodeGen/MachineModuleInfo.cpp @@ -196,6 +196,7 @@ void MMIAddrLabelMapCallbackPtr::allUsesReplacedWith(Value *V2) { void MachineModuleInfo::initialize() { ObjFileMMI = nullptr; CurCallSite = 0; + NextFnNum = 0; UsesMSVCFloatingPoint = UsesMorestackAddr = false; HasSplitStack = HasNosplitStack = false; AddrLabelSymbols = nullptr; -- 2.7.4