[PATCH] D91834: [SelectionDAG] Use TypeSize for the stack offset.

Hsiangkai Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 17:37:53 PST 2020


HsiangKai created this revision.
HsiangKai added reviewers: huntergr, craig.topper, efriedma, paulwalker-arm.
Herald added subscribers: ecnelises, hiraditya.
Herald added a project: LLVM.
HsiangKai requested review of this revision.

The return value type of getSizeInBits() is TypeSize now. Keep the type of the offset as TypeSize to enable concat_vectors to handle scalable vector objects correctly.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D91834

Files:
  llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp


Index: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
===================================================================
--- llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -1419,7 +1419,7 @@
 
   // Emit a store of each element to the stack slot.
   SmallVector<SDValue, 8> Stores;
-  unsigned TypeByteSize = MemVT.getSizeInBits() / 8;
+  TypeSize TypeByteSize = MemVT.getSizeInBits() / 8;
   assert(TypeByteSize > 0 && "Vector element type too small for stack store!");
 
   // If the destination vector element type of a BUILD_VECTOR is narrower than
@@ -1432,9 +1432,9 @@
     // Ignore undef elements.
     if (Node->getOperand(i).isUndef()) continue;
 
-    unsigned Offset = TypeByteSize*i;
+    TypeSize Offset = TypeByteSize * i;
 
-    SDValue Idx = DAG.getMemBasePlusOffset(FIPtr, TypeSize::Fixed(Offset), dl);
+    SDValue Idx = DAG.getMemBasePlusOffset(FIPtr, Offset, dl);
 
     if (Truncate)
       Stores.push_back(DAG.getTruncStore(DAG.getEntryNode(), dl,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91834.306568.patch
Type: text/x-patch
Size: 1024 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201120/24f24038/attachment.bin>


More information about the llvm-commits mailing list