diff options
| author | Clement Courbet <courbet@google.com> | 2019-02-06 12:36:17 +0000 |
|---|---|---|
| committer | Clement Courbet <courbet@google.com> | 2019-02-06 12:36:17 +0000 |
| commit | 5a6712b633478adac1c1d95003af7c9ba5f9fee6 (patch) | |
| tree | b88314c88a4ca0a5c6874775217477b543c452a7 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
| parent | cd48ac36613fe79a172e27d9f85fcbc2e3861dfa (diff) | |
| download | bcm5719-llvm-5a6712b633478adac1c1d95003af7c9ba5f9fee6.tar.gz bcm5719-llvm-5a6712b633478adac1c1d95003af7c9ba5f9fee6.zip | |
[DAGCombine][NFC] GatherAllAliases should take a LSBaseSDNode.
GatherAllAliases only makes sense for LSBaseSDNode. Enforce it with
static typing instead of runtime cast.
llvm-svn: 353291
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index e6ac8bc1d28..741eeb4f837 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -479,7 +479,7 @@ namespace { /// Walk up chain skipping non-aliasing memory nodes, /// looking for aliasing nodes and adding them to the Aliases vector. - void GatherAllAliases(SDNode *N, SDValue OriginalChain, + void GatherAllAliases(LSBaseSDNode *N, SDValue OriginalChain, SmallVectorImpl<SDValue> &Aliases); /// Return true if there is any possibility that the two addresses overlap. @@ -487,7 +487,7 @@ namespace { /// Walk up chain skipping non-aliasing memory nodes, looking for a better /// chain (aliasing node.) - SDValue FindBetterChain(SDNode *N, SDValue Chain); + SDValue FindBetterChain(LSBaseSDNode *N, SDValue Chain); /// Try to replace a store and any possibly adjacent stores on /// consecutive chains with better chains. Return true only if St is @@ -13230,7 +13230,7 @@ SDValue DAGCombiner::visitLOAD(SDNode *N) { if (LD->isUnindexed()) { // Walk up chain skipping non-aliasing memory nodes. - SDValue BetterChain = FindBetterChain(N, Chain); + SDValue BetterChain = FindBetterChain(LD, Chain); // If there is a better chain. if (Chain != BetterChain) { @@ -17765,7 +17765,7 @@ SDValue DAGCombiner::visitVECTOR_SHUFFLE(SDNode *N) { NewMask.push_back(M < 0 ? -1 : Scale * M + s); return NewMask; }; - + SDValue BC0 = peekThroughOneUseBitcasts(N0); if (BC0.getOpcode() == ISD::VECTOR_SHUFFLE && BC0.hasOneUse()) { EVT SVT = VT.getScalarType(); @@ -19210,13 +19210,13 @@ bool DAGCombiner::isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const { /// Walk up chain skipping non-aliasing memory nodes, /// looking for aliasing nodes and adding them to the Aliases vector. -void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain, +void DAGCombiner::GatherAllAliases(LSBaseSDNode *N, SDValue OriginalChain, SmallVectorImpl<SDValue> &Aliases) { SmallVector<SDValue, 8> Chains; // List of chains to visit. SmallPtrSet<SDNode *, 16> Visited; // Visited node set. // Get alias information for node. - bool IsLoad = isa<LoadSDNode>(N) && !cast<LSBaseSDNode>(N)->isVolatile(); + bool IsLoad = isa<LoadSDNode>(N) && !N->isVolatile(); // Starting off. Chains.push_back(OriginalChain); @@ -19257,7 +19257,7 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain, // If chain is alias then stop here. if (!(IsLoad && IsOpLoad) && - isAlias(cast<LSBaseSDNode>(N), cast<LSBaseSDNode>(Chain.getNode()))) { + isAlias(N, cast<LSBaseSDNode>(Chain.getNode()))) { Aliases.push_back(Chain); } else { // Look further up the chain. @@ -19297,7 +19297,7 @@ void DAGCombiner::GatherAllAliases(SDNode *N, SDValue OriginalChain, /// Walk up chain skipping non-aliasing memory nodes, looking for a better chain /// (aliasing node.) -SDValue DAGCombiner::FindBetterChain(SDNode *N, SDValue OldChain) { +SDValue DAGCombiner::FindBetterChain(LSBaseSDNode *N, SDValue OldChain) { if (OptLevel == CodeGenOpt::None) return OldChain; |

