From 0d304f01b4d7839de2d9508d444c348654ed3ee4 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 16 Apr 2017 20:55:58 +0000 Subject: [InstCombine] In SimplifyDemandedUseBits, don't bother to mask known bits of constants with DemandedMask. Just because we didn't demand them doesn't mean they aren't known. llvm-svn: 300430 --- llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp index 4e6f02058d8..246fd6bdf5a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp @@ -120,14 +120,14 @@ Value *InstCombiner::SimplifyDemandedUseBits(Value *V, APInt DemandedMask, const APInt *C; if (match(V, m_APInt(C))) { // We know all of the bits for a scalar constant or a splat vector constant! - KnownOne = *C & DemandedMask; - KnownZero = ~KnownOne & DemandedMask; + KnownOne = *C; + KnownZero = ~KnownOne; return nullptr; } if (isa(V)) { // We know all of the bits for a constant! KnownOne.clearAllBits(); - KnownZero = DemandedMask; + KnownZero.setAllBits(); return nullptr; } -- cgit v1.2.3