[PATCH] D149639: Revert part of D149033 b/c original code is correct

Kan Shengchen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 2 02:46:00 PDT 2023


skan created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
skan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The test case added by rG8f966cedea594d9a91e585e88a80a42c04049e6c <https://reviews.llvm.org/rG8f966cedea594d9a91e585e88a80a42c04049e6c>
is kept to avoid future regression.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D149639

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


Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5451,7 +5451,7 @@
   // 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 @@
     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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149639.518661.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230502/a546fab6/attachment.bin>


More information about the llvm-commits mailing list