LLVM 24.0.0git
CorrelatedValuePropagation.cpp File Reference

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "correlated-value-propagation"

Enumerations

enum class  Domain { NonNegative , NonPositive , Unknown }

Functions

 STATISTIC (NumPhis, "Number of phis propagated")
 STATISTIC (NumPhiCommon, "Number of phis deleted via common incoming value")
 STATISTIC (NumSelects, "Number of selects propagated")
 STATISTIC (NumCmps, "Number of comparisons propagated")
 STATISTIC (NumReturns, "Number of return values propagated")
 STATISTIC (NumDeadCases, "Number of switch cases removed")
 STATISTIC (NumSDivSRemsNarrowed, "Number of sdivs/srems whose width was decreased")
 STATISTIC (NumSDivs, "Number of sdiv converted to udiv")
 STATISTIC (NumUDivURemsNarrowed, "Number of udivs/urems whose width was decreased")
 STATISTIC (NumAShrsConverted, "Number of ashr converted to lshr")
 STATISTIC (NumAShrsRemoved, "Number of ashr removed")
 STATISTIC (NumSRems, "Number of srem converted to urem")
 STATISTIC (NumSExt, "Number of sext converted to zext")
 STATISTIC (NumSIToFP, "Number of sitofp converted to uitofp")
 STATISTIC (NumSICmps, "Number of signed icmp preds simplified to unsigned")
 STATISTIC (NumAnd, "Number of ands removed")
 STATISTIC (NumNW, "Number of no-wrap deductions")
 STATISTIC (NumNSW, "Number of no-signed-wrap deductions")
 STATISTIC (NumNUW, "Number of no-unsigned-wrap deductions")
 STATISTIC (NumAddNW, "Number of no-wrap deductions for add")
 STATISTIC (NumAddNSW, "Number of no-signed-wrap deductions for add")
 STATISTIC (NumAddNUW, "Number of no-unsigned-wrap deductions for add")
 STATISTIC (NumSubNW, "Number of no-wrap deductions for sub")
 STATISTIC (NumSubNSW, "Number of no-signed-wrap deductions for sub")
 STATISTIC (NumSubNUW, "Number of no-unsigned-wrap deductions for sub")
 STATISTIC (NumMulNW, "Number of no-wrap deductions for mul")
 STATISTIC (NumMulNSW, "Number of no-signed-wrap deductions for mul")
 STATISTIC (NumMulNUW, "Number of no-unsigned-wrap deductions for mul")
 STATISTIC (NumShlNW, "Number of no-wrap deductions for shl")
 STATISTIC (NumShlNSW, "Number of no-signed-wrap deductions for shl")
 STATISTIC (NumShlNUW, "Number of no-unsigned-wrap deductions for shl")
 STATISTIC (NumAbs, "Number of llvm.abs intrinsics removed")
 STATISTIC (NumOverflows, "Number of overflow checks removed")
 STATISTIC (NumSaturating, "Number of saturating arithmetics converted to normal arithmetics")
 STATISTIC (NumNonNull, "Number of function pointer arguments marked non-null")
 STATISTIC (NumCmpIntr, "Number of llvm.[us]cmp intrinsics removed")
 STATISTIC (NumMinMax, "Number of llvm.[us]{min,max} intrinsics removed")
 STATISTIC (NumSMinMax, "Number of llvm.s{min,max} intrinsics simplified to unsigned")
 STATISTIC (NumUDivURemsNarrowedExpanded, "Number of bound udiv's/urem's expanded")
 STATISTIC (NumNNeg, "Number of zext/uitofp non-negative deductions")
static void setDeducedOverflowingFlags (Value *V, Instruction::BinaryOps Opcode, bool NewNSW, bool NewNUW)
static Domain getDomain (const ConstantRange &CR)
static bool narrowSDivOrSRem (BinaryOperator *Instr, const ConstantRange &LCR, const ConstantRange &RCR)
 Try to shrink a sdiv/srem's width down to the smallest power of two that's sufficient to contain its operands.
static bool expandUDivOrURem (BinaryOperator *Instr, const ConstantRange &XCR, const ConstantRange &YCR)
static bool narrowUDivOrURem (BinaryOperator *Instr, const ConstantRange &XCR, const ConstantRange &YCR)
 Try to shrink a udiv/urem's width down to the smallest power of two that's sufficient to contain its operands.
static NoWrapFlags computeNoWrapFlags (Instruction::BinaryOps Opcode, const ConstantRange &LRange, const ConstantRange &RRange, bool CheckNSW, bool CheckNUW)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "correlated-value-propagation"

Definition at line 49 of file CorrelatedValuePropagation.cpp.

Enumeration Type Documentation

◆ Domain

enum class Domain
strong
Enumerator
NonNegative 
NonPositive 
Unknown 

Definition at line 819 of file CorrelatedValuePropagation.cpp.

Function Documentation

◆ computeNoWrapFlags()

NoWrapFlags computeNoWrapFlags ( Instruction::BinaryOps Opcode,
const ConstantRange & LRange,
const ConstantRange & RRange,
bool CheckNSW,
bool CheckNUW )
static

◆ expandUDivOrURem()

◆ getDomain()

◆ narrowSDivOrSRem()

bool narrowSDivOrSRem ( BinaryOperator * Instr,
const ConstantRange & LCR,
const ConstantRange & RCR )
static

◆ narrowUDivOrURem()

bool narrowUDivOrURem ( BinaryOperator * Instr,
const ConstantRange & XCR,
const ConstantRange & YCR )
static

Try to shrink a udiv/urem's width down to the smallest power of two that's sufficient to contain its operands.

Definition at line 960 of file CorrelatedValuePropagation.cpp.

References assert(), B(), llvm::dyn_cast(), llvm::ConstantRange::getActiveBits(), llvm::BinaryOperator::getOpcode(), LHS, llvm::PowerOf2Ceil(), RHS, and llvm::Instruction::setIsExact().

◆ setDeducedOverflowingFlags()

void setDeducedOverflowingFlags ( Value * V,
Instruction::BinaryOps Opcode,
bool NewNSW,
bool NewNUW )
static

Definition at line 535 of file CorrelatedValuePropagation.cpp.

References llvm::dyn_cast(), and llvm_unreachable.

◆ STATISTIC() [1/40]

STATISTIC ( NumAbs ,
"Number of llvm.abs intrinsics removed"  )

◆ STATISTIC() [2/40]

STATISTIC ( NumAddNSW ,
"Number of no-signed-wrap deductions for add"  )

◆ STATISTIC() [3/40]

STATISTIC ( NumAddNUW ,
"Number of no-unsigned-wrap deductions for add"  )

◆ STATISTIC() [4/40]

STATISTIC ( NumAddNW ,
"Number of no-wrap deductions for add"  )

◆ STATISTIC() [5/40]

STATISTIC ( NumAnd ,
"Number of ands removed"  )

◆ STATISTIC() [6/40]

STATISTIC ( NumAShrsConverted ,
"Number of ashr converted to lshr"  )

◆ STATISTIC() [7/40]

STATISTIC ( NumAShrsRemoved ,
"Number of ashr removed"  )

◆ STATISTIC() [8/40]

STATISTIC ( NumCmpIntr ,
"Number of llvm.cmp intrinsics removed" [us] )

◆ STATISTIC() [9/40]

STATISTIC ( NumCmps ,
"Number of comparisons propagated"  )

◆ STATISTIC() [10/40]

STATISTIC ( NumDeadCases ,
"Number of switch cases removed"  )

◆ STATISTIC() [11/40]

STATISTIC ( NumMinMax ,
"Number of llvm.{min,max} intrinsics removed" [us] )

◆ STATISTIC() [12/40]

STATISTIC ( NumMulNSW ,
"Number of no-signed-wrap deductions for mul"  )

◆ STATISTIC() [13/40]

STATISTIC ( NumMulNUW ,
"Number of no-unsigned-wrap deductions for mul"  )

◆ STATISTIC() [14/40]

STATISTIC ( NumMulNW ,
"Number of no-wrap deductions for mul"  )

◆ STATISTIC() [15/40]

STATISTIC ( NumNNeg ,
"Number of zext/uitofp non-negative deductions"  )

References F.

◆ STATISTIC() [16/40]

STATISTIC ( NumNonNull ,
"Number of function pointer arguments marked non-null"  )

◆ STATISTIC() [17/40]

STATISTIC ( NumNSW ,
"Number of no-signed-wrap deductions"  )

◆ STATISTIC() [18/40]

STATISTIC ( NumNUW ,
"Number of no-unsigned-wrap deductions"  )

◆ STATISTIC() [19/40]

STATISTIC ( NumNW ,
"Number of no-wrap deductions"  )

◆ STATISTIC() [20/40]

STATISTIC ( NumOverflows ,
"Number of overflow checks removed"  )

◆ STATISTIC() [21/40]

STATISTIC ( NumPhiCommon ,
"Number of phis deleted via common incoming value"  )

◆ STATISTIC() [22/40]

STATISTIC ( NumPhis ,
"Number of phis propagated"  )

◆ STATISTIC() [23/40]

STATISTIC ( NumReturns ,
"Number of return values propagated"  )

◆ STATISTIC() [24/40]

STATISTIC ( NumSaturating ,
"Number of saturating arithmetics converted to normal arithmetics"  )

◆ STATISTIC() [25/40]

STATISTIC ( NumSDivs ,
"Number of sdiv converted to udiv"  )

◆ STATISTIC() [26/40]

STATISTIC ( NumSDivSRemsNarrowed ,
"Number of sdivs/srems whose width was decreased"  )

◆ STATISTIC() [27/40]

STATISTIC ( NumSelects ,
"Number of selects propagated"  )

◆ STATISTIC() [28/40]

STATISTIC ( NumSExt ,
"Number of sext converted to zext"  )

◆ STATISTIC() [29/40]

STATISTIC ( NumShlNSW ,
"Number of no-signed-wrap deductions for shl"  )

◆ STATISTIC() [30/40]

STATISTIC ( NumShlNUW ,
"Number of no-unsigned-wrap deductions for shl"  )

◆ STATISTIC() [31/40]

STATISTIC ( NumShlNW ,
"Number of no-wrap deductions for shl"  )

◆ STATISTIC() [32/40]

STATISTIC ( NumSICmps ,
"Number of signed icmp preds simplified to unsigned"  )

◆ STATISTIC() [33/40]

STATISTIC ( NumSIToFP ,
"Number of sitofp converted to uitofp"  )

◆ STATISTIC() [34/40]

STATISTIC ( NumSMinMax ,
"Number of llvm.s{min,max} intrinsics simplified to unsigned"  )

◆ STATISTIC() [35/40]

STATISTIC ( NumSRems ,
"Number of srem converted to urem"  )

◆ STATISTIC() [36/40]

STATISTIC ( NumSubNSW ,
"Number of no-signed-wrap deductions for sub"  )

◆ STATISTIC() [37/40]

STATISTIC ( NumSubNUW ,
"Number of no-unsigned-wrap deductions for sub"  )

◆ STATISTIC() [38/40]

STATISTIC ( NumSubNW ,
"Number of no-wrap deductions for sub"  )

◆ STATISTIC() [39/40]

STATISTIC ( NumUDivURemsNarrowed ,
"Number of udivs/urems whose width was decreased"  )

◆ STATISTIC() [40/40]

STATISTIC ( NumUDivURemsNarrowedExpanded ,
"Number of bound udiv's/urem's expanded"  )