[llvm] [LLVM][DAGCombiner] Port calculateByteProvider to TypeSize. (PR #148425)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 14 04:26:39 PDT 2025


================
@@ -9248,20 +9249,23 @@ calculateByteProvider(SDValue Op, unsigned Index, unsigned Depth,
     if (!L->isSimple() || L->isIndexed())
       return std::nullopt;
 
-    unsigned NarrowBitWidth = L->getMemoryVT().getSizeInBits();
-    if (NarrowBitWidth % 8 != 0)
+    TypeSize NarrowBitWidth = L->getMemoryVT().getSizeInBits();
----------------
paulwalker-arm wrote:

Yes, I guess I've taken the code too literally.  As long as `Index` is the byte index within a scalar, which looks to be the code based on the existing call sites, then I agree this should be using the MemoryVT's scalar size.

https://github.com/llvm/llvm-project/pull/148425


More information about the llvm-commits mailing list