diff options
author | Sanjay Patel <spatel@rotateright.com> | 2017-04-20 18:02:27 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2017-04-20 18:02:27 +0000 |
commit | 13985cd111d95e70c1001f4325cbdb5ec644088c (patch) | |
tree | c6c444e8402574e5735b05e275723cf3fda379e9 /llvm/lib/CodeGen | |
parent | 90d99413ac3bc0ef9f13036e3e7948303a0fb531 (diff) | |
download | bcm5719-llvm-13985cd111d95e70c1001f4325cbdb5ec644088c.tar.gz bcm5719-llvm-13985cd111d95e70c1001f4325cbdb5ec644088c.zip |
[DAGCombiner] use more local variables in isAlias(); NFCI
llvm-svn: 300860
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index c5c6645696f..4702d63cb61 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -16126,11 +16126,14 @@ bool DAGCombiner::isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const { // compared to the size and offset of the access, we may be able to prove they // do not alias. This check is conservative for now to catch cases created by // splitting vector types. - if ((Op0->getOriginalAlignment() == Op1->getOriginalAlignment()) && - (Op0->getSrcValueOffset() != Op1->getSrcValueOffset()) && - (NumBytes0 == NumBytes1) && (Op0->getOriginalAlignment() > NumBytes0)) { - int64_t OffAlign0 = Op0->getSrcValueOffset() % Op0->getOriginalAlignment(); - int64_t OffAlign1 = Op1->getSrcValueOffset() % Op1->getOriginalAlignment(); + int64_t SrcValOffset0 = Op0->getSrcValueOffset(); + int64_t SrcValOffset1 = Op1->getSrcValueOffset(); + unsigned OrigAlignment0 = Op0->getOriginalAlignment(); + unsigned OrigAlignment1 = Op1->getOriginalAlignment(); + if (OrigAlignment0 == OrigAlignment1 && SrcValOffset0 != SrcValOffset1 && + NumBytes0 == NumBytes1 && OrigAlignment0 > NumBytes0) { + int64_t OffAlign0 = SrcValOffset0 % OrigAlignment0; + int64_t OffAlign1 = SrcValOffset1 % OrigAlignment1; // There is no overlap between these relatively aligned accesses of similar // size. Return no alias. @@ -16151,10 +16154,9 @@ bool DAGCombiner::isAlias(LSBaseSDNode *Op0, LSBaseSDNode *Op1) const { if (UseAA && Op0->getMemOperand()->getValue() && Op1->getMemOperand()->getValue()) { // Use alias analysis information. - int64_t MinOffset = std::min(Op0->getSrcValueOffset(), - Op1->getSrcValueOffset()); - int64_t Overlap0 = NumBytes0 + Op0->getSrcValueOffset() - MinOffset; - int64_t Overlap1 = NumBytes1 + Op1->getSrcValueOffset() - MinOffset; + int64_t MinOffset = std::min(SrcValOffset0, SrcValOffset1); + int64_t Overlap0 = NumBytes0 + SrcValOffset0 - MinOffset; + int64_t Overlap1 = NumBytes1 + SrcValOffset1 - MinOffset; AliasResult AAResult = AA.alias(MemoryLocation(Op0->getMemOperand()->getValue(), Overlap0, UseTBAA ? Op0->getAAInfo() : AAMDNodes()), |