Factor the ReachesChainWithoutSideEffects out of dag combiner into

a public SDOperand::reachesChainWithoutSideEffects method.  No 
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46050 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2008-01-16 05:49:24 +00:00
parent 8c231e5dda
commit 572dee71af
3 changed files with 40 additions and 28 deletions

View File

@ -780,6 +780,14 @@ public:
inline bool isTargetOpcode() const;
inline unsigned getTargetOpcode() const;
/// reachesChainWithoutSideEffects - Return true if this operand (which must
/// be a chain) reaches the specified operand without crossing any
/// side-effecting instructions. In practice, this looks through token
/// factors and non-volatile loads. In order to remain efficient, this only
/// looks a couple of nodes in, it does not do an exhaustive search.
bool reachesChainWithoutSideEffects(SDOperand Dest, unsigned Depth = 2) const;
/// hasOneUse - Return true if there is exactly one operation using this
/// result value of the defining operator.
inline bool hasOneUse() const;