mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-26 04:32:44 +01:00
[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
This commit is contained in:
parent
808c335569
commit
869d780cef
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user