diff options
author | Nirav Dave <niravd@google.com> | 2017-12-22 22:06:56 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2017-12-22 22:06:56 +0000 |
commit | afeae77058e858e23533a58e7ace6051ac2aff96 (patch) | |
tree | df0960c1d79d5e4a42ffeaebe6841d89f8b643bd /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 9cbb6dd1fcf59a14be4f924b9faca90bbb11dfcb (diff) | |
download | bcm5719-llvm-afeae77058e858e23533a58e7ace6051ac2aff96.tar.gz bcm5719-llvm-afeae77058e858e23533a58e7ace6051ac2aff96.zip |
[DAG] Add missing case check from findbaseoffset merge from r321389.
llvm-svn: 321391
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 5bab282cb09..99c450e612b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -17453,8 +17453,10 @@ bool DAGCombiner::isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const { bool IsCV0 = isa<ConstantPoolSDNode>(BasePtr0.getBase()); bool IsCV1 = isa<ConstantPoolSDNode>(BasePtr1.getBase()); - // If of mismatched base types they do not alias. - if (((IsFI0 != IsFI1) || (IsGV0 != IsGV1) || (IsCV0 != IsCV1)) && + // If of mismatched base types or checkable indices we can check + // they do not alias. + if ((BasePtr0.getIndex() == BasePtr1.getIndex() || (IsFI0 != IsFI1) || + (IsGV0 != IsGV1) || (IsCV0 != IsCV1)) && (IsFI0 || IsGV0 || IsCV0) && (IsFI1 || IsGV1 || IsCV1)) return false; |