From ab4c4e50dbdcc00cb5b54d217f5b1a213f4a0521 Mon Sep 17 00:00:00 2001 From: Joshua Batista Date: Thu, 30 Nov 2023 17:06:40 -0800 Subject: [PATCH] Remove ExtractRecordStructFromArray intrinsic (#6025) The ExtractRecordStructFromArray intrinsic is left over dead code that should be removed. This PR removes the intrinsic from existence. In the cases where this intrinsic was used, DefaultSubscript is used instead. Moved from #5893 to target the main branch instead. Fixes https://github.com/microsoft/DirectXShaderCompiler/issues/5351 --- include/dxc/HlslIntrinsicOp.h | 1 - lib/HLSL/HLOperationLower.cpp | 18 ++- tools/clang/lib/AST/ASTContextHLSL.cpp | 9 +- .../hlsl/workgraph/ast-nodeinput.hlsl | 8 +- .../hlsl/workgraph/ast-nodeoutput.hlsl | 32 ++-- .../hlsl/workgraph/ast-rwnodeinput.hlsl | 16 +- .../passes/hl/sroa_hlsl/NodeInput_type.ll | 139 ++++++++---------- utils/hct/gen_intrin_main.txt | 2 - 8 files changed, 107 insertions(+), 118 deletions(-) diff --git a/include/dxc/HlslIntrinsicOp.h b/include/dxc/HlslIntrinsicOp.h index a830652083..9d0f0a2b28 100644 --- a/include/dxc/HlslIntrinsicOp.h +++ b/include/dxc/HlslIntrinsicOp.h @@ -23,7 +23,6 @@ enum class IntrinsicOp { IOP_EvaluateAttributeAtSample, IOP_EvaluateAttributeCentroid, IOP_EvaluateAttributeSnapped, - IOP_ExtractRecordStructFromArray, IOP_GeometryIndex, IOP_GetAttributeAtVertex, IOP_GetRemainingRecursionLevels, diff --git a/lib/HLSL/HLOperationLower.cpp b/lib/HLSL/HLOperationLower.cpp index 70494a0350..c534e5f9ae 100644 --- a/lib/HLSL/HLOperationLower.cpp +++ b/lib/HLSL/HLOperationLower.cpp @@ -6442,8 +6442,6 @@ IntrinsicLower gLowerTable[] = { DXIL::OpCode::EvalCentroid}, {IntrinsicOp::IOP_EvaluateAttributeSnapped, TranslateEvalSnapped, DXIL::OpCode::NumOpCodes}, - {IntrinsicOp::IOP_ExtractRecordStructFromArray, EmptyLower, - DXIL::OpCode::NumOpCodes}, {IntrinsicOp::IOP_GeometryIndex, TrivialNoArgWithRetOperation, DXIL::OpCode::GeometryIndex}, {IntrinsicOp::IOP_GetAttributeAtVertex, TranslateGetAttributeAtVertex, @@ -9098,7 +9096,7 @@ void TranslateHLSubscript(CallInst *CI, HLSubscriptOpcode opcode, Type *HandleTy = hlslOP->GetHandleType(); if (ptr->getType() == hlslOP->GetNodeRecordHandleType()) { DXASSERT(false, "Shouldn't get here, NodeRecord subscripts should have " - "generated ExtractRecordStructFromArray intrinsic"); + "been lowered in LowerRecordAccessToGetNodeRecordPtr"); return; } if (ptr->getType() == HandleTy) { @@ -9493,16 +9491,24 @@ void LowerRecordAccessToGetNodeRecordPtr(HLModule &HLM) { if (F->user_empty()) continue; hlsl::HLOpcodeGroup group = hlsl::GetHLOpcodeGroup(F); - if (group == HLOpcodeGroup::HLIntrinsic) { + if (group == HLOpcodeGroup::HLSubscript) { for (auto U = F->user_begin(); U != F->user_end();) { Value *User = *(U++); if (!isa(User)) continue; // must be call inst CallInst *CI = cast(User); - IntrinsicOp opcode = static_cast(hlsl::GetHLOpcode(CI)); - if (opcode != IntrinsicOp::IOP_ExtractRecordStructFromArray) + HLSubscriptOpcode opcode = + static_cast(hlsl::GetHLOpcode(CI)); + if (opcode != HLSubscriptOpcode::DefaultSubscript) + continue; + + hlsl::OP *OP = &helper.hlslOP; + Value *Handle = CI->getArgOperand(HLOperandIndex::kHandleOpIdx); + if (Handle->getType() != OP->GetNodeRecordHandleType()) { continue; + } + Value *Index = CI->getNumArgOperands() > 2 ? CI->getArgOperand(2) : ConstantInt::get(helper.i32Ty, 0); diff --git a/tools/clang/lib/AST/ASTContextHLSL.cpp b/tools/clang/lib/AST/ASTContextHLSL.cpp index b6a5413e68..87c1ba5492 100644 --- a/tools/clang/lib/AST/ASTContextHLSL.cpp +++ b/tools/clang/lib/AST/ASTContextHLSL.cpp @@ -440,11 +440,10 @@ static void AddRecordAccessMethod(clang::ASTContext &Ctx, IndexParam->setDefaultArg(ConstantZero); } - StringRef OpcodeGroup = GetHLOpcodeGroupName(HLOpcodeGroup::HLIntrinsic); - unsigned Opcode = - static_cast(IntrinsicOp::IOP_ExtractRecordStructFromArray); - MethodDecl->addAttr(HLSLIntrinsicAttr::CreateImplicit( - Ctx, OpcodeGroup, "ExtractRecordStructFromArray", Opcode)); + StringRef OpcodeGroup = GetHLOpcodeGroupName(HLOpcodeGroup::HLSubscript); + unsigned Opcode = static_cast(HLSubscriptOpcode::DefaultSubscript); + MethodDecl->addAttr( + HLSLIntrinsicAttr::CreateImplicit(Ctx, OpcodeGroup, "", Opcode)); MethodDecl->addAttr(HLSLCXXOverloadAttr::CreateImplicit(Ctx)); } diff --git a/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeinput.hlsl b/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeinput.hlsl index 9d375cd02a..7f5de6606b 100644 --- a/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeinput.hlsl +++ b/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeinput.hlsl @@ -20,7 +20,7 @@ void node01(DispatchNodeInputRecord input) {} //CHECK-NEXT: HLSLNodeObjectAttr {{0x[0-9a-fA-F]+}} <> Implicit DispatchNodeInputRecord //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordtype &() const' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: ClassTemplateSpecializationDecl {{0x[0-9a-fA-F]+}} <> struct DispatchNodeInputRecord definition @@ -38,11 +38,11 @@ void node02(GroupNodeInputRecords input) {} //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordtype &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' cinit //CHECK-NEXT: IntegerLiteral {{0x[0-9a-fA-F]+}} <> 'unsigned int' 0 -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'const recordtype &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: FunctionTemplateDecl {{0x[0-9a-fA-F]+}} <> operator[] //CHECK-NEXT: TemplateTypeParmDecl {{0x[0-9a-fA-F]+}} <> class recordtype @@ -65,7 +65,7 @@ void node03(ThreadNodeInputRecord input) {} //CHECK-NEXT: HLSLNodeObjectAttr {{0x[0-9a-fA-F]+}} <> Implicit ThreadNodeInputRecord //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordtype &() const' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: ClassTemplateSpecializationDecl {{0x[0-9a-fA-F]+}} <> struct ThreadNodeInputRecord definition diff --git a/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeoutput.hlsl b/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeoutput.hlsl index be715e4c22..423db5292f 100644 --- a/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeoutput.hlsl +++ b/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-nodeoutput.hlsl @@ -26,21 +26,21 @@ void node01(NodeOutput output) //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'recordType &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'const recordType &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'recordType &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' cinit //CHECK-NEXT: IntegerLiteral {{0x[0-9a-fA-F]+}} <> 'unsigned int' 0 -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordType &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' cinit //CHECK-NEXT: IntegerLiteral {{0x[0-9a-fA-F]+}} <> 'unsigned int' 0 -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: FunctionTemplateDecl {{0x[0-9a-fA-F]+}} <> operator[] //CHECK-NEXT: TemplateTypeParmDecl {{0x[0-9a-fA-F]+}} <> class recordType @@ -57,19 +57,19 @@ void node01(NodeOutput output) //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'RECORD &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'const RECORD &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'RECORD &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const RECORD &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: FunctionTemplateDecl {{0x[0-9a-fA-F]+}} <> operator[] //CHECK-NEXT: TemplateTypeParmDecl {{0x[0-9a-fA-F]+}} <> class recordType @@ -98,21 +98,21 @@ void node02(NodeOutput output) //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'recordType &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'const recordType &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'recordType &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' cinit //CHECK-NEXT: IntegerLiteral {{0x[0-9a-fA-F]+}} <> 'unsigned int' 0 -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordType &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' cinit //CHECK-NEXT: IntegerLiteral {{0x[0-9a-fA-F]+}} <> 'unsigned int' 0 -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: FunctionTemplateDecl {{0x[0-9a-fA-F]+}} <> operator[] //CHECK-NEXT: TemplateTypeParmDecl {{0x[0-9a-fA-F]+}} <> class recordType @@ -129,19 +129,19 @@ void node02(NodeOutput output) //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'RECORD &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'const RECORD &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'RECORD &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const RECORD &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: FunctionTemplateDecl {{0x[0-9a-fA-F]+}} <> operator[] //CHECK-NEXT: TemplateTypeParmDecl {{0x[0-9a-fA-F]+}} <> class recordType diff --git a/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-rwnodeinput.hlsl b/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-rwnodeinput.hlsl index aa08dd9139..fb34e2094a 100644 --- a/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-rwnodeinput.hlsl +++ b/tools/clang/test/HLSLFileCheck/hlsl/workgraph/ast-rwnodeinput.hlsl @@ -20,10 +20,10 @@ void node01(RWDispatchNodeInputRecord input) {} //CHECK-NEXT: HLSLNodeObjectAttr {{0x[0-9a-fA-F]+}} <> Implicit RWDispatchNodeInputRecord //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'recordtype &()' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordtype &() const' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: FunctionTemplateDecl {{0x[0-9a-fA-F]+}} <> FinishedCrossGroupSharing //CHECK-NEXT: TemplateTypeParmDecl {{0x[0-9a-fA-F]+}} <> class TResult @@ -44,20 +44,20 @@ void node02(RWGroupNodeInputRecords input) {} //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'recordtype &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' cinit //CHECK-NEXT: IntegerLiteral {{0x[0-9a-fA-F]+}} <> 'unsigned int' 0 -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordtype &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' cinit //CHECK-NEXT: IntegerLiteral {{0x[0-9a-fA-F]+}} <> 'unsigned int' 0 -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'recordtype &(unsigned int)' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> operator[] 'const recordtype &(unsigned int) const' //CHECK-NEXT: ParmVarDecl {{0x[0-9a-fA-F]+}} <> Index 'unsigned int' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: FunctionTemplateDecl {{0x[0-9a-fA-F]+}} <> operator[] //CHECK-NEXT: TemplateTypeParmDecl {{0x[0-9a-fA-F]+}} <> class recordtype @@ -80,9 +80,9 @@ void node03(RWThreadNodeInputRecord input) {} //CHECK-NEXT: HLSLNodeObjectAttr {{0x[0-9a-fA-F]+}} <> Implicit RWThreadNodeInputRecord //CHECK-NEXT: FieldDecl {{0x[0-9a-fA-F]+}} <> implicit h 'int' //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'recordtype &()' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: CXXMethodDecl {{0x[0-9a-fA-F]+}} <> Get 'const recordtype &() const' -//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "op" "ExtractRecordStructFromArray" +//CHECK-NEXT: HLSLIntrinsicAttr {{0x[0-9a-fA-F]+}} <> Implicit "subscript" "" 0 //CHECK-NEXT: HLSLCXXOverloadAttr {{0x[0-9a-fA-F]+}} <> Implicit //CHECK-NEXT: ClassTemplateSpecializationDecl {{0x[0-9a-fA-F]+}} <> struct RWThreadNodeInputRecord definition diff --git a/tools/clang/test/HLSLFileCheck/passes/hl/sroa_hlsl/NodeInput_type.ll b/tools/clang/test/HLSLFileCheck/passes/hl/sroa_hlsl/NodeInput_type.ll index 69f75e1a91..bf3e294806 100644 --- a/tools/clang/test/HLSLFileCheck/passes/hl/sroa_hlsl/NodeInput_type.ll +++ b/tools/clang/test/HLSLFileCheck/passes/hl/sroa_hlsl/NodeInput_type.ll @@ -19,7 +19,7 @@ target triple = "dxil-ms-dx" %dx.types.NodeRecordHandle = type { i8* } %dx.types.NodeRecordInfo = type { i32, i32 } %"struct.GroupNodeOutputRecords" = type { i32 } -%struct.loadStressRecord = type { [29 x i32] } +%struct.loadStressRecord = type { [29 x i32], <3 x i32> } @"$Globals" = external constant %ConstantBuffer @@ -34,87 +34,76 @@ define void @loadStress_16(%"struct.DispatchNodeInputRecord"* entry: %val.i = alloca i32, align 4 %0 = call %dx.types.NodeHandle @"dx.hl.createnodeoutputhandle..%dx.types.NodeHandle (i32, i32)"(i32 11, i32 0) - %1 = call %dx.types.NodeHandle @"dx.hl.annotatenodehandle..%dx.types.NodeHandle (i32, %dx.types.NodeHandle, %dx.types.NodeInfo)"(i32 16, %dx.types.NodeHandle %0, %dx.types.NodeInfo { i32 6, i32 116 }) + %1 = call %dx.types.NodeHandle @"dx.hl.annotatenodehandle..%dx.types.NodeHandle (i32, %dx.types.NodeHandle, %dx.types.NodeInfo)"(i32 16, %dx.types.NodeHandle %0, %dx.types.NodeInfo { i32 6, i32 128 }) %2 = call %"struct.NodeOutput" @"dx.hl.cast..%\22struct.NodeOutput\22 (i32, %dx.types.NodeHandle)"(i32 9, %dx.types.NodeHandle %1) store %"struct.NodeOutput" %2, %"struct.NodeOutput"* %loadStressChild %3 = call %dx.types.NodeRecordHandle @"dx.hl.createnodeinputrecordhandle..%dx.types.NodeRecordHandle (i32, i32)"(i32 13, i32 0) - %4 = call %dx.types.NodeRecordHandle @"dx.hl.annotatenoderecordhandle..%dx.types.NodeRecordHandle (i32, %dx.types.NodeRecordHandle, %dx.types.NodeRecordInfo)"(i32 17, %dx.types.NodeRecordHandle %3, %dx.types.NodeRecordInfo { i32 97, i32 116 }) + %4 = call %dx.types.NodeRecordHandle @"dx.hl.annotatenoderecordhandle..%dx.types.NodeRecordHandle (i32, %dx.types.NodeRecordHandle, %dx.types.NodeRecordInfo)"(i32 17, %dx.types.NodeRecordHandle %3, %dx.types.NodeRecordInfo { i32 97, i32 128 }) %5 = call %"struct.DispatchNodeInputRecord" @"dx.hl.cast..%\22struct.DispatchNodeInputRecord\22 (i32, %dx.types.NodeRecordHandle)"(i32 11, %dx.types.NodeRecordHandle %4) store %"struct.DispatchNodeInputRecord" %5, %"struct.DispatchNodeInputRecord"* %inputData - %6 = alloca %"struct.GroupNodeOutputRecords" - %7 = alloca %"struct.DispatchNodeInputRecord" + %6 = alloca %"struct.DispatchNodeInputRecord" %agg.tmp = alloca %"struct.GroupNodeOutputRecords", align 4 - %8 = bitcast %"struct.DispatchNodeInputRecord"* %inputData to i8*, !dbg !23 ; line:26 col:5 - call void @llvm.lifetime.start(i64 4, i8* %8) #0, !dbg !23 ; line:26 col:5 - %9 = load %"struct.NodeOutput", %"struct.NodeOutput"* %loadStressChild, !dbg !27 ; line:26 col:33 - %10 = call %dx.types.NodeHandle @"dx.hl.cast..%dx.types.NodeHandle (i32, %\22struct.NodeOutput\22)"(i32 10, %"struct.NodeOutput" %9), !dbg !27 ; line:26 col:33 - %11 = call %dx.types.NodeRecordHandle @"dx.hl.op..%dx.types.NodeRecordHandle (i32, %dx.types.NodeHandle, i32)"(i32 335, %dx.types.NodeHandle %10, i32 1), !dbg !27 ; line:26 col:33 - %12 = call %dx.types.NodeRecordHandle @"dx.hl.annotatenoderecordhandle..%dx.types.NodeRecordHandle (i32, %dx.types.NodeRecordHandle, %dx.types.NodeRecordInfo)"(i32 17, %dx.types.NodeRecordHandle %11, %dx.types.NodeRecordInfo { i32 70, i32 116 }), !dbg !27 ; line:26 col:33 - %13 = call %"struct.GroupNodeOutputRecords" @"dx.hl.cast..%\22struct.GroupNodeOutputRecords\22 (i32, %dx.types.NodeRecordHandle)"(i32 11, %dx.types.NodeRecordHandle %12), !dbg !27 ; line:26 col:33 - store %"struct.GroupNodeOutputRecords" %13, %"struct.GroupNodeOutputRecords"* %agg.tmp, !dbg !27 ; line:26 col:33 - %14 = bitcast %"struct.GroupNodeOutputRecords"* %6 to i8*, !dbg !23 ; line:26 col:5 - call void @llvm.lifetime.start(i64 4, i8* %14) #0, !dbg !23 ; line:26 col:5 - %15 = bitcast %"struct.GroupNodeOutputRecords"* %6 to i8*, !dbg !23 ; line:26 col:5 - %16 = bitcast %"struct.GroupNodeOutputRecords"* %agg.tmp to i8*, !dbg !23 ; line:26 col:5 - call void @llvm.memcpy.p0i8.p0i8.i64(i8* %15, i8* %16, i64 4, i32 1, i1 false), !dbg !23 ; line:26 col:5 - %17 = bitcast i32* %val.i to i8*, !dbg !28 ; line:15 col:5 - call void @llvm.lifetime.start(i64 4, i8* %17) #0, !dbg !28, !noalias !31 ; line:15 col:5 - %18 = load %"struct.DispatchNodeInputRecord", %"struct.DispatchNodeInputRecord"* %inputData, !dbg !34, !alias.scope !31 ; line:15 col:17 - %19 = call %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.DispatchNodeInputRecord\22)"(i32 12, %"struct.DispatchNodeInputRecord" %18) #0, !dbg !34 ; line:15 col:17 - %20 = call %struct.loadStressRecord* @"dx.hl.op..%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle)"(i32 18, %dx.types.NodeRecordHandle %19) #0, !dbg !34, !noalias !31 ; line:15 col:17 - %data.i = getelementptr inbounds %struct.loadStressRecord, %struct.loadStressRecord* %20, i32 0, i32 0, !dbg !35 ; line:15 col:33 - %arrayidx.i = getelementptr inbounds [29 x i32], [29 x i32]* %data.i, i32 0, i32 0, !dbg !34 ; line:15 col:17 - %21 = load i32, i32* %arrayidx.i, align 4, !dbg !34, !tbaa !36, !noalias !31 ; line:15 col:17 - store i32 %21, i32* %val.i, align 4, !dbg !40, !tbaa !36, !noalias !31 ; line:15 col:10 - %22 = load i32, i32* %val.i, align 4, !dbg !41, !tbaa !36, !noalias !31 ; line:17 col:28 - %add.i = add i32 %22, 61, !dbg !42 ; line:17 col:32 - %23 = load %"struct.GroupNodeOutputRecords", %"struct.GroupNodeOutputRecords"* %6, !dbg !43, !noalias !31 ; line:17 col:5 - %24 = call %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.GroupNodeOutputRecords\22)"(i32 12, %"struct.GroupNodeOutputRecords" %23) #0, !dbg !43 ; line:17 col:5 - %25 = call %struct.loadStressRecord* @"dx.hl.op..%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle, i32)"(i32 18, %dx.types.NodeRecordHandle %24, i32 0) #0, !dbg !43, !noalias !31 ; line:17 col:5 - %data2.i = getelementptr inbounds %struct.loadStressRecord, %struct.loadStressRecord* %25, i32 0, i32 0, !dbg !44 ; line:17 col:18 - %arrayidx3.i = getelementptr inbounds [29 x i32], [29 x i32]* %data2.i, i32 0, i32 0, !dbg !43 ; line:17 col:5 - store i32 %add.i, i32* %arrayidx3.i, align 4, !dbg !45, !tbaa !36, !noalias !31 ; line:17 col:26 - %26 = bitcast i32* %val.i to i8*, !dbg !46 ; line:18 col:1 - call void @llvm.lifetime.end(i64 4, i8* %26) #0, !dbg !46, !noalias !31 ; line:18 col:1 - %27 = bitcast %"struct.DispatchNodeInputRecord"* %7 to i8*, !dbg !23 ; line:26 col:5 - call void @llvm.lifetime.end(i64 4, i8* %27) #0, !dbg !23 ; line:26 col:5 - %28 = bitcast %"struct.GroupNodeOutputRecords"* %6 to i8*, !dbg !23 ; line:26 col:5 - call void @llvm.lifetime.end(i64 4, i8* %28) #0, !dbg !23 ; line:26 col:5 - ret void, !dbg !47 ; line:27 col:1 + %7 = bitcast %"struct.DispatchNodeInputRecord"* %inputData to i8*, !dbg !23 ; line:28 col:5 + call void @llvm.lifetime.start(i64 4, i8* %7) #0, !dbg !23 ; line:28 col:5 + %8 = load %"struct.NodeOutput", %"struct.NodeOutput"* %loadStressChild, !dbg !27 ; line:28 col:33 + %9 = call %dx.types.NodeHandle @"dx.hl.cast..%dx.types.NodeHandle (i32, %\22struct.NodeOutput\22)"(i32 10, %"struct.NodeOutput" %8), !dbg !27 ; line:28 col:33 + %10 = call %dx.types.NodeRecordHandle @"dx.hl.op..%dx.types.NodeRecordHandle (i32, %dx.types.NodeHandle, i32)"(i32 335, %dx.types.NodeHandle %9, i32 1), !dbg !27 ; line:28 col:33 + %11 = call %dx.types.NodeRecordHandle @"dx.hl.annotatenoderecordhandle..%dx.types.NodeRecordHandle (i32, %dx.types.NodeRecordHandle, %dx.types.NodeRecordInfo)"(i32 17, %dx.types.NodeRecordHandle %10, %dx.types.NodeRecordInfo { i32 70, i32 128 }), !dbg !27 ; line:28 col:33 + %12 = call %"struct.GroupNodeOutputRecords" @"dx.hl.cast..%\22struct.GroupNodeOutputRecords\22 (i32, %dx.types.NodeRecordHandle)"(i32 11, %dx.types.NodeRecordHandle %11), !dbg !27 ; line:28 col:33 + store %"struct.GroupNodeOutputRecords" %12, %"struct.GroupNodeOutputRecords"* %agg.tmp, !dbg !27 ; line:28 col:33 + %13 = bitcast i32* %val.i to i8*, !dbg !28 ; line:17 col:5 + call void @llvm.lifetime.start(i64 4, i8* %13) #0, !dbg !28, !noalias !31 ; line:17 col:5 + %14 = load %"struct.DispatchNodeInputRecord", %"struct.DispatchNodeInputRecord"* %inputData, !dbg !34, !alias.scope !31 ; line:17 col:17 + %15 = call %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.DispatchNodeInputRecord\22)"(i32 12, %"struct.DispatchNodeInputRecord" %14) #0, !dbg !34 ; line:17 col:17 + %16 = call %struct.loadStressRecord* @"dx.hl.subscript.[].rn.%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle)"(i32 0, %dx.types.NodeRecordHandle %15) #0, !dbg !34 ; line:17 col:17 + %data.i = getelementptr inbounds %struct.loadStressRecord, %struct.loadStressRecord* %16, i32 0, i32 0, !dbg !35 ; line:17 col:33 + %arrayidx.i = getelementptr inbounds [29 x i32], [29 x i32]* %data.i, i32 0, i32 0, !dbg !34 ; line:17 col:17 + %17 = load i32, i32* %arrayidx.i, align 4, !dbg !34, !tbaa !36, !noalias !31 ; line:17 col:17 + store i32 %17, i32* %val.i, align 4, !dbg !40, !tbaa !36, !noalias !31 ; line:17 col:10 + %18 = load i32, i32* %val.i, align 4, !dbg !41, !tbaa !36, !noalias !31 ; line:19 col:28 + %add.i = add i32 %18, 61, !dbg !42 ; line:19 col:32 + %19 = load %"struct.GroupNodeOutputRecords", %"struct.GroupNodeOutputRecords"* %agg.tmp, !dbg !43, !noalias !31 ; line:19 col:5 + %20 = call %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.GroupNodeOutputRecords\22)"(i32 12, %"struct.GroupNodeOutputRecords" %19) #0, !dbg !43 ; line:19 col:5 + %21 = call %struct.loadStressRecord* @"dx.hl.subscript.[].rn.%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle, i32)"(i32 0, %dx.types.NodeRecordHandle %20, i32 0) #0, !dbg !43 ; line:19 col:5 + %data2.i = getelementptr inbounds %struct.loadStressRecord, %struct.loadStressRecord* %21, i32 0, i32 0, !dbg !44 ; line:19 col:18 + %arrayidx3.i = getelementptr inbounds [29 x i32], [29 x i32]* %data2.i, i32 0, i32 0, !dbg !43 ; line:19 col:5 + store i32 %add.i, i32* %arrayidx3.i, align 4, !dbg !45, !tbaa !36, !noalias !31 ; line:19 col:26 + %22 = bitcast i32* %val.i to i8*, !dbg !46 ; line:20 col:1 + call void @llvm.lifetime.end(i64 4, i8* %22) #0, !dbg !46, !noalias !31 ; line:20 col:1 + %23 = bitcast %"struct.DispatchNodeInputRecord"* %6 to i8*, !dbg !23 ; line:28 col:5 + call void @llvm.lifetime.end(i64 4, i8* %23) #0, !dbg !23 ; line:28 col:5 + ret void, !dbg !47 ; line:29 col:1 } -; Function Attrs: nounwind -declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #0 - -; Function Attrs: nounwind -declare %struct.loadStressRecord* @"dx.hl.op..%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle)"(i32, %dx.types.NodeRecordHandle) #1 +; Function Attrs: nounwind readnone +declare %struct.loadStressRecord* @"dx.hl.subscript.[].rn.%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle)"(i32, %dx.types.NodeRecordHandle) #1 ; Function Attrs: nounwind readnone -declare %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.DispatchNodeInputRecord\22)"(i32, %"struct.DispatchNodeInputRecord") #2 +declare %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.DispatchNodeInputRecord\22)"(i32, %"struct.DispatchNodeInputRecord") #1 -; Function Attrs: nounwind -declare %struct.loadStressRecord* @"dx.hl.op..%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle, i32)"(i32, %dx.types.NodeRecordHandle, i32) #1 +; Function Attrs: nounwind readnone +declare %struct.loadStressRecord* @"dx.hl.subscript.[].rn.%struct.loadStressRecord* (i32, %dx.types.NodeRecordHandle, i32)"(i32, %dx.types.NodeRecordHandle, i32) #1 ; Function Attrs: nounwind readnone -declare %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.GroupNodeOutputRecords\22)"(i32, %"struct.GroupNodeOutputRecords") #2 +declare %dx.types.NodeRecordHandle @"dx.hl.cast..%dx.types.NodeRecordHandle (i32, %\22struct.GroupNodeOutputRecords\22)"(i32, %"struct.GroupNodeOutputRecords") #1 ; Function Attrs: nounwind declare %dx.types.NodeRecordHandle @"dx.hl.op..%dx.types.NodeRecordHandle (i32, %dx.types.NodeHandle, i32)"(i32, %dx.types.NodeHandle, i32) #0 ; Function Attrs: nounwind readnone -declare %dx.types.NodeHandle @"dx.hl.cast..%dx.types.NodeHandle (i32, %\22struct.NodeOutput\22)"(i32, %"struct.NodeOutput") #2 +declare %dx.types.NodeHandle @"dx.hl.cast..%dx.types.NodeHandle (i32, %\22struct.NodeOutput\22)"(i32, %"struct.NodeOutput") #1 ; Function Attrs: nounwind declare %dx.types.NodeRecordHandle @"dx.hl.annotatenoderecordhandle..%dx.types.NodeRecordHandle (i32, %dx.types.NodeRecordHandle, %dx.types.NodeRecordInfo)"(i32, %dx.types.NodeRecordHandle, %dx.types.NodeRecordInfo) #0 ; Function Attrs: nounwind readnone -declare %"struct.GroupNodeOutputRecords" @"dx.hl.cast..%\22struct.GroupNodeOutputRecords\22 (i32, %dx.types.NodeRecordHandle)"(i32, %dx.types.NodeRecordHandle) #2 +declare %"struct.GroupNodeOutputRecords" @"dx.hl.cast..%\22struct.GroupNodeOutputRecords\22 (i32, %dx.types.NodeRecordHandle)"(i32, %dx.types.NodeRecordHandle) #1 ; Function Attrs: nounwind declare %dx.types.NodeRecordHandle @"dx.hl.createnodeinputrecordhandle..%dx.types.NodeRecordHandle (i32, i32)"(i32, i32) #0 ; Function Attrs: nounwind readnone -declare %"struct.DispatchNodeInputRecord" @"dx.hl.cast..%\22struct.DispatchNodeInputRecord\22 (i32, %dx.types.NodeRecordHandle)"(i32, %dx.types.NodeRecordHandle) #2 +declare %"struct.DispatchNodeInputRecord" @"dx.hl.cast..%\22struct.DispatchNodeInputRecord\22 (i32, %dx.types.NodeRecordHandle)"(i32, %dx.types.NodeRecordHandle) #1 ; Function Attrs: nounwind declare %dx.types.NodeHandle @"dx.hl.createnodeoutputhandle..%dx.types.NodeHandle (i32, i32)"(i32, i32) #0 @@ -123,11 +112,10 @@ declare %dx.types.NodeHandle @"dx.hl.createnodeoutputhandle..%dx.types.NodeHandl declare %dx.types.NodeHandle @"dx.hl.annotatenodehandle..%dx.types.NodeHandle (i32, %dx.types.NodeHandle, %dx.types.NodeInfo)"(i32, %dx.types.NodeHandle, %dx.types.NodeInfo) #0 ; Function Attrs: nounwind readnone -declare %"struct.NodeOutput" @"dx.hl.cast..%\22struct.NodeOutput\22 (i32, %dx.types.NodeHandle)"(i32, %dx.types.NodeHandle) #2 +declare %"struct.NodeOutput" @"dx.hl.cast..%\22struct.NodeOutput\22 (i32, %dx.types.NodeHandle)"(i32, %dx.types.NodeHandle) #1 attributes #0 = { nounwind } -attributes #1 = { nounwind "dx.hlls"="ExtractRecordStructFromArray" } -attributes #2 = { nounwind readnone } +attributes #1 = { nounwind readnone } !llvm.module.flags = !{!0} !pauseresume = !{!1} @@ -142,7 +130,7 @@ attributes #2 = { nounwind readnone } !0 = !{i32 2, !"Debug Info Version", i32 3} !1 = !{!"hlsl-hlemit", !"hlsl-hlensure"} -!2 = !{!"dxc(private) 1.7.0.4428 (sm68-core, 61a3275d7)"} +!2 = !{!"dxc(private) 1.7.0.4181 (recursive_functions_in_shader, 387025815-dirty)"} !3 = !{i32 1, i32 8} !4 = !{!"lib", i32 6, i32 8} !5 = !{i32 0, %"struct.DispatchNodeInputRecord" undef, !6, %"struct.GroupNodeOutputRecords" undef, !6, %"struct.NodeOutput" undef, !6} @@ -163,32 +151,31 @@ attributes #2 = { nounwind readnone } !20 = !{void (%"struct.DispatchNodeInputRecord"*, %"struct.NodeOutput"*)* @loadStress_16, i32 15, i32 16, i32 1, i32 1, i32 1, i1 false, !"loadStress_16", i32 0, !"", i32 0, i32 -1, i32 0, i32 0, i32 0, i32 3, i32 1, i32 1, i32 0} !21 = !{i32 144} !22 = !{i32 -1} -!23 = !DILocation(line: 26, column: 5, scope: !24) -!24 = !DISubprogram(name: "loadStress_16", scope: !25, file: !25, line: 23, type: !26, isLocal: false, isDefinition: true, scopeLine: 25, flags: DIFlagPrototyped, isOptimized: false, function: void (%"struct.DispatchNodeInputRecord"*, %"struct.NodeOutput"*)* @loadStress_16) -!25 = !DIFile(filename: "C:\5Cgit\5Cdxc\5Csm68-core\5Ctools\5Cclang\5Ctest\5CHLSLFileCheck\5Chlsl\5Cworkgraph\5Ccalled_function_arg_record_object.hlsl", directory: "") +!23 = !DILocation(line: 28, column: 5, scope: !24) +!24 = !DISubprogram(name: "loadStress_16", scope: !25, file: !25, line: 25, type: !26, isLocal: false, isDefinition: true, scopeLine: 27, flags: DIFlagPrototyped, isOptimized: false, function: void (%"struct.DispatchNodeInputRecord"*, %"struct.NodeOutput"*)* @loadStress_16) +!25 = !DIFile(filename: "D:\5CDXC\5Ctools\5Cclang\5Ctest\5CHLSLFileCheck\5Chlsl\5Cworkgraph\5Ccalled_function_arg_record_object.hlsl", directory: "") !26 = !DISubroutineType(types: !14) -!27 = !DILocation(line: 26, column: 33, scope: !24) -!28 = !DILocation(line: 15, column: 5, scope: !29, inlinedAt: !30) -!29 = !DISubprogram(name: "loadStressWorker", scope: !25, file: !25, line: 10, type: !26, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false) -!30 = distinct !DILocation(line: 26, column: 5, scope: !24) +!27 = !DILocation(line: 28, column: 33, scope: !24) +!28 = !DILocation(line: 17, column: 5, scope: !29, inlinedAt: !30) +!29 = !DISubprogram(name: "loadStressWorker", scope: !25, file: !25, line: 12, type: !26, isLocal: false, isDefinition: true, scopeLine: 15, flags: DIFlagPrototyped, isOptimized: false) +!30 = distinct !DILocation(line: 28, column: 5, scope: !24) !31 = !{!32} !32 = distinct !{!32, !33, !"\01?loadStressWorker@@YAXU?$DispatchNodeInputRecord@UloadStressRecord@@@@U?$GroupNodeOutputRecords@UloadStressRecord@@@@@Z: %inputData"} !33 = distinct !{!33, !"\01?loadStressWorker@@YAXU?$DispatchNodeInputRecord@UloadStressRecord@@@@U?$GroupNodeOutputRecords@UloadStressRecord@@@@@Z"} -!34 = !DILocation(line: 15, column: 17, scope: !29, inlinedAt: !30) -!35 = !DILocation(line: 15, column: 33, scope: !29, inlinedAt: !30) +!34 = !DILocation(line: 17, column: 17, scope: !29, inlinedAt: !30) +!35 = !DILocation(line: 17, column: 33, scope: !29, inlinedAt: !30) !36 = !{!37, !37, i64 0} !37 = !{!"int", !38, i64 0} !38 = !{!"omnipotent char", !39, i64 0} !39 = !{!"Simple C/C++ TBAA"} -!40 = !DILocation(line: 15, column: 10, scope: !29, inlinedAt: !30) -!41 = !DILocation(line: 17, column: 28, scope: !29, inlinedAt: !30) -!42 = !DILocation(line: 17, column: 32, scope: !29, inlinedAt: !30) -!43 = !DILocation(line: 17, column: 5, scope: !29, inlinedAt: !30) -!44 = !DILocation(line: 17, column: 18, scope: !29, inlinedAt: !30) -!45 = !DILocation(line: 17, column: 26, scope: !29, inlinedAt: !30) -!46 = !DILocation(line: 18, column: 1, scope: !29, inlinedAt: !30) -!47 = !DILocation(line: 27, column: 1, scope: !24) +!40 = !DILocation(line: 17, column: 10, scope: !29, inlinedAt: !30) +!41 = !DILocation(line: 19, column: 28, scope: !29, inlinedAt: !30) +!42 = !DILocation(line: 19, column: 32, scope: !29, inlinedAt: !30) +!43 = !DILocation(line: 19, column: 5, scope: !29, inlinedAt: !30) +!44 = !DILocation(line: 19, column: 18, scope: !29, inlinedAt: !30) +!45 = !DILocation(line: 19, column: 26, scope: !29, inlinedAt: !30) +!46 = !DILocation(line: 20, column: 1, scope: !29, inlinedAt: !30) +!47 = !DILocation(line: 29, column: 1, scope: !24) ; The test was generated using the pass test generation script: ; python3 ExtractIRForPassTest.py -p scalarrepl-param-hlsl -o outtest_without_nodeiotypecheck.ll %HLSL_SRC_DIR%\tools\clang\test\HLSLFileCheck\hlsl\workgraph\called_function_arg_record_object.hlsl -- -T lib_6_8 - diff --git a/utils/hct/gen_intrin_main.txt b/utils/hct/gen_intrin_main.txt index 92cc827f6f..8e66346359 100644 --- a/utils/hct/gen_intrin_main.txt +++ b/utils/hct/gen_intrin_main.txt @@ -380,8 +380,6 @@ void [[]] Barrier(in NodeRecordOrUAV o, in uint SemanticFlags); uint [[]] GetRemainingRecursionLevels(); -$match<0,-2> void [[hidden]] ExtractRecordStructFromArray(in AnyNodeOutputRecord output); - } namespace