//===- ValueTracking.cpp - Walk computations to compute properties --------===////// The LLVM Compiler Infrastructure//// This file is distributed under the University of Illinois Open Source// License. See LICENSE.TXT for details.////===----------------------------------------------------------------------===////// This file contains routines that help analyze properties that chains of// computations have.////===----------------------------------------------------------------------===//#include"llvm/Analysis/ValueTracking.h"#include"llvm/Analysis/InstructionSimplify.h"#include"llvm/Constants.h"#include"llvm/Instructions.h"#include"llvm/GlobalVariable.h"#include"llvm/GlobalAlias.h"#include"llvm/IntrinsicInst.h"#include"llvm/LLVMContext.h"#include"llvm/Operator.h"#include"llvm/Target/TargetData.h"#include"llvm/Support/GetElementPtrTypeIterator.h"#include"llvm/Support/MathExtras.h"#include"llvm/ADT/SmallPtrSet.h"#include<cstring>usingnamespacellvm;/// ComputeMaskedBits - Determine which of the bits specified in Mask are/// known to be either zero or one and return them in the KnownZero/KnownOne/// bit sets. This code only analyzes bits in Mask, in order to short-circuit/// processing./// NOTE: we cannot consider 'undef' to be "IsZero" here. The problem is that/// we cannot optimize based on the assumption that it is zero without changing/// it to be an explicit zero. If we don't change it to zero, other code could/// optimized based on the contradictory assumption that it is non-zero./// Because instcombine aggressively