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

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

Differential Revision: https://reviews.llvm.org/D88564
This commit is contained in:
David Sherwood 2020-09-30 14:18:03 +01:00
parent 6428f0596b
commit 42f980da4f

View File

@ -223,8 +223,9 @@ bool GlobalMerge::doMerge(SmallVectorImpl<GlobalVariable*> &Globals,
// 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.