LLVM 23.0.0git
LoopVectorizationPlanner.cpp File Reference

This file implements VFSelectionContext methods for loop vectorization VF selection, independent of cost-modeling decisions. More...

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "loop-vectorize"

Functions

static void debugVectorizationMessage (const StringRef Prefix, const StringRef DebugMsg, Instruction *I)
 Write a DebugMsg about vectorization to the debug output stream.
static OptimizationRemarkAnalysis createLVAnalysis (StringRef RemarkName, const Loop *TheLoop, Instruction *I, DebugLoc DL={})
 Create an analysis remark that explains why vectorization failed RemarkName is the identifier for the remark.

Variables

cl::opt< boolVPlanBuildOuterloopStressTest
static cl::opt< boolMaximizeBandwidth ("vectorizer-maximize-bandwidth", cl::init(false), cl::Hidden, cl::desc("Maximize bandwidth when selecting vectorization factor which " "will be determined by the smallest type in loop."))
static cl::opt< boolUseWiderVFIfCallVariantsPresent ("vectorizer-maximize-bandwidth-for-vector-calls", cl::init(true), cl::Hidden, cl::desc("Try wider VFs if they enable the use of vector variants"))
static cl::opt< boolConsiderRegPressure ("vectorizer-consider-reg-pressure", cl::init(false), cl::Hidden, cl::desc("Discard VFs if their register pressure is too high."))
static cl::opt< boolForceTargetSupportsScalableVectors ("force-target-supports-scalable-vectors", cl::init(false), cl::Hidden, cl::desc("Pretend that scalable vectors are supported, even if the target does " "not support them. This flag should only be used for testing."))
static cl::opt< boolForceTargetSupportsMaskedMemoryOps ("force-target-supports-masked-memory-ops", cl::init(false), cl::Hidden, cl::desc("Assume the target supports masked memory operations (used for " "testing)."))
 Note: This currently only applies to llvm.masked.load and llvm.masked.store.
static cl::opt< boolForceTargetSupportsGatherScatterOps ("force-target-supports-gather-scatter-ops", cl::init(false), cl::Hidden, cl::desc("Assume the target supports gather/scatter operations (used for " "testing)."))

Detailed Description

This file implements VFSelectionContext methods for loop vectorization VF selection, independent of cost-modeling decisions.

Definition in file LoopVectorizationPlanner.cpp.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "loop-vectorize"

Definition at line 29 of file LoopVectorizationPlanner.cpp.

Function Documentation

◆ createLVAnalysis()

OptimizationRemarkAnalysis createLVAnalysis ( StringRef RemarkName,
const Loop * TheLoop,
Instruction * I,
DebugLoc DL = {} )
static

Create an analysis remark that explains why vectorization failed RemarkName is the identifier for the remark.

If I is passed it is an instruction that prevents vectorization. Otherwise TheLoop is used for the location of the remark. If DL is passed, use it as debug location for the remark.

Returns
the remark object that can be streamed to.

Definition at line 90 of file LoopVectorizationPlanner.cpp.

References DL, and I.

Referenced by llvm::LoopVectorizationUtils::reportVectorizationFailure(), and llvm::LoopVectorizationUtils::reportVectorizationInfo().

◆ debugVectorizationMessage()

void debugVectorizationMessage ( const StringRef Prefix,
const StringRef DebugMsg,
Instruction * I )
static

Write a DebugMsg about vectorization to the debug output stream.

If I is passed, the message relates to that particular instruction.

Definition at line 73 of file LoopVectorizationPlanner.cpp.

References llvm::dbgs(), and I.

Referenced by llvm::LoopVectorizationUtils::reportVectorization(), llvm::LoopVectorizationUtils::reportVectorizationFailure(), and llvm::LoopVectorizationUtils::reportVectorizationInfo().

Variable Documentation

◆ ConsiderRegPressure

cl::opt< bool > ConsiderRegPressure("vectorizer-consider-reg-pressure", cl::init(false), cl::Hidden, cl::desc("Discard VFs if their register pressure is too high.")) ( "vectorizer-consider-reg-pressure" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("Discard VFs if their register pressure is too high.")  )
static

◆ ForceTargetSupportsGatherScatterOps

cl::opt< bool > ForceTargetSupportsGatherScatterOps("force-target-supports-gather-scatter-ops", cl::init(false), cl::Hidden, cl::desc("Assume the target supports gather/scatter operations (used for " "testing).")) ( "force-target-supports-gather-scatter-ops" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("Assume the target supports gather/scatter operations (used for " "testing).")  )
static

◆ ForceTargetSupportsMaskedMemoryOps

cl::opt< bool > ForceTargetSupportsMaskedMemoryOps("force-target-supports-masked-memory-ops", cl::init(false), cl::Hidden, cl::desc("Assume the target supports masked memory operations (used for " "testing).")) ( "force-target-supports-masked-memory-ops" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("Assume the target supports masked memory operations (used for " "testing).")  )
static

Note: This currently only applies to llvm.masked.load and llvm.masked.store.

TODO: Extend this to cover other operations as needed.

Referenced by llvm::VFSelectionContext::isLegalMaskedLoadOrStore().

◆ ForceTargetSupportsScalableVectors

cl::opt< bool > ForceTargetSupportsScalableVectors("force-target-supports-scalable-vectors", cl::init(false), cl::Hidden, cl::desc( "Pretend that scalable vectors are supported, even if the target does " "not support them. This flag should only be used for testing.")) ( "force-target-supports-scalable-vectors" ,
cl::init(false) ,
cl::Hidden ,
cl::desc( "Pretend that scalable vectors are supported, even if the target does " "not support them. This flag should only be used for testing.")  )
static

◆ MaximizeBandwidth

cl::opt< bool > MaximizeBandwidth("vectorizer-maximize-bandwidth", cl::init(false), cl::Hidden, cl::desc("Maximize bandwidth when selecting vectorization factor which " "will be determined by the smallest type in loop.")) ( "vectorizer-maximize-bandwidth" ,
cl::init(false) ,
cl::Hidden ,
cl::desc("Maximize bandwidth when selecting vectorization factor which " "will be determined by the smallest type in loop.")  )
static

◆ UseWiderVFIfCallVariantsPresent

cl::opt< bool > UseWiderVFIfCallVariantsPresent("vectorizer-maximize-bandwidth-for-vector-calls", cl::init(true), cl::Hidden, cl::desc("Try wider VFs if they enable the use of vector variants")) ( "vectorizer-maximize-bandwidth-for-vector-calls" ,
cl::init(true) ,
cl::Hidden ,
cl::desc("Try wider VFs if they enable the use of vector variants")  )
static

◆ VPlanBuildOuterloopStressTest