[llvm] [CodeGen] Remove extraneous ArrayRef (NFC) (PR #90423)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sun Apr 28 17:57:49 PDT 2024


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/90423

We don't need to explicitly create an instance of ArrayRef here
because getIndexedOffsetInType takes ArrayRef, and ArrayRef can be
implicitly constructed from a C array.


>From 91b2a5722cac4d7fe4ab034cf8c2e8aa19e97fcf Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 26 Apr 2024 19:27:06 -0700
Subject: [PATCH] [CodeGen] Remove extraneous ArrayRef (NFC)

We don't need to explicitly create an instance of ArrayRef here
because getIndexedOffsetInType takes ArrayRef, and ArrayRef can be
implicitly constructed from a C array.
---
 llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp b/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
index f2d5c3c867c2dd..e5f164b182723f 100644
--- a/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
+++ b/llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
@@ -890,7 +890,7 @@ struct VectorInfo {
           ConstantInt::get(Type::getInt32Ty(LI->getContext()), 0),
           ConstantInt::get(Type::getInt32Ty(LI->getContext()), i),
       };
-      int64_t Ofs = DL.getIndexedOffsetInType(Result.VTy, ArrayRef(Idx, 2));
+      int64_t Ofs = DL.getIndexedOffsetInType(Result.VTy, Idx);
       Result.EI[i] = ElementInfo(Offset + Ofs, i == 0 ? LI : nullptr);
     }
 



More information about the llvm-commits mailing list