From f0aeee01c36b9b84afd4ccc5834df61b6b9f6a13 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Fri, 5 May 2017 17:36:09 +0000 Subject: [KnownBits] Add wrapper methods for setting and clear all bits in the underlying APInts in KnownBits. This adds routines for reseting KnownBits to unknown, making the value all zeros or all ones. It also adds methods for querying if the value is zero, all ones or unknown. Differential Revision: https://reviews.llvm.org/D32637 llvm-svn: 302262 --- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 60970775de6..34ce235b3fe 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -4050,7 +4050,7 @@ Instruction *InstCombiner::foldICmpUsingKnownBits(ICmpInst &I) { // is set. If the comparison is against zero, then this is a check to see if // *that* bit is set. APInt Op0KnownZeroInverted = ~Op0Known.Zero; - if (~Op1Known.Zero == 0) { + if (Op1Known.isZero()) { // If the LHS is an AND with the same constant, look through it. Value *LHS = nullptr; const APInt *LHSC; -- cgit v1.2.3