[llvm] 76b0ea7 - Reset NextFnNum in MachineModuleInfo::initialize

Daniel Sanders via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 15:51:47 PDT 2021


Author: Roman Tereshin
Date: 2021-04-19T15:51:30-07:00
New Revision: 76b0ea7f2d5c935bc7975d6b77db20f947e13f9a

URL: https://github.com/llvm/llvm-project/commit/76b0ea7f2d5c935bc7975d6b77db20f947e13f9a
DIFF: https://github.com/llvm/llvm-project/commit/76b0ea7f2d5c935bc7975d6b77db20f947e13f9a.diff

LOG: 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

Added: 
    

Modified: 
    llvm/lib/CodeGen/MachineModuleInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MachineModuleInfo.cpp b/llvm/lib/CodeGen/MachineModuleInfo.cpp
index b436633d4268..776b7f51479f 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;


        


More information about the llvm-commits mailing list