[VectorCombine] generalize pass param name for early combines; NFC
The option was added with https://reviews.llvm.org/D102496, and currently the name is accurate, but I am hoping to add a load transform that is not a scalarization. See issue #17113.
This commit is contained in:
parent
ed7870c2e5
commit
8f337f8ffe
|
@ -21,13 +21,13 @@ namespace llvm {
|
|||
|
||||
/// Optimize scalar/vector interactions in IR using target cost models.
|
||||
class VectorCombinePass : public PassInfoMixin<VectorCombinePass> {
|
||||
/// If true only perform scalarization combines and do not introduce new
|
||||
/// If true, only perform beneficial early IR transforms. Do not introduce new
|
||||
/// vector operations.
|
||||
bool ScalarizationOnly;
|
||||
bool TryEarlyFoldsOnly;
|
||||
|
||||
public:
|
||||
VectorCombinePass(bool ScalarizationOnly = false)
|
||||
: ScalarizationOnly(ScalarizationOnly) {}
|
||||
VectorCombinePass(bool TryEarlyFoldsOnly = false)
|
||||
: TryEarlyFoldsOnly(TryEarlyFoldsOnly) {}
|
||||
|
||||
PreservedAnalyses run(Function &F, FunctionAnalysisManager &);
|
||||
};
|
||||
|
|
|
@ -618,7 +618,7 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
|
|||
// The matrix extension can introduce large vector operations early, which can
|
||||
// benefit from running vector-combine early on.
|
||||
if (EnableMatrix)
|
||||
FPM.addPass(VectorCombinePass(/*ScalarizationOnly=*/true));
|
||||
FPM.addPass(VectorCombinePass(/*TryEarlyFoldsOnly=*/true));
|
||||
|
||||
// Eliminate redundancies.
|
||||
FPM.addPass(MergedLoadStoreMotionPass());
|
||||
|
|
|
@ -65,9 +65,9 @@ class VectorCombine {
|
|||
public:
|
||||
VectorCombine(Function &F, const TargetTransformInfo &TTI,
|
||||
const DominatorTree &DT, AAResults &AA, AssumptionCache &AC,
|
||||
bool ScalarizationOnly)
|
||||
bool TryEarlyFoldsOnly)
|
||||
: F(F), Builder(F.getContext()), TTI(TTI), DT(DT), AA(AA), AC(AC),
|
||||
ScalarizationOnly(ScalarizationOnly) {}
|
||||
TryEarlyFoldsOnly(TryEarlyFoldsOnly) {}
|
||||
|
||||
bool run();
|
||||
|
||||
|
@ -79,9 +79,9 @@ private:
|
|||
AAResults &AA;
|
||||
AssumptionCache &AC;
|
||||
|
||||
/// If true only perform scalarization combines and do not introduce new
|
||||
/// If true, only perform beneficial early IR transforms. Do not introduce new
|
||||
/// vector operations.
|
||||
bool ScalarizationOnly;
|
||||
bool TryEarlyFoldsOnly;
|
||||
|
||||
InstructionWorklist Worklist;
|
||||
|
||||
|
@ -1698,7 +1698,7 @@ bool VectorCombine::run() {
|
|||
bool MadeChange = false;
|
||||
auto FoldInst = [this, &MadeChange](Instruction &I) {
|
||||
Builder.SetInsertPoint(&I);
|
||||
if (!ScalarizationOnly) {
|
||||
if (!TryEarlyFoldsOnly) {
|
||||
if (isa<FixedVectorType>(I.getType())) {
|
||||
MadeChange |= vectorizeLoadInsert(I);
|
||||
MadeChange |= widenSubvectorLoad(I);
|
||||
|
@ -1800,7 +1800,7 @@ PreservedAnalyses VectorCombinePass::run(Function &F,
|
|||
TargetTransformInfo &TTI = FAM.getResult<TargetIRAnalysis>(F);
|
||||
DominatorTree &DT = FAM.getResult<DominatorTreeAnalysis>(F);
|
||||
AAResults &AA = FAM.getResult<AAManager>(F);
|
||||
VectorCombine Combiner(F, TTI, DT, AA, AC, ScalarizationOnly);
|
||||
VectorCombine Combiner(F, TTI, DT, AA, AC, TryEarlyFoldsOnly);
|
||||
if (!Combiner.run())
|
||||
return PreservedAnalyses::all();
|
||||
PreservedAnalyses PA;
|
||||
|
|
Loading…
Reference in New Issue