mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-15 20:40:30 +00:00
add some comments to describe the invariants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81173 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f8dbee7cea
commit
cf5128ec01
@ -29,6 +29,12 @@ namespace llvm {
|
|||||||
/// known to be either zero or one and return them in the KnownZero/KnownOne
|
/// 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
|
/// bit sets. This code only analyzes bits in Mask, in order to short-circuit
|
||||||
/// processing.
|
/// processing.
|
||||||
|
///
|
||||||
|
/// This function is defined on values with integer type, values with pointer
|
||||||
|
/// type (but only if TD is non-null), and vectors of integers. In the case
|
||||||
|
/// where V is a vector, the mask, known zero, and known one values are the
|
||||||
|
/// same width as the vector element, and the bit is set only if it is true
|
||||||
|
/// for all of the elements in the vector.
|
||||||
void ComputeMaskedBits(Value *V, const APInt &Mask, APInt &KnownZero,
|
void ComputeMaskedBits(Value *V, const APInt &Mask, APInt &KnownZero,
|
||||||
APInt &KnownOne, const TargetData *TD = 0,
|
APInt &KnownOne, const TargetData *TD = 0,
|
||||||
unsigned Depth = 0);
|
unsigned Depth = 0);
|
||||||
@ -36,6 +42,12 @@ namespace llvm {
|
|||||||
/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
|
/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
|
||||||
/// this predicate to simplify operations downstream. Mask is known to be
|
/// this predicate to simplify operations downstream. Mask is known to be
|
||||||
/// zero for bits that V cannot have.
|
/// zero for bits that V cannot have.
|
||||||
|
///
|
||||||
|
/// This function is defined on values with integer type, values with pointer
|
||||||
|
/// type (but only if TD is non-null), and vectors of integers. In the case
|
||||||
|
/// where V is a vector, the mask, known zero, and known one values are the
|
||||||
|
/// same width as the vector element, and the bit is set only if it is true
|
||||||
|
/// for all of the elements in the vector.
|
||||||
bool MaskedValueIsZero(Value *V, const APInt &Mask,
|
bool MaskedValueIsZero(Value *V, const APInt &Mask,
|
||||||
const TargetData *TD = 0, unsigned Depth = 0);
|
const TargetData *TD = 0, unsigned Depth = 0);
|
||||||
|
|
||||||
|
@ -35,6 +35,12 @@ using namespace llvm;
|
|||||||
/// optimized based on the contradictory assumption that it is non-zero.
|
/// optimized based on the contradictory assumption that it is non-zero.
|
||||||
/// Because instcombine aggressively folds operations with undef args anyway,
|
/// Because instcombine aggressively folds operations with undef args anyway,
|
||||||
/// this won't lose us code quality.
|
/// this won't lose us code quality.
|
||||||
|
///
|
||||||
|
/// This function is defined on values with integer type, values with pointer
|
||||||
|
/// type (but only if TD is non-null), and vectors of integers. In the case
|
||||||
|
/// where V is a vector, the mask, known zero, and known one values are the
|
||||||
|
/// same width as the vector element, and the bit is set only if it is true
|
||||||
|
/// for all of the elements in the vector.
|
||||||
void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
|
void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
|
||||||
APInt &KnownZero, APInt &KnownOne,
|
APInt &KnownZero, APInt &KnownOne,
|
||||||
const TargetData *TD, unsigned Depth) {
|
const TargetData *TD, unsigned Depth) {
|
||||||
@ -608,6 +614,12 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
|
|||||||
/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
|
/// MaskedValueIsZero - Return true if 'V & Mask' is known to be zero. We use
|
||||||
/// this predicate to simplify operations downstream. Mask is known to be zero
|
/// this predicate to simplify operations downstream. Mask is known to be zero
|
||||||
/// for bits that V cannot have.
|
/// for bits that V cannot have.
|
||||||
|
///
|
||||||
|
/// This function is defined on values with integer type, values with pointer
|
||||||
|
/// type (but only if TD is non-null), and vectors of integers. In the case
|
||||||
|
/// where V is a vector, the mask, known zero, and known one values are the
|
||||||
|
/// same width as the vector element, and the bit is set only if it is true
|
||||||
|
/// for all of the elements in the vector.
|
||||||
bool llvm::MaskedValueIsZero(Value *V, const APInt &Mask,
|
bool llvm::MaskedValueIsZero(Value *V, const APInt &Mask,
|
||||||
const TargetData *TD, unsigned Depth) {
|
const TargetData *TD, unsigned Depth) {
|
||||||
APInt KnownZero(Mask.getBitWidth(), 0), KnownOne(Mask.getBitWidth(), 0);
|
APInt KnownZero(Mask.getBitWidth(), 0), KnownOne(Mask.getBitWidth(), 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user