summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
authorAdam Nemet <anemet@apple.com>2015-11-03 23:49:58 +0000
committerAdam Nemet <anemet@apple.com>2015-11-03 23:49:58 +0000
commited653d6774cd449fc6f803d21b5d3164f8c10c5b (patch)
tree262867d45f7dc6e30685b4942d17128cdbc3df96 /llvm/include
parent94d778697a0654870aa5808b425ffa8ed88ada93 (diff)
downloadbcm5719-llvm-ed653d6774cd449fc6f803d21b5d3164f8c10c5b.tar.gz
bcm5719-llvm-ed653d6774cd449fc6f803d21b5d3164f8c10c5b.zip
[LAA] LLE 4/6: APIs to access the dependent instructions for a dependence, NFC
Summary: The functions use LAI and MemoryDepChecker classes so they need to be defined after those definitions outside of the Dependence class. Will be used by the LoopLoadElimination pass. Reviewers: hfinkel Subscribers: rengolin, llvm-commits Differential Revision: http://reviews.llvm.org/D13257 llvm-svn: 252015
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/Analysis/LoopAccessAnalysis.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
index 1df04d6b627..35f83f1008c 100644
--- a/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
+++ b/llvm/include/llvm/Analysis/LoopAccessAnalysis.h
@@ -33,6 +33,7 @@ class ScalarEvolution;
class Loop;
class SCEV;
class SCEVUnionPredicate;
+class LoopAccessInfo;
/// Optimization analysis message produced during vectorization. Messages inform
/// the user why vectorization did not occur.
@@ -170,6 +171,11 @@ public:
Dependence(unsigned Source, unsigned Destination, DepType Type)
: Source(Source), Destination(Destination), Type(Type) {}
+ /// \brief Return the source instruction of the dependence.
+ Instruction *getSource(const LoopAccessInfo &LAI) const;
+ /// \brief Return the destination instruction of the dependence.
+ Instruction *getDestination(const LoopAccessInfo &LAI) const;
+
/// \brief Dependence types that don't prevent vectorization.
static bool isSafeForVectorization(DepType Type);
@@ -679,6 +685,17 @@ private:
DominatorTree *DT;
LoopInfo *LI;
};
+
+inline Instruction *MemoryDepChecker::Dependence::getSource(
+ const LoopAccessInfo &LAI) const {
+ return LAI.getDepChecker().getMemoryInstructions()[Source];
+}
+
+inline Instruction *MemoryDepChecker::Dependence::getDestination(
+ const LoopAccessInfo &LAI) const {
+ return LAI.getDepChecker().getMemoryInstructions()[Destination];
+}
+
} // End llvm namespace
#endif
OpenPOWER on IntegriCloud