ΒΆOptional<llvm::IVConditionInfo>
hasPartialIVCondition(llvm::Loop& L,
                      unsigned int MSSAThreshold,
                      llvm::MemorySSA& MSSA,
                      llvm::AAResults& AA)

Description

Check if the loop header has a conditional branch that is not loop-invariant, because it involves load instructions. If all paths from either the true or false successor to the header or loop exists do not modify the memory feeding the condition, perform 'partial unswitching'. That is, duplicate the instructions feeding the condition in the pre-header. Then unswitch on the duplicated condition. The condition is now known in the unswitched version for the 'invariant' path through the original loop. If the branch condition of the header is partially invariant, return a pair containing the instructions to duplicate and a boolean Constant to update the condition in the loops created for the true or false successors.

Declared at: llvm/include/llvm/Transforms/Utils/LoopUtils.h:546

Parameters

llvm::Loop& L
unsigned int MSSAThreshold
llvm::MemorySSA& MSSA
llvm::AAResults& AA