LLVM 22.0.0git
StraightLineStrengthReduce.cpp File Reference

Go to the source code of this file.

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.

Functions

 DEBUG_COUNTER (StraightLineStrengthReduceCounter, "slsr-counter", "Controls whether rewriteCandidateWithBasis is executed.")
 INITIALIZE_PASS_BEGIN (StraightLineStrengthReduceLegacyPass, "slsr", "Straight line strength reduction", false, false) INITIALIZE_PASS_END(StraightLineStrengthReduceLegacyPass
static bool isGEPFoldable (GetElementPtrInst *GEP, const TargetTransformInfo *TTI)
static bool isAddFoldable (const SCEV *Base, ConstantInt *Index, Value *Stride, TargetTransformInfo *TTI)
static bool hasOnlyOneNonZeroIndex (GetElementPtrInst *GEP)
static bool matchesAdd (Value *A, Value *&B, ConstantInt *&C)
static bool matchesOr (Value *A, Value *&B, ConstantInt *&C)
static void unifyBitWidth (APInt &A, APInt &B)

Variables

static const unsigned UnknownAddressSpace
 slsr
Straight line strength reduction
Straight line strength false

Function Documentation

◆ DEBUG_COUNTER()

DEBUG_COUNTER ( StraightLineStrengthReduceCounter ,
"slsr-counter" ,
"Controls whether rewriteCandidateWithBasis is executed."  )

◆ hasOnlyOneNonZeroIndex()

bool hasOnlyOneNonZeroIndex ( GetElementPtrInst * GEP)
static

◆ INITIALIZE_PASS_BEGIN()

INITIALIZE_PASS_BEGIN ( StraightLineStrengthReduceLegacyPass ,
"slsr" ,
"Straight line strength reduction" ,
false ,
false  )

◆ isAddFoldable()

bool isAddFoldable ( const SCEV * Base,
ConstantInt * Index,
Value * Stride,
TargetTransformInfo * TTI )
static

Definition at line 293 of file StraightLineStrengthReduce.cpp.

References llvm::sampleprof::Base, and UnknownAddressSpace.

◆ isGEPFoldable()

bool isGEPFoldable ( GetElementPtrInst * GEP,
const TargetTransformInfo * TTI )
static

Definition at line 285 of file StraightLineStrengthReduce.cpp.

References GEP, and llvm::TargetTransformInfo::TCC_Free.

◆ matchesAdd()

◆ matchesOr()

◆ unifyBitWidth()

void unifyBitWidth ( APInt & A,
APInt & B )
static

Definition at line 572 of file StraightLineStrengthReduce.cpp.

References A(), and B().

Variable Documentation

◆ false

Straight line strength false

Definition at line 266 of file StraightLineStrengthReduce.cpp.

◆ reduction

Straight line strength reduction

Definition at line 266 of file StraightLineStrengthReduce.cpp.

◆ slsr

slsr

Definition at line 265 of file StraightLineStrengthReduce.cpp.

◆ UnknownAddressSpace

const unsigned UnknownAddressSpace
static
Initial value:
=
std::numeric_limits<unsigned>::max()

Definition at line 94 of file StraightLineStrengthReduce.cpp.

Referenced by isAddFoldable().