mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
88d3ef2c74
commit
85661d0978
@ -56,6 +56,14 @@ unsigned Loop::getNumBackEdges() const {
|
||||
return NumBackEdges;
|
||||
}
|
||||
|
||||
/// isLoopInvariant - Return true if the specified value is loop invariant
|
||||
///
|
||||
bool Loop::isLoopInvariant(Value *V) const {
|
||||
if (Instruction *I = dyn_cast<Instruction>(V))
|
||||
return !contains(I->getParent());
|
||||
return true; // All non-instructions are loop invariant
|
||||
}
|
||||
|
||||
void Loop::print(std::ostream &OS, unsigned Depth) const {
|
||||
OS << std::string(Depth*2, ' ') << "Loop Containing: ";
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user