[llvm] f580683 - [ARM] Support neon.vld auto-upgrade with opaque pointers

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 11 07:35:08 PDT 2021


Author: Nikita Popov
Date: 2021-09-11T16:34:32+02:00
New Revision: f5806830e064154a42d70b51863d4d4afe706fc5

URL: https://github.com/llvm/llvm-project/commit/f5806830e064154a42d70b51863d4d4afe706fc5
DIFF: https://github.com/llvm/llvm-project/commit/f5806830e064154a42d70b51863d4d4afe706fc5.diff

LOG: [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.

Added: 
    

Modified: 
    llvm/lib/IR/AutoUpgrade.cpp
    llvm/test/CodeGen/ARM/vld-vst-upgrade.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 0f20206f976a..aaa9b04ffbba 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 fe868f6cb078..8964e2a7e894 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> }


        


More information about the llvm-commits mailing list