Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-10 08:44:41

0001 //===---- AlignmentFromAssumptions.h ----------------------------*- C++ -*-===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 //
0009 // This file implements a ScalarEvolution-based transformation to set
0010 // the alignments of load, stores and memory intrinsics based on the truth
0011 // expressions of assume intrinsics. The primary motivation is to handle
0012 // complex alignment assumptions that apply to vector loads and stores that
0013 // appear after vectorization and unrolling.
0014 //
0015 //===----------------------------------------------------------------------===//
0016 
0017 #ifndef LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
0018 #define LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H
0019 
0020 #include "llvm/IR/PassManager.h"
0021 
0022 namespace llvm {
0023 
0024 class AssumptionCache;
0025 class CallInst;
0026 class DominatorTree;
0027 class ScalarEvolution;
0028 class SCEV;
0029 class Value;
0030 
0031 struct AlignmentFromAssumptionsPass
0032     : public PassInfoMixin<AlignmentFromAssumptionsPass> {
0033   PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
0034 
0035   // Glue for old PM.
0036   bool runImpl(Function &F, AssumptionCache &AC, ScalarEvolution *SE_,
0037                DominatorTree *DT_);
0038 
0039   ScalarEvolution *SE = nullptr;
0040   DominatorTree *DT = nullptr;
0041 
0042   bool extractAlignmentInfo(CallInst *I, unsigned Idx, Value *&AAPtr,
0043                             const SCEV *&AlignSCEV, const SCEV *&OffSCEV);
0044   bool processAssumption(CallInst *I, unsigned Idx);
0045 };
0046 }
0047 
0048 #endif // LLVM_TRANSFORMS_SCALAR_ALIGNMENTFROMASSUMPTIONS_H