|
LLVM
10.0.0
|
Armv8.1m introduced MVE, M-Profile Vector Extension, and low-overhead branches to help accelerate DSP applications. More...
#include "ARM.h"#include "ARMSubtarget.h"#include "llvm/Analysis/LoopInfo.h"#include "llvm/Analysis/LoopPass.h"#include "llvm/Analysis/ScalarEvolution.h"#include "llvm/Analysis/ScalarEvolutionExpander.h"#include "llvm/Analysis/ScalarEvolutionExpressions.h"#include "llvm/Analysis/TargetTransformInfo.h"#include "llvm/CodeGen/TargetPassConfig.h"#include "llvm/IR/IRBuilder.h"#include "llvm/IR/Instructions.h"#include "llvm/IR/IntrinsicsARM.h"#include "llvm/IR/PatternMatch.h"#include "llvm/Support/Debug.h"#include "llvm/Transforms/Utils/BasicBlockUtils.h"Go to the source code of this file.
Macros | |
| #define | DEBUG_TYPE "mve-tail-predication" |
| #define | DESC "Transform predicated vector loops to use MVE tail predication" |
Functions | |
| static bool | IsDecrement (Instruction &I) |
| static bool | IsMasked (Instruction *I) |
| static VectorType * | getVectorType (IntrinsicInst *I) |
| static void | Cleanup (DenseMap< Instruction *, Instruction *> &NewPredicates, SetVector< Instruction *> &MaybeDead, Loop *L) |
Variables | |
| cl::opt< bool > | DisableTailPredication ("disable-mve-tail-predication", cl::Hidden, cl::init(true), cl::desc("Disable MVE Tail Predication")) |
Armv8.1m introduced MVE, M-Profile Vector Extension, and low-overhead branches to help accelerate DSP applications.
These two extensions can be combined to provide implicit vector predication within a low-overhead loop. The HardwareLoops pass inserts intrinsics identifying loops that the backend will attempt to convert into a low-overhead loop. The vectorizer is responsible for generating a vectorized loop in which the lanes are predicated upon the iteration counter. This pass looks at these predicated vector loops, that are targets for low-overhead loops, and prepares it for code generation. Once the vectorizer has produced a masked loop, there's a couple of final forms:
This pass inserts the inserts the VCTP intrinsic to represent the effect of tail predication. This will be picked up by the ARM Low-overhead loop pass, which performs the final transformation to a DLSTP or WLSTP tail-predicated loop.
Definition in file MVETailPredication.cpp.
| #define DEBUG_TYPE "mve-tail-predication" |
Definition at line 47 of file MVETailPredication.cpp.
Referenced by llvm::createMVETailPredicationPass().
| #define DESC "Transform predicated vector loops to use MVE tail predication" |
Definition at line 48 of file MVETailPredication.cpp.
Referenced by llvm::createMVETailPredicationPass().
|
static |
Definition at line 410 of file MVETailPredication.cpp.
References llvm::PHINode::addIncoming(), llvm::LoopBase< BlockT, LoopT >::blocks(), llvm::Instruction::clone(), llvm::SetVector< T, Vector, Set >::count(), llvm::dbgs(), llvm::RegState::Dead, llvm::DeleteDeadPHIs(), llvm::User::dropAllReferences(), llvm::Value::dump(), llvm::dyn_cast(), llvm::SetVector< T, Vector, Set >::empty(), llvm::Instruction::eraseFromParent(), llvm::SetVector< T, Vector, Set >::front(), llvm::IntegerType::get(), llvm::ConstantInt::get(), llvm::IRBuilderBase::getContext(), llvm::Intrinsic::getDeclaration(), llvm::BasicBlock::getFirstNonPHI(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::BasicBlock::getModule(), llvm::SequentialType::getNumElements(), llvm::LoopBase< BlockT, LoopT >::getUniqueExitBlock(), getVectorType(), llvm::Value::hasNUsesOrMore(), llvm::SetVector< T, Vector, Set >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::Instruction::insertBefore(), llvm::Instruction::isSameOperationAs(), LLVM_DEBUG, llvm_unreachable, llvm::User::operands(), llvm::SetVector< T, Vector, Set >::remove(), and llvm::Value::replaceAllUsesWith().
Referenced by llvm::MachineFunction::addSEHCleanupHandler(), llvm::calculateClrEHStateNumbers(), llvm::AArch64FrameLowering::emitEpilogue(), llvm::AArch64FrameLowering::emitPrologue(), llvm::formDedicatedExitBlocks(), getCondFromFCMOV(), llvm::MachineFunction::getLandingPads(), and isPromotedResultSafe().
|
static |
Definition at line 293 of file MVETailPredication.cpp.
References llvm::MCID::Add, llvm::dyn_cast(), llvm::ConstantInt::equalsInt(), llvm::SCEVExpander::expandCodeFor(), llvm::ConstantInt::get(), llvm::LoopBase< BlockT, LoopT >::getBlocks(), llvm::Module::getDataLayout(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::IntrinsicInst::getIntrinsicID(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::BasicBlock::getModule(), llvm::SequentialType::getNumElements(), llvm::User::getOperand(), llvm::Type::getScalarSizeInBits(), llvm::BasicBlock::getTerminator(), llvm::SCEV::getType(), llvm::Value::getType(), llvm::ConstantInt::getValue(), IsMasked(), and llvm::isSafeToExpandAt().
Referenced by Cleanup().
|
static |
Definition at line 104 of file MVETailPredication.cpp.
References llvm::dyn_cast(), and I.
Referenced by IsMasked().
|
static |
Definition at line 113 of file MVETailPredication.cpp.
References llvm::dbgs(), DisableTailPredication, llvm::dyn_cast(), F(), llvm::CallBase::getArgOperand(), llvm::LoopBase< BlockT, LoopT >::getBlocks(), llvm::LoopBase< BlockT, LoopT >::getHeader(), llvm::LoopBase< BlockT, LoopT >::getLoopLatch(), llvm::LoopBase< BlockT, LoopT >::getLoopPreheader(), llvm::BasicBlock::getParent(), llvm::BasicBlock::getSinglePredecessor(), llvm::Value::getType(), I, llvm::CmpInst::ICMP_ULE, IsDecrement(), llvm::Loop::isLoopInvariant(), LLVM_DEBUG, llvm::PatternMatch::m_Add(), llvm::PatternMatch::m_AllOnes(), llvm::PatternMatch::m_Constant(), llvm::PatternMatch::m_ICmp(), llvm::PatternMatch::m_InsertElement(), llvm::PatternMatch::m_Instruction(), llvm::PatternMatch::m_ShuffleVector(), llvm::PatternMatch::m_SpecificInt(), llvm::PatternMatch::m_Undef(), llvm::PatternMatch::m_Value(), llvm::PatternMatch::m_Zero(), llvm::PatternMatch::match(), llvm::ARM_MB::ST, and llvm::SystemZISD::TM.
Referenced by getCombineLoadStoreParts(), getMVEIndexedAddressParts(), llvm::ARMTargetLowering::getPostIndexedAddressParts(), llvm::ARMTargetLowering::getPreIndexedAddressParts(), getVectorType(), getVPTESTMOpc(), and llvm::VFABI::tryDemangleForVFABI().
| cl::opt<bool> DisableTailPredication("disable-mve-tail-predication", cl::Hidden, cl::init(true), cl::desc("Disable MVE Tail Predication")) |
Referenced by IsMasked().
1.8.13