[llvm] r269105 - [SCCP] Partially propagate informations when the input is not fully defined.

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 12:49:48 PDT 2016


Author: davide
Date: Tue May 10 14:49:47 2016
New Revision: 269105

URL: http://llvm.org/viewvc/llvm-project?rev=269105&view=rev
Log:
[SCCP] Partially propagate informations when the input is not fully defined.

With this patch:
%r1 = lshr i64 -1, 4294967296 -> undef

Before this patch:
%r1 = lshr i64 -1, 4294967296 -> 0

Modified:
    llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
    llvm/trunk/test/Transforms/ConstProp/shift.ll

Modified: llvm/trunk/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SCCP.cpp?rev=269105&r1=269104&r2=269105&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SCCP.cpp Tue May 10 14:49:47 2016
@@ -1331,6 +1331,9 @@ bool SCCPSolver::ResolvedUndefsIn(Functi
         }
 
         Op1LV = getValueState(I.getOperand(1));
+
+        if (!Op0LV.isUndefined() && !Op1LV.isUndefined())
+          break;
       }
       // If this is an instructions whose result is defined even if the input is
       // not fully defined, propagate the information.

Modified: llvm/trunk/test/Transforms/ConstProp/shift.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/ConstProp/shift.ll?rev=269105&r1=269104&r2=269105&view=diff
==============================================================================
--- llvm/trunk/test/Transforms/ConstProp/shift.ll (original)
+++ llvm/trunk/test/Transforms/ConstProp/shift.ll Tue May 10 14:49:47 2016
@@ -1,4 +1,5 @@
 ; RUN: opt < %s -constprop -S | FileCheck %s
+; RUN: opt < %s -sccp -S | FileCheck %s
 
 ; CHECK-LABEL: shift_undef_64
 define void @shift_undef_64(i64* %p) {




More information about the llvm-commits mailing list