[llvm] 3910a9f - Revert part of D149033 b/c original code is correct

Shengchen Kan via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 21:20:26 PDT 2023


Author: Shengchen Kan
Date: 2023-05-03T12:20:19+08:00
New Revision: 3910a9fcb2fb0a6c38305364a0e0382e05ddfbfc

URL: https://github.com/llvm/llvm-project/commit/3910a9fcb2fb0a6c38305364a0e0382e05ddfbfc
DIFF: https://github.com/llvm/llvm-project/commit/3910a9fcb2fb0a6c38305364a0e0382e05ddfbfc.diff

LOG: Revert part of D149033 b/c original code is correct

This reverts part of D149033 and  rG8f966cedea594d9a91e585e88a80a42c04049e6c. The added test case
is kept to avoid future regression.

Reviewed By: vzakhari, vdonaldson

Differential Revision: https://reviews.llvm.org/D149639

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 9d6ad1144e29..df6b24f86941 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5451,7 +5451,7 @@ static SDValue ExpandPowI(const SDLoc &DL, SDValue LHS, SDValue RHS,
   // it's beneficial on the target, otherwise we end up lowering to a call to
   // __powidf2 (for example).
   if (ConstantSDNode *RHSC = dyn_cast<ConstantSDNode>(RHS)) {
-    int64_t Val = RHSC->getSExtValue();
+    unsigned Val = RHSC->getSExtValue();
 
     // powi(x, 0) -> 1.0
     if (Val == 0)
@@ -5460,7 +5460,7 @@ static SDValue ExpandPowI(const SDLoc &DL, SDValue LHS, SDValue RHS,
     if (DAG.getTargetLoweringInfo().isBeneficialToExpandPowI(
             Val, DAG.shouldOptForSize())) {
       // Get the exponent as a positive value.
-      if (Val < 0)
+      if ((int)Val < 0)
         Val = -Val;
       // We use the simple binary decomposition method to generate the multiply
       // sequence.  There are more optimal ways to do this (for example,


        


More information about the llvm-commits mailing list