diff options
| author | Clement Courbet <courbet@google.com> | 2019-11-21 08:47:10 +0100 |
|---|---|---|
| committer | Clement Courbet <courbet@google.com> | 2019-11-21 08:53:37 +0100 |
| commit | 252567377c5e8613c1a238bd8598120945185b39 (patch) | |
| tree | 7aca10933a75ec049ba6d8d7c9b2621b835de711 /llvm/lib/CodeGen | |
| parent | e47d6da8a5dd6b9552f7b94e8b35453b4f09ffe4 (diff) | |
| download | bcm5719-llvm-252567377c5e8613c1a238bd8598120945185b39.tar.gz bcm5719-llvm-252567377c5e8613c1a238bd8598120945185b39.zip | |
[DAGCombine][NFC] Use ArrayRef and correctly size SmallVectors.
In preparation for D70487.
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 8d691b0cc7c..94e98cd8065 100644 --- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -6514,7 +6514,7 @@ static unsigned BigEndianByteAt(unsigned BW, unsigned i) { // Check if the bytes offsets we are looking at match with either big or // little endian value loaded. Return true for big endian, false for little // endian, and None if match failed. -static Optional<bool> isBigEndian(const SmallVector<int64_t, 4> &ByteOffsets, +static Optional<bool> isBigEndian(const ArrayRef<int64_t> ByteOffsets, int64_t FirstOffset) { // The endian can be decided only when it is 2 bytes at least. unsigned Width = ByteOffsets.size(); @@ -6594,7 +6594,7 @@ SDValue DAGCombiner::MatchStoreCombine(StoreSDNode *N) { // to the same base address. Collect bytes offsets from Base address into // ByteOffsets. SDValue CombinedValue; - SmallVector<int64_t, 4> ByteOffsets(Width, INT64_MAX); + SmallVector<int64_t, 8> ByteOffsets(Width, INT64_MAX); int64_t FirstOffset = INT64_MAX; StoreSDNode *FirstStore = nullptr; Optional<BaseIndexOffset> Base; @@ -6777,7 +6777,7 @@ SDValue DAGCombiner::MatchLoadCombine(SDNode *N) { // Check if all the bytes of the OR we are looking at are loaded from the same // base address. Collect bytes offsets from Base address in ByteOffsets. - SmallVector<int64_t, 4> ByteOffsets(ByteWidth); + SmallVector<int64_t, 8> ByteOffsets(ByteWidth); for (unsigned i = 0; i < ByteWidth; i++) { auto P = calculateByteProvider(SDValue(N, 0), i, 0, /*Root=*/true); if (!P || !P->isMemory()) // All the bytes must be loaded from memory |

