[llvm-branch-commits] [llvm] 2304528 - [ConstraintElimination] Make sure arguments of std:pow match.

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Dec 2 14:28:33 PST 2020


Author: Florian Hahn
Date: 2020-12-02T22:23:26Z
New Revision: 2304528bb54a224fbae26b5f7b2b4d5e2f810a43

URL: https://github.com/llvm/llvm-project/commit/2304528bb54a224fbae26b5f7b2b4d5e2f810a43
DIFF: https://github.com/llvm/llvm-project/commit/2304528bb54a224fbae26b5f7b2b4d5e2f810a43.diff

LOG: [ConstraintElimination] Make sure arguments of std:pow match.

This should fix a build failure on some systems, e.g. solaris11-sparcv9
http://lab.llvm.org:8014/#/builders/22

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index 8e7480bea284..b2465d2721ef 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -63,12 +63,12 @@ static SmallVector<std::pair<int64_t, Value *>, 4> decompose(Value *V) {
               m_NUWShl(m_Value(Op0), m_ConstantInt(CI))))
       return {{0, nullptr},
               {1, GEP->getPointerOperand()},
-              {pow(2, CI->getSExtValue()), Op0}};
+              {std::pow(int64_t(2), CI->getSExtValue()), Op0}};
     if (match(GEP->getOperand(GEP->getNumOperands() - 1),
               m_ZExt(m_NUWShl(m_Value(Op0), m_ConstantInt(CI)))))
       return {{0, nullptr},
               {1, GEP->getPointerOperand()},
-              {pow(2, CI->getSExtValue()), Op0}};
+              {std::pow(int64_t(2), CI->getSExtValue()), Op0}};
 
     return {{0, nullptr},
             {1, GEP->getPointerOperand()},


        


More information about the llvm-branch-commits mailing list