From: Davide Italiano Date: Tue, 10 May 2016 19:49:47 +0000 (+0000) Subject: [SCCP] Partially propagate informations when the input is not fully defined. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f206cf7b0203c1c9d3d71838f3f4579864bf985;p=llvm [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@269105 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/SCCP.cpp b/lib/Transforms/Scalar/SCCP.cpp index 75414ef3864..49748ff4c43 100644 --- a/lib/Transforms/Scalar/SCCP.cpp +++ b/lib/Transforms/Scalar/SCCP.cpp @@ -1331,6 +1331,9 @@ bool SCCPSolver::ResolvedUndefsIn(Function &F) { } 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. diff --git a/test/Transforms/ConstProp/shift.ll b/test/Transforms/ConstProp/shift.ll index de23fe98ad8..91027096dd5 100644 --- a/test/Transforms/ConstProp/shift.ll +++ b/test/Transforms/ConstProp/shift.ll @@ -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) {