|
LLVM
4.0.0
|
#include "llvm/Transforms/Scalar/LoopRotation.h"#include "llvm/ADT/Statistic.h"#include "llvm/Analysis/AliasAnalysis.h"#include "llvm/Analysis/AssumptionCache.h"#include "llvm/Analysis/BasicAliasAnalysis.h"#include "llvm/Analysis/CodeMetrics.h"#include "llvm/Analysis/GlobalsModRef.h"#include "llvm/Analysis/InstructionSimplify.h"#include "llvm/Analysis/LoopPass.h"#include "llvm/Analysis/ScalarEvolution.h"#include "llvm/Analysis/ScalarEvolutionAliasAnalysis.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/Analysis/ValueTracking.h"#include "llvm/IR/CFG.h"#include "llvm/IR/Dominators.h"#include "llvm/IR/Function.h"#include "llvm/IR/IntrinsicInst.h"#include "llvm/IR/Module.h"#include "llvm/Support/CommandLine.h"#include "llvm/Support/Debug.h"#include "llvm/Support/raw_ostream.h"#include "llvm/Transforms/Scalar.h"#include "llvm/Transforms/Scalar/LoopPassManager.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"#include "llvm/Transforms/Utils/Local.h"#include "llvm/Transforms/Utils/LoopUtils.h"#include "llvm/Transforms/Utils/SSAUpdater.h"#include "llvm/Transforms/Utils/ValueMapper.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "loop-rotate" |
Functions | |
| STATISTIC (NumRotated,"Number of loops rotated") | |
| static void | RewriteUsesOfClonedInstructions (BasicBlock *OrigHeader, BasicBlock *OrigPreheader, ValueToValueMapTy &ValueMap) |
| RewriteUsesOfClonedInstructions - We just cloned the instructions from the old header into the preheader. More... | |
| static bool | shouldSpeculateInstrs (BasicBlock::iterator Begin, BasicBlock::iterator End, Loop *L) |
| Determine whether the instructions in this range may be safely and cheaply speculated. More... | |
| INITIALIZE_PASS_BEGIN (LoopRotateLegacyPass,"loop-rotate","Rotate Loops", false, false) INITIALIZE_PASS_END(LoopRotateLegacyPass | |
Variables | |
| static cl::opt< unsigned > | DefaultRotationThreshold ("rotation-max-header-size", cl::init(16), cl::Hidden, cl::desc("The default maximum header size for automatic loop rotation")) |
| loop | rotate |
| loop Rotate | Loops |
| loop Rotate | false |
| #define DEBUG_TYPE "loop-rotate" |
Definition at line 44 of file LoopRotation.cpp.
|
static |
RewriteUsesOfClonedInstructions - We just cloned the instructions from the old header into the preheader.
If there were uses of the values produced by these instruction that were outside of the loop, we have to insert PHI nodes to merge the two values. Do this now.
Definition at line 80 of file LoopRotation.cpp.
References llvm::SSAUpdater::AddAvailableValue(), llvm::BasicBlock::begin(), C, llvm::dyn_cast(), E, llvm::BasicBlock::end(), llvm::MetadataAsValue::get(), llvm::ValueAsMetadata::get(), llvm::UndefValue::get(), llvm::PHINode::getBasicBlockIndex(), llvm::BasicBlock::getContext(), llvm::MetadataAsValue::getIfExists(), llvm::ValueAsMetadata::getIfExists(), llvm::Value::getName(), llvm::Instruction::getParent(), llvm::Value::getType(), llvm::Use::getUser(), llvm::SSAUpdater::GetValueInMiddleOfBlock(), llvm::SSAUpdater::HasValueForBlock(), I, llvm::SSAUpdater::Initialize(), llvm::ValueMap< KeyT, ValueT, Config >::lookup(), llvm::PHINode::removeIncomingValue(), llvm::SSAUpdater::RewriteUse(), SSA, llvm::Value::use_begin(), llvm::Value::use_empty(), and llvm::Value::use_end().
|
static |
Determine whether the instructions in this range may be safely and cheaply speculated.
This is not an important enough situation to develop complex heuristics. We handle a single arithmetic instruction along with any type conversions.
Definition at line 485 of file LoopRotation.cpp.
References llvm::MCID::Add, llvm::APIntOps::And(), llvm::LoopBase< N, M >::contains(), llvm::WebAssembly::End, llvm::LoopBase< N, M >::getExitingBlock(), I, llvm::isSafeToSpeculativelyExecute(), LLVM_FALLTHROUGH, llvm::APIntOps::Or(), llvm::Value::users(), and llvm::APIntOps::Xor().
| STATISTIC | ( | NumRotated | , |
| "Number of loops rotated" | |||
| ) |
|
static |
Referenced by llvm::LoopRotatePass::run().
| loop Rotate false |
Definition at line 686 of file LoopRotation.cpp.
| loop Rotate Loops |
Definition at line 686 of file LoopRotation.cpp.
| loop rotate |
Definition at line 686 of file LoopRotation.cpp.
Referenced by llvm::hashing::detail::hash_combine_recursive_helper::combine(), and llvm::hashing::detail::hash_combine_range_impl().
1.8.6