[llvm] r266837 - ScoreboardHazardRecognizer: unbreak TSAN by moving a static mutated variable to a member

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 17:21:24 PDT 2016


Author: mehdi_amini
Date: Tue Apr 19 19:21:24 2016
New Revision: 266837

URL: http://llvm.org/viewvc/llvm-project?rev=266837&view=rev
Log:
ScoreboardHazardRecognizer: unbreak TSAN by moving a static mutated variable to a member

From: Mehdi Amini <mehdi.amini at apple.com>

Modified:
    llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
    llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp

Modified: llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h?rev=266837&r1=266836&r2=266837&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h (original)
+++ llvm/trunk/include/llvm/CodeGen/ScoreboardHazardRecognizer.h Tue Apr 19 19:21:24 2016
@@ -83,11 +83,9 @@ class ScoreboardHazardRecognizer : publi
     void dump() const;
   };
 
-#ifndef NDEBUG
   // Support for tracing ScoreboardHazardRecognizer as a component within
-  // another module. Follows the current thread-unsafe model of tracing.
-  static const char *DebugType;
-#endif
+  // another module.
+  const char *DebugType;
 
   // Itinerary data for the target.
   const InstrItineraryData *ItinData;

Modified: llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp?rev=266837&r1=266836&r2=266837&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/ScoreboardHazardRecognizer.cpp Tue Apr 19 19:21:24 2016
@@ -23,22 +23,13 @@
 
 using namespace llvm;
 
-#define DEBUG_TYPE ::llvm::ScoreboardHazardRecognizer::DebugType
+#define DEBUG_TYPE DebugType
 
-#ifndef NDEBUG
-const char *ScoreboardHazardRecognizer::DebugType = "";
-#endif
-
-ScoreboardHazardRecognizer::
-ScoreboardHazardRecognizer(const InstrItineraryData *II,
-                           const ScheduleDAG *SchedDAG,
-                           const char *ParentDebugType) :
-  ScheduleHazardRecognizer(), ItinData(II), DAG(SchedDAG), IssueWidth(0),
-  IssueCount(0) {
-
-#ifndef NDEBUG
-  DebugType = ParentDebugType;
-#endif
+ScoreboardHazardRecognizer::ScoreboardHazardRecognizer(
+    const InstrItineraryData *II, const ScheduleDAG *SchedDAG,
+    const char *ParentDebugType)
+    : ScheduleHazardRecognizer(), DebugType(ParentDebugType), ItinData(II),
+      DAG(SchedDAG), IssueWidth(0), IssueCount(0) {
 
   // Determine the maximum depth of any itinerary. This determines the depth of
   // the scoreboard. We always make the scoreboard at least 1 cycle deep to




More information about the llvm-commits mailing list