[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:56:34 PST 2020


HsiangKai updated this revision to Diff 306574.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91834/new/

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.getStoreSize();
   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.306574.patch
Type: text/x-patch
Size: 1019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201120/1273baee/attachment.bin>


More information about the llvm-commits mailing list