Skip to content

Commit 127ac8c

Browse files
authored
[SPIR-V] Reland entry point patches (#14450)
Restores: * KhronosGroup/SPIRV-LLVM-Translator@85815e7 * KhronosGroup/SPIRV-LLVM-Translator@aded5af * `transFunctionAttrs()` part of KhronosGroup/SPIRV-LLVM-Translator@15e0aa9 And reverts 4e6a414, 6d84f3a, 6c524eb. Addresses p.2 and p.3 of #7592
1 parent 1a7e2f0 commit 127ac8c

35 files changed

+235
-116
lines changed

clang/test/Driver/sycl-linker-wrapper-image.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ int main() {
5353
// CHECK-DAG: @SYCL_PropSetName.3 = internal unnamed_addr constant [25 x i8] c"SYCL/device requirements\00"
5454
// CHECK-DAG: @SYCL_PropSetName.4 = internal unnamed_addr constant [22 x i8] c"SYCL/kernel param opt\00"
5555
// CHECK-DAG: @__sycl_offload_prop_sets_arr.5 = internal constant [3 x %_pi_device_binary_property_set_struct] [%_pi_device_binary_property_set_struct { ptr @SYCL_PropSetName, ptr @__sycl_offload_prop_sets_arr, ptr getelementptr ([1 x %_pi_device_binary_property_struct], ptr @__sycl_offload_prop_sets_arr, i64 0, i64 1) }, %_pi_device_binary_property_set_struct { ptr @SYCL_PropSetName.3, ptr @__sycl_offload_prop_sets_arr.2, ptr getelementptr ([1 x %_pi_device_binary_property_struct], ptr @__sycl_offload_prop_sets_arr.2, i64 0, i64 1) }, %_pi_device_binary_property_set_struct { ptr @SYCL_PropSetName.4, ptr null, ptr null }]
56-
// CHECK-DAG: @.sycl_offloading.0.data = internal unnamed_addr constant [772 x i8]
56+
// CHECK-DAG: @.sycl_offloading.0.data = internal unnamed_addr constant [912 x i8]
5757
// CHECK-DAG: @__sycl_offload_entry_name = internal unnamed_addr constant [25 x i8] c"_ZTSZ4mainE11fake_kernel\00"
5858
// CHECK-DAG: @__sycl_offload_entries_arr = internal constant [1 x %struct.__tgt_offload_entry] [%struct.__tgt_offload_entry { ptr null, ptr @__sycl_offload_entry_name, i64 0, i32 0, i32 0 }]
59-
// CHECK-DAG: @.sycl_offloading.0.info = internal local_unnamed_addr constant [2 x i64] [i64 ptrtoint (ptr @.sycl_offloading.0.data to i64), i64 772], section ".tgtimg", align 16
59+
// CHECK-DAG: @.sycl_offloading.0.info = internal local_unnamed_addr constant [2 x i64] [i64 ptrtoint (ptr @.sycl_offloading.0.data to i64), i64 912], section ".tgtimg", align 16
6060
// CHECK-DAG: @llvm.used = appending global [1 x ptr] [ptr @.sycl_offloading.0.info], section "llvm.metadata"
61-
// CHECK-DAG: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__sycl.tgt_device_image] [%__sycl.tgt_device_image { i16 2, i8 4, i8 0, ptr @.sycl_offloading.target.0, ptr @.sycl_offloading.opts.compile.0, ptr @.sycl_offloading.opts.link.0, ptr null, ptr null, ptr @.sycl_offloading.0.data, ptr getelementptr ([772 x i8], ptr @.sycl_offloading.0.data, i64 0, i64 772), ptr @__sycl_offload_entries_arr, ptr getelementptr ([1 x %struct.__tgt_offload_entry], ptr @__sycl_offload_entries_arr, i64 0, i64 1), ptr @__sycl_offload_prop_sets_arr.5, ptr getelementptr ([3 x %_pi_device_binary_property_set_struct], ptr @__sycl_offload_prop_sets_arr.5, i64 0, i64 3) }]
61+
// CHECK-DAG: @.sycl_offloading.device_images = internal unnamed_addr constant [1 x %__sycl.tgt_device_image] [%__sycl.tgt_device_image { i16 2, i8 4, i8 0, ptr @.sycl_offloading.target.0, ptr @.sycl_offloading.opts.compile.0, ptr @.sycl_offloading.opts.link.0, ptr null, ptr null, ptr @.sycl_offloading.0.data, ptr getelementptr ([912 x i8], ptr @.sycl_offloading.0.data, i64 0, i64 912), ptr @__sycl_offload_entries_arr, ptr getelementptr ([1 x %struct.__tgt_offload_entry], ptr @__sycl_offload_entries_arr, i64 0, i64 1), ptr @__sycl_offload_prop_sets_arr.5, ptr getelementptr ([3 x %_pi_device_binary_property_set_struct], ptr @__sycl_offload_prop_sets_arr.5, i64 0, i64 3) }]
6262
// CHECK-DAG: @.sycl_offloading.descriptor = internal constant %__sycl.tgt_bin_desc { i16 1, i16 1, ptr @.sycl_offloading.device_images, ptr null, ptr null }
6363
// CHECK-DAG: @llvm.global_ctors = {{.*}} { i32 1, ptr @sycl.descriptor_reg, ptr null }]
6464
// CHECK-DAG: @llvm.global_dtors = {{.*}} { i32 1, ptr @sycl.descriptor_unreg, ptr null }]

llvm-spirv/lib/SPIRV/SPIRVInternal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,7 @@ const static char TranslateOCLMemScope[] = "__translate_ocl_memory_scope";
369369
const static char TranslateSPIRVMemOrder[] = "__translate_spirv_memory_order";
370370
const static char TranslateSPIRVMemScope[] = "__translate_spirv_memory_scope";
371371
const static char TranslateSPIRVMemFence[] = "__translate_spirv_memory_fence";
372+
const static char EntrypointPrefix[] = "__spirv_entry_";
372373
const static char ConvertHandleToImageINTEL[] = "ConvertHandleToImageINTEL";
373374
const static char ConvertHandleToSamplerINTEL[] = "ConvertHandleToSamplerINTEL";
374375
const static char ConvertHandleToSampledImageINTEL[] =

llvm-spirv/lib/SPIRV/SPIRVReader.cpp

Lines changed: 20 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3317,6 +3317,25 @@ Function *SPIRVToLLVM::transFunction(SPIRVFunction *BF, unsigned AS) {
33173317
return Loc->second;
33183318

33193319
auto IsKernel = isKernel(BF);
3320+
3321+
if (IsKernel) {
3322+
// search for a previous function with the same name
3323+
// upgrade it to a kernel and drop this if it's found
3324+
for (auto &I : FuncMap) {
3325+
auto BFName = I.getFirst()->getName();
3326+
if (BF->getName() == BFName) {
3327+
auto *F = I.getSecond();
3328+
F->setCallingConv(CallingConv::SPIR_KERNEL);
3329+
F->setLinkage(GlobalValue::ExternalLinkage);
3330+
F->setDSOLocal(false);
3331+
F = cast<Function>(mapValue(BF, F));
3332+
mapFunction(BF, F);
3333+
transFunctionAttrs(BF, F);
3334+
return F;
3335+
}
3336+
}
3337+
}
3338+
33203339
auto Linkage = IsKernel ? GlobalValue::ExternalLinkage : transLinkageType(BF);
33213340
FunctionType *FT = cast<FunctionType>(transType(BF->getFunctionType()));
33223341
std::string FuncName = BF->getName();
@@ -3360,56 +3379,7 @@ Function *SPIRVToLLVM::transFunction(SPIRVFunction *BF, unsigned AS) {
33603379

33613380
F->setCallingConv(IsKernel ? CallingConv::SPIR_KERNEL
33623381
: CallingConv::SPIR_FUNC);
3363-
if (BF->hasDecorate(DecorationReferencedIndirectlyINTEL))
3364-
F->addFnAttr("referenced-indirectly");
3365-
if (isFuncNoUnwind())
3366-
F->addFnAttr(Attribute::NoUnwind);
3367-
foreachFuncCtlMask(BF, [&](Attribute::AttrKind Attr) { F->addFnAttr(Attr); });
3368-
3369-
for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E;
3370-
++I) {
3371-
auto BA = BF->getArgument(I->getArgNo());
3372-
mapValue(BA, &(*I));
3373-
setName(&(*I), BA);
3374-
AttributeMask IllegalAttrs =
3375-
AttributeFuncs::typeIncompatible(I->getType(), I->getAttributes());
3376-
BA->foreachAttr([&](SPIRVFuncParamAttrKind Kind) {
3377-
// Skip this function parameter attribute as it will translated among
3378-
// OpenCL metadata
3379-
if (Kind == FunctionParameterAttributeRuntimeAlignedINTEL)
3380-
return;
3381-
Attribute::AttrKind LLVMKind = SPIRSPIRVFuncParamAttrMap::rmap(Kind);
3382-
if (IllegalAttrs.contains(LLVMKind))
3383-
return;
3384-
Type *AttrTy = nullptr;
3385-
switch (LLVMKind) {
3386-
case Attribute::AttrKind::ByVal:
3387-
case Attribute::AttrKind::StructRet:
3388-
AttrTy = transType(BA->getType()->getPointerElementType());
3389-
break;
3390-
default:
3391-
break; // do nothing
3392-
}
3393-
// Make sure to use a correct constructor for a typed/typeless attribute
3394-
auto A = AttrTy ? Attribute::get(*Context, LLVMKind, AttrTy)
3395-
: Attribute::get(*Context, LLVMKind);
3396-
I->addAttr(A);
3397-
});
3398-
3399-
AttrBuilder Builder(*Context);
3400-
SPIRVWord MaxOffset = 0;
3401-
if (BA->hasDecorate(DecorationMaxByteOffset, 0, &MaxOffset))
3402-
Builder.addDereferenceableAttr(MaxOffset);
3403-
SPIRVWord AlignmentBytes = 0;
3404-
if (BA->hasDecorate(DecorationAlignment, 0, &AlignmentBytes))
3405-
Builder.addAlignmentAttr(AlignmentBytes);
3406-
I->addAttrs(Builder);
3407-
}
3408-
BF->foreachReturnValueAttr([&](SPIRVFuncParamAttrKind Kind) {
3409-
if (Kind == FunctionParameterAttributeNoWrite)
3410-
return;
3411-
F->addRetAttr(SPIRSPIRVFuncParamAttrMap::rmap(Kind));
3412-
});
3382+
transFunctionAttrs(BF, F);
34133383

34143384
// Creating all basic blocks before creating instructions.
34153385
for (size_t I = 0, E = BF->getNumBasicBlock(); I != E; ++I) {

llvm-spirv/lib/SPIRV/SPIRVRegularizeLLVM.cpp

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "SPIRVRegularizeLLVM.h"
4040
#include "OCLUtil.h"
4141
#include "SPIRVInternal.h"
42+
#include "SPIRVMDWalker.h"
4243
#include "libSPIRV/SPIRVDebug.h"
4344

4445
#include "llvm/ADT/StringExtras.h" // llvm::isDigit
@@ -637,6 +638,7 @@ void prepareCacheControlsTranslation(Metadata *MD, Instruction *Inst) {
637638
/// Remove entities not representable by SPIR-V
638639
bool SPIRVRegularizeLLVMBase::regularize() {
639640
eraseUselessFunctions(M);
641+
addKernelEntryPoint(M);
640642
expandSYCLTypeUsing(M);
641643
cleanupConversionToNonStdIntegers(M);
642644

@@ -834,6 +836,69 @@ bool SPIRVRegularizeLLVMBase::regularize() {
834836
return true;
835837
}
836838

839+
void SPIRVRegularizeLLVMBase::addKernelEntryPoint(Module *M) {
840+
std::vector<Function *> Work;
841+
842+
// Get a list of all functions that have SPIR kernel calling conv
843+
for (auto &F : *M) {
844+
if (F.getCallingConv() == CallingConv::SPIR_KERNEL)
845+
Work.push_back(&F);
846+
}
847+
for (auto &F : Work) {
848+
// for declarations just make them into SPIR functions.
849+
F->setCallingConv(CallingConv::SPIR_FUNC);
850+
if (F->isDeclaration())
851+
continue;
852+
853+
// Otherwise add a wrapper around the function to act as an entry point.
854+
FunctionType *FType = F->getFunctionType();
855+
std::string WrapName =
856+
kSPIRVName::EntrypointPrefix + static_cast<std::string>(F->getName());
857+
Function *WrapFn =
858+
getOrCreateFunction(M, F->getReturnType(), FType->params(), WrapName);
859+
860+
auto *CallBB = BasicBlock::Create(M->getContext(), "", WrapFn);
861+
IRBuilder<> Builder(CallBB);
862+
863+
Function::arg_iterator DestI = WrapFn->arg_begin();
864+
for (const Argument &I : F->args()) {
865+
DestI->setName(I.getName());
866+
DestI++;
867+
}
868+
SmallVector<Value *, 1> Args;
869+
for (Argument &I : WrapFn->args()) {
870+
Args.emplace_back(&I);
871+
}
872+
auto *CI = CallInst::Create(F, ArrayRef<Value *>(Args), "", CallBB);
873+
CI->setCallingConv(F->getCallingConv());
874+
CI->setAttributes(F->getAttributes());
875+
876+
// copy over all the metadata (should it be removed from F?)
877+
SmallVector<std::pair<unsigned, MDNode *>> MDs;
878+
F->getAllMetadata(MDs);
879+
WrapFn->setAttributes(F->getAttributes());
880+
for (auto MD = MDs.begin(), End = MDs.end(); MD != End; ++MD) {
881+
WrapFn->addMetadata(MD->first, *MD->second);
882+
}
883+
WrapFn->setCallingConv(CallingConv::SPIR_KERNEL);
884+
WrapFn->setLinkage(llvm::GlobalValue::InternalLinkage);
885+
886+
Builder.CreateRet(F->getReturnType()->isVoidTy() ? nullptr : CI);
887+
888+
// Have to find the spir-v metadata for execution mode and transfer it to
889+
// the wrapper.
890+
if (auto NMD = SPIRVMDWalker(*M).getNamedMD(kSPIRVMD::ExecutionMode)) {
891+
while (!NMD.atEnd()) {
892+
Function *MDF = nullptr;
893+
auto N = NMD.nextOp(); /* execution mode MDNode */
894+
N.get(MDF);
895+
if (MDF == F)
896+
N.M->replaceOperandWith(0, ValueAsMetadata::get(WrapFn));
897+
}
898+
}
899+
}
900+
}
901+
837902
} // namespace SPIRV
838903

839904
INITIALIZE_PASS(SPIRVRegularizeLLVMLegacy, "spvregular",

llvm-spirv/lib/SPIRV/SPIRVRegularizeLLVM.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class SPIRVRegularizeLLVMBase {
5151
// Lower functions
5252
bool regularize();
5353

54+
// SPIR-V disallows functions being entrypoints and called
55+
// LLVM doesn't. This adds a wrapper around the entry point
56+
// that later SPIR-V writer renames.
57+
void addKernelEntryPoint(Module *M);
58+
5459
/// Some LLVM intrinsics that have no SPIR-V counterpart may be wrapped in
5560
/// @spirv.llvm_intrinsic_* function. During reverse translation from SPIR-V
5661
/// to LLVM IR we can detect this @spirv.llvm_intrinsic_* function and

llvm-spirv/lib/SPIRV/SPIRVWriter.cpp

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -906,13 +906,19 @@ SPIRVFunction *LLVMToSPIRVBase::transFunctionDecl(Function *F) {
906906
static_cast<SPIRVFunction *>(mapValue(F, BM->addFunction(BFT)));
907907
BF->setFunctionControlMask(transFunctionControlMask(F));
908908
if (F->hasName()) {
909-
if (isUniformGroupOperation(F))
910-
BM->getErrorLog().checkError(
911-
BM->isAllowedToUseExtension(
912-
ExtensionID::SPV_KHR_uniform_group_instructions),
913-
SPIRVEC_RequiresExtension, "SPV_KHR_uniform_group_instructions\n");
914-
915-
BM->setName(BF, F->getName().str());
909+
if (isKernel(F)) {
910+
/* strip the prefix as the runtime will be looking for this name */
911+
std::string Prefix = kSPIRVName::EntrypointPrefix;
912+
std::string Name = F->getName().str();
913+
BM->setName(BF, Name.substr(Prefix.size()));
914+
} else {
915+
if (isUniformGroupOperation(F))
916+
BM->getErrorLog().checkError(
917+
BM->isAllowedToUseExtension(
918+
ExtensionID::SPV_KHR_uniform_group_instructions),
919+
SPIRVEC_RequiresExtension, "SPV_KHR_uniform_group_instructions\n");
920+
BM->setName(BF, F->getName().str());
921+
}
916922
}
917923
if (!isKernel(F) && F->getLinkage() != GlobalValue::InternalLinkage)
918924
BF->setLinkageType(transLinkageType(F));
@@ -5911,7 +5917,7 @@ void LLVMToSPIRVBase::transFunction(Function *I) {
59115917

59125918
if (isKernel(I)) {
59135919
auto Interface = collectEntryPointInterfaces(BF, I);
5914-
BM->addEntryPoint(ExecutionModelKernel, BF->getId(), I->getName().str(),
5920+
BM->addEntryPoint(ExecutionModelKernel, BF->getId(), BF->getName(),
59155921
Interface);
59165922
}
59175923
}
@@ -6278,8 +6284,9 @@ bool LLVMToSPIRVBase::transMetadata() {
62786284
// Work around to translate kernel_arg_type and kernel_arg_type_qual metadata
62796285
static void transKernelArgTypeMD(SPIRVModule *BM, Function *F, MDNode *MD,
62806286
std::string MDName) {
6281-
std::string KernelArgTypesMDStr =
6282-
std::string(MDName) + "." + F->getName().str() + ".";
6287+
std::string Prefix = kSPIRVName::EntrypointPrefix;
6288+
std::string Name = F->getName().str().substr(Prefix.size());
6289+
std::string KernelArgTypesMDStr = std::string(MDName) + "." + Name + ".";
62836290
for (const auto &TyOp : MD->operands())
62846291
KernelArgTypesMDStr += cast<MDString>(TyOp)->getString().str() + ",";
62856292
BM->getString(KernelArgTypesMDStr);

llvm-spirv/test/entry_point_func.ll

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
;; Test to check that an LLVM spir_kernel gets translated into an
2+
;; Entrypoint wrapper and Function with LinkageAttributes
3+
; RUN: llvm-as %s -o %t.bc
4+
; RUN: llvm-spirv %t.bc -o - -spirv-text | FileCheck %s --check-prefix=CHECK-SPIRV
5+
; RUN: llvm-spirv %t.bc -o %t.spv
6+
; RUN: spirv-val %t.spv
7+
8+
target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64"
9+
target triple = "spir64-unknown-unknown"
10+
11+
define spir_kernel void @testfunction() {
12+
ret void
13+
}
14+
15+
define spir_kernel void @callerfunction() {
16+
call spir_kernel void @testfunction()
17+
call spir_kernel void @testdeclaration()
18+
ret void
19+
}
20+
21+
declare spir_kernel void @testdeclaration()
22+
23+
; Check there is an entrypoint and a function produced.
24+
; CHECK-SPIRV: EntryPoint 6 [[#TestEn:]] "testfunction"
25+
; CHECK-SPIRV: EntryPoint 6 [[#CallerEn:]] "callerfunction"
26+
; CHECK-SPIRV: Name [[#TestDecl:]] "testdeclaration"
27+
; CHECK-SPIRV: Name [[#TestFn:]] "testfunction"
28+
; CHECK-SPIRV: Name [[#CallerFn:]] "callerfunction"
29+
; CHECK-SPIRV: Decorate [[#TestDecl]] LinkageAttributes "testdeclaration" Import
30+
; CHECK-SPIRV: Decorate [[#TestFn]] LinkageAttributes "testfunction" Export
31+
; CHECK-SPIRV: Decorate [[#CallerFn]] LinkageAttributes "callerfunction" Export
32+
33+
; CHECK-SPIRV: Function [[#]] [[#TestDecl]] [[#]] [[#]]
34+
; CHECK-SPIRV-EMPTY:
35+
; CHECK-SPIRV-NEXT: FunctionEnd
36+
37+
; CHECK-SPIRV: Function [[#]] [[#TestFn]] [[#]] [[#]]
38+
; CHECK-SPIRV-EMPTY:
39+
; CHECK-SPIRV-NEXT: Label
40+
; CHECK-SPIRV-NEXT: Return
41+
; CHECK-SPIRV-EMPTY:
42+
; CHECK-SPIRV-NEXT: FunctionEnd
43+
44+
; CHECK-SPIRV: Function [[#]] [[#CallerFn]] [[#]] [[#]]
45+
; CHECK-SPIRV-EMPTY:
46+
; CHECK-SPIRV-NEXT: Label
47+
; CHECK-SPIRV-NEXT: FunctionCall [[#]] [[#]] [[#TestFn]]
48+
; CHECK-SPIRV-NEXT: FunctionCall [[#]] [[#]] [[#TestDecl]]
49+
; CHECK-SPIRV-NEXT: Return
50+
; CHECK-SPIRV-EMPTY:
51+
; CHECK-SPIRV-NEXT: FunctionEnd
52+
53+
54+
; CHECK-SPIRV: Function [[#]] [[#TestEn]] [[#]] [[#]]
55+
; CHECK-SPIRV-EMPTY:
56+
; CHECK-SPIRV-NEXT: Label
57+
; CHECK-SPIRV-NEXT: FunctionCall [[#]] [[#]] [[#TestFn]]
58+
; CHECK-SPIRV-NEXT: Return
59+
; CHECK-SPIRV-EMPTY:
60+
; CHECK-SPIRV-NEXT: FunctionEnd
61+
62+
; CHECK-SPIRV: Function [[#]] [[#CallerEn]] [[#]] [[#]]
63+
; CHECK-SPIRV-EMPTY:
64+
; CHECK-SPIRV-NEXT: Label
65+
; CHECK-SPIRV-NEXT: FunctionCall [[#]] [[#]] [[#CallerFn]]
66+
; CHECK-SPIRV-NEXT: Return
67+
; CHECK-SPIRV-EMPTY:
68+
; CHECK-SPIRV-NEXT: FunctionEnd

llvm-spirv/test/extensions/INTEL/SPV_INTEL_cache_controls/multiple-decoration-single-arg.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
; RUN: llvm-spirv --spirv-ext=+SPV_INTEL_cache_controls %t.bc -o %t.spv
44
; RUN: llvm-spirv -r %t.spv --spirv-target-env=SPV-IR -o - | llvm-dis -o - | FileCheck %s --check-prefix=CHECK-LLVM
55

6-
; CHECK-SPIRV-DAG: EntryPoint [[#]] [[#Func:]] "test"
7-
; CHECK-SPIRV-DAG: EntryPoint [[#]] [[#FuncGEP:]] "test_gep"
6+
; CHECK-SPIRV-DAG: Name [[#Func:]] "test"
7+
; CHECK-SPIRV-DAG: Name [[#FuncGEP:]] "test_gep"
88
; CHECK-SPIRV-DAG: TypeInt [[#Int32:]] 32 0
99
; CHECK-SPIRV-DAG: Constant [[#Int32]] [[#Zero:]] 0
1010
; CHECK-SPIRV-DAG: Decorate [[#GEP1:]] CacheControlLoadINTEL 1 1

llvm-spirv/test/extensions/INTEL/SPV_INTEL_fpga_argument_interfaces/sycl-kernel-arg-annotation.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ entry:
5353
; CHECK-SPIRV: Capability FPGAArgumentInterfacesINTEL
5454
; CHECK-SPIRV: Extension "SPV_INTEL_fpga_argument_interfaces"
5555
; CHECK-SPIRV: Extension "SPV_INTEL_fpga_buffer_location"
56+
; CHECK-SPIRV-DAG: Name [[IDS:[0-9]+]] "_arg_p"
5657
; CHECK-SPIRV-DAG: Name [[ID:[0-9]+]] "_arg_p"
5758
; CHECK-SPIRV: Decorate [[ID]] Alignment 4
5859
; CHECK-SPIRV: Decorate [[ID]] MMHostInterfaceAddressWidthINTEL 32

llvm-spirv/test/extensions/INTEL/SPV_INTEL_function_pointers/CodeSectionINTEL/alias.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ target triple = "spir64-unknown-unknown"
1010
; when used since they can't be translated directly.
1111

1212
; CHECK-SPIRV-DAG: Name [[#FOO:]] "foo"
13-
; CHECK-SPIRV-DAG: EntryPoint [[#]] [[#BAR:]] "bar"
13+
; CHECK-SPIRV-DAG: Name [[#BAR:]] "bar"
1414
; CHECK-SPIRV-DAG: Name [[#Y:]] "y"
1515
; CHECK-SPIRV-DAG: Name [[#FOOPTR:]] "foo.alias"
1616
; CHECK-SPIRV-DAG: Decorate [[#FOO]] LinkageAttributes "foo" Export
17-
; INTEL-CHECK-SPIRV-DAG: Decorate [[#BAR]] LinkageAttributes "bar" Export
17+
; CHECK-SPIRV-DAG: Decorate [[#BAR]] LinkageAttributes "bar" Export
1818
; CHECK-SPIRV-DAG: TypeInt [[#I32:]] 32 0
1919
; CHECK-SPIRV-DAG: TypeInt [[#I64:]] 64 0
2020
; CHECK-SPIRV-DAG: TypeFunction [[#FOO_TYPE:]] [[#I32]] [[#I32]]

0 commit comments

Comments
 (0)