[PATCH] D88564: [SVE][CodeGen] Replace use of TypeSize operator< in GlobalMerge::doMerge

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 06:24:26 PDT 2020


david-arm created this revision.
david-arm added reviewers: sdesmalen, ctetreau, kmclaughlin.
Herald added subscribers: llvm-commits, psnobl, hiraditya, tschuett.
Herald added a reviewer: efriedma.
Herald added a project: LLVM.
david-arm requested review of this revision.

We don't support global variables with scalable vector types so I've
changed the code to compare the fixed sizes instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D88564

Files:
  llvm/lib/CodeGen/GlobalMerge.cpp


Index: llvm/lib/CodeGen/GlobalMerge.cpp
===================================================================
--- llvm/lib/CodeGen/GlobalMerge.cpp
+++ llvm/lib/CodeGen/GlobalMerge.cpp
@@ -223,8 +223,9 @@
   // FIXME: Find better heuristics
   llvm::stable_sort(
       Globals, [&DL](const GlobalVariable *GV1, const GlobalVariable *GV2) {
-        return DL.getTypeAllocSize(GV1->getValueType()) <
-               DL.getTypeAllocSize(GV2->getValueType());
+        // We don't support scalable global variables.
+        return DL.getTypeAllocSize(GV1->getValueType()).getFixedSize() <
+               DL.getTypeAllocSize(GV2->getValueType()).getFixedSize();
       });
 
   // If we want to just blindly group all globals together, do so.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88564.295257.patch
Type: text/x-patch
Size: 739 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200930/d34300c3/attachment.bin>


More information about the llvm-commits mailing list