1*0b57cec5SDimitry Andric //===- LoopStrengthReduce.h - Loop Strength Reduce Pass ---------*- C++ -*-===// 2*0b57cec5SDimitry Andric // 3*0b57cec5SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*0b57cec5SDimitry Andric // See https://llvm.org/LICENSE.txt for license information. 5*0b57cec5SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*0b57cec5SDimitry Andric // 7*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 8*0b57cec5SDimitry Andric // 9*0b57cec5SDimitry Andric // This transformation analyzes and transforms the induction variables (and 10*0b57cec5SDimitry Andric // computations derived from them) into forms suitable for efficient execution 11*0b57cec5SDimitry Andric // on the target. 12*0b57cec5SDimitry Andric // 13*0b57cec5SDimitry Andric // This pass performs a strength reduction on array references inside loops that 14*0b57cec5SDimitry Andric // have as one or more of their components the loop induction variable, it 15*0b57cec5SDimitry Andric // rewrites expressions to take advantage of scaled-index addressing modes 16*0b57cec5SDimitry Andric // available on the target, and it performs a variety of other optimizations 17*0b57cec5SDimitry Andric // related to loop induction variables. 18*0b57cec5SDimitry Andric // 19*0b57cec5SDimitry Andric //===----------------------------------------------------------------------===// 20*0b57cec5SDimitry Andric 21*0b57cec5SDimitry Andric #ifndef LLVM_TRANSFORMS_SCALAR_LOOPSTRENGTHREDUCE_H 22*0b57cec5SDimitry Andric #define LLVM_TRANSFORMS_SCALAR_LOOPSTRENGTHREDUCE_H 23*0b57cec5SDimitry Andric 24*0b57cec5SDimitry Andric #include "llvm/Analysis/LoopAnalysisManager.h" 25*0b57cec5SDimitry Andric #include "llvm/IR/PassManager.h" 26*0b57cec5SDimitry Andric 27*0b57cec5SDimitry Andric namespace llvm { 28*0b57cec5SDimitry Andric 29*0b57cec5SDimitry Andric class Loop; 30*0b57cec5SDimitry Andric class LPMUpdater; 31*0b57cec5SDimitry Andric 32*0b57cec5SDimitry Andric /// Performs Loop Strength Reduce Pass. 33*0b57cec5SDimitry Andric class LoopStrengthReducePass : public PassInfoMixin<LoopStrengthReducePass> { 34*0b57cec5SDimitry Andric public: 35*0b57cec5SDimitry Andric PreservedAnalyses run(Loop &L, LoopAnalysisManager &AM, 36*0b57cec5SDimitry Andric LoopStandardAnalysisResults &AR, LPMUpdater &U); 37*0b57cec5SDimitry Andric }; 38*0b57cec5SDimitry Andric 39*0b57cec5SDimitry Andric } // end namespace llvm 40*0b57cec5SDimitry Andric 41*0b57cec5SDimitry Andric #endif // LLVM_TRANSFORMS_SCALAR_LOOPSTRENGTHREDUCE_H 42