diff options
author | Artur Pilipenko <apilipenko@azulsystems.com> | 2017-02-27 11:40:14 +0000 |
---|---|---|
committer | Artur Pilipenko <apilipenko@azulsystems.com> | 2017-02-27 11:40:14 +0000 |
commit | f2c26e0bf23502ce55c7b855550ce9aa03008c39 (patch) | |
tree | 098047b38f4fe60e5a62a0c4e800d36df000bdc9 /llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | |
parent | 20371c30ef6d8fb7f8d0fef51445a67693c056c7 (diff) | |
download | bcm5719-llvm-f2c26e0bf23502ce55c7b855550ce9aa03008c39.tar.gz bcm5719-llvm-f2c26e0bf23502ce55c7b855550ce9aa03008c39.zip |
[DAGCombine] NFC. MatchLoadCombine remember the first byte provider, not the load node
This refactoring will simplify the upcoming change to fix a bug in folding patterns with non-zero offsets on BE targets.
llvm-svn: 296331
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 39aa8233594..34be7766b57 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -4520,7 +4520,7 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) { SDValue Chain; SmallSet<LoadSDNode *, 8> Loads; - LoadSDNode *FirstLoad = nullptr; + Optional<ByteProvider> FirstByteProvider; int64_t FirstOffset = INT64_MAX; bool IsBigEndianTarget = DAG.getDataLayout().isBigEndian(); @@ -4565,7 +4565,7 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) { // Remember the first byte load if (ByteOffsetFromBase < FirstOffset) { - FirstLoad = L; + FirstByteProvider = P; FirstOffset = ByteOffsetFromBase; } @@ -4587,7 +4587,9 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) { return SDValue(); } assert((BigEndian != LittleEndian) && "should be either or"); - assert(FirstLoad && "must be set"); + assert(FirstByteProvider && "must be set"); + + LoadSDNode *FirstLoad = FirstByteProvider->Load; // The node we are looking at matches with the pattern, check if we can // replace it with a single load and bswap if needed. |