[llvm] 5deb678 - Revert "[SampleProfileInference] Work around odr-use of const non-inline static data member to fix -O0 builds after D120508"

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 6 16:48:27 PDT 2022


Author: Fangrui Song
Date: 2022-08-06T16:48:23-07:00
New Revision: 5deb678289df4a11d5c0786d702ad2730cd7e391

URL: https://github.com/llvm/llvm-project/commit/5deb678289df4a11d5c0786d702ad2730cd7e391
DIFF: https://github.com/llvm/llvm-project/commit/5deb678289df4a11d5c0786d702ad2730cd7e391.diff

LOG: Revert "[SampleProfileInference] Work around odr-use of const non-inline static data member to fix -O0 builds after D120508"

This reverts commit 48c74bb2e2a72830f1068823bfc2f6fd4b53d427.
With C++17 the workaround is no longer needed.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/SampleProfileInference.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
index 5e92b9852a9f8..d9005be2c8f3a 100644
--- a/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
+++ b/llvm/lib/Transforms/Utils/SampleProfileInference.cpp
@@ -740,7 +740,7 @@ class FlowAdjuster {
   /// parts to a multiple of 1 / BaseDistance.
   int64_t jumpDistance(FlowJump *Jump) const {
     uint64_t BaseDistance =
-        std::max(static_cast<uint64_t>(MinCostMaxFlow::MinBaseDistance),
+        std::max(MinCostMaxFlow::MinBaseDistance,
                  std::min(Func.Blocks[Func.Entry].Flow,
                           MinCostMaxFlow::AuxCostUnlikely / NumBlocks()));
     if (Jump->IsUnlikely)


        


More information about the llvm-commits mailing list