From f5806830e064154a42d70b51863d4d4afe706fc5 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 11 Sep 2021 16:33:19 +0200 Subject: [PATCH] [ARM] Support neon.vld auto-upgrade with opaque pointers This code manually constructs the intrinsic name, so we need to use p0 instead of p0i8 in opaque pointer mode. --- llvm/lib/IR/AutoUpgrade.cpp | 4 +++- llvm/test/CodeGen/ARM/vld-vst-upgrade.ll | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp index 0f20206..aaa9b04 100644 --- a/llvm/lib/IR/AutoUpgrade.cpp +++ b/llvm/lib/IR/AutoUpgrade.cpp @@ -583,8 +583,10 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) { // Can't use Intrinsic::getDeclaration here as the return types might // then only be structurally equal. FunctionType* fType = FunctionType::get(F->getReturnType(), Tys, false); + StringRef Suffix = + F->getContext().supportsTypedPointers() ? "p0i8" : "p0"; NewFn = Function::Create(fType, F->getLinkage(), F->getAddressSpace(), - "llvm." + Name + ".p0i8", F->getParent()); + "llvm." + Name + "." + Suffix, F->getParent()); return true; } static const Regex vstRegex("^arm\\.neon\\.vst([1234]|[234]lane)\\.v[a-z0-9]*$"); diff --git a/llvm/test/CodeGen/ARM/vld-vst-upgrade.ll b/llvm/test/CodeGen/ARM/vld-vst-upgrade.ll index fe868f6..8964e2a 100644 --- a/llvm/test/CodeGen/ARM/vld-vst-upgrade.ll +++ b/llvm/test/CodeGen/ARM/vld-vst-upgrade.ll @@ -1,4 +1,5 @@ ; RUN: llc -mtriple=arm-eabi -mattr=+neon < %s | FileCheck %s +; RUN: llc -mtriple=arm-eabi -mattr=+neon -opaque-pointers < %s | FileCheck %s %struct.__neon_int32x2x2_t = type { <2 x i32>, <2 x i32> } %struct.__neon_int32x2x3_t = type { <2 x i32>, <2 x i32>, <2 x i32> } -- 2.7.4