aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/VectorUtils.cpp
diff options
context:
space:
mode:
authorDavid Sherwood <david.sherwood@arm.com>2021-02-08 17:16:03 +0000
committerDavid Sherwood <david.sherwood@arm.com>2021-02-12 09:38:12 +0000
commit9700228abc78db18b90c4e5fdb0c9cd582415e56 (patch)
tree1dabe0f016e2e7efb13fba6011a60549210e5327 /llvm/lib/Analysis/VectorUtils.cpp
parent891e769ab68f2cdbd105cb42f5c2f40051c70837 (diff)
downloadllvm-9700228abc78db18b90c4e5fdb0c9cd582415e56.zip
llvm-9700228abc78db18b90c4e5fdb0c9cd582415e56.tar.gz
llvm-9700228abc78db18b90c4e5fdb0c9cd582415e56.tar.bz2
[Analysis] Change VFABI::mangleTLIVectorName to use ElementCount
Adds support for mangling TLI vector names for scalable vectors. Differential Revision: https://reviews.llvm.org/D96338
Diffstat (limited to 'llvm/lib/Analysis/VectorUtils.cpp')
-rw-r--r--llvm/lib/Analysis/VectorUtils.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/VectorUtils.cpp b/llvm/lib/Analysis/VectorUtils.cpp
index 9a4c96b..a6070b6 100644
--- a/llvm/lib/Analysis/VectorUtils.cpp
+++ b/llvm/lib/Analysis/VectorUtils.cpp
@@ -1300,10 +1300,14 @@ void InterleaveGroup<Instruction>::addMetadata(Instruction *NewInst) const {
std::string VFABI::mangleTLIVectorName(StringRef VectorName,
StringRef ScalarName, unsigned numArgs,
- unsigned VF) {
+ ElementCount VF) {
SmallString<256> Buffer;
llvm::raw_svector_ostream Out(Buffer);
- Out << "_ZGV" << VFABI::_LLVM_ << "N" << VF;
+ Out << "_ZGV" << VFABI::_LLVM_ << "N";
+ if (VF.isScalable())
+ Out << 'x';
+ else
+ Out << VF.getFixedValue();
for (unsigned I = 0; I < numArgs; ++I)
Out << "v";
Out << "_" << ScalarName << "(" << VectorName << ")";