Skip to content

Commit 62bd483

Browse files
JaroszPiotrigcbot
authored andcommitted
Add new GenISA_AsyncStackPtrPlaceHolder intrinsic
Add new GenISA_AsyncStackPtrPlaceHolder intrinsic
1 parent 10f146f commit 62bd483

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

IGC/AdaptorCommon/RayTracing/MemRegionAnalysis.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ static std::optional<RTMemRegion> getIntrinsicRegion(
5252
case GenISAIntrinsic::GenISA_LocalBufferPointer:
5353
return RTMemRegion::LocalArgs;
5454
case GenISAIntrinsic::GenISA_AsyncStackPtr:
55+
case GenISAIntrinsic::GenISA_AsyncStackPtrPlaceHolder:
5556
return RTMemRegion::RTAsyncStack;
5657
case GenISAIntrinsic::GenISA_SyncStackPtr:
5758
return RTMemRegion::RTSyncStack;

IGC/Compiler/CISACodeGen/LSCCacheOptimizationPass.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,9 @@ bool LSCCacheOptimizationPass::create_48_wide_store(Function& function)
456456
// which would look something like this:
457457
// %perLaneAsyncStackPointer24 = call noalias align 128 dereferenceable(256) %"struct.RTStackFormat::RTStack" addrspace(1)* @"llvm.genx.GenISA.AsyncStackPtr.p1struct.RTStackFormat::RTStack.i64"(i64 %19)
458458
if (auto* intrinsic_call = dyn_cast<GenIntrinsicInst>(i)) {
459-
if (intrinsic_call->getIntrinsicID() == llvm::GenISAIntrinsic::GenISA_AsyncStackPtr) {
459+
if ((intrinsic_call->getIntrinsicID() == llvm::GenISAIntrinsic::GenISA_AsyncStackPtr) ||
460+
(intrinsic_call->getIntrinsicID() == llvm::GenISAIntrinsic::GenISA_AsyncStackPtrPlaceHolder))
461+
{
460462
// Create an IRBuilder with an insertion point set to the given intrinsic_call instruction.
461463
// IRBuilder automatically inserts instructions when it creates them,
462464
// and the inserted instructions (dynamically allocated) are deleted when the function is destroyed.

IGC/GenISAIntrinsics/generator/input/Intrinsic_definitions.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10745,6 +10745,25 @@ intrinsics:
1074510745
memory_effects:
1074610746
- !<MemoryRestriction>
1074710747
memory_access: !MemoryAccessType NoModRef
10748+
- !<IntrinsicDefinition>
10749+
name: "GenISA_AsyncStackPtrPlaceHolder"
10750+
comment: "Raytracing: Intrinsic used as marker in later passes to find per\
10751+
\ lane async stack base. It is just a cast and will be lowered prior to\
10752+
\ codegen"
10753+
return_definition: !<ReturnDefinition>
10754+
type_definition: *p_any_
10755+
comment: ""
10756+
arguments:
10757+
- !<ArgumentDefinition>
10758+
name: Arg0
10759+
type_definition: *any_int
10760+
comment: ""
10761+
attributes:
10762+
- !AttributeID "NoDuplicate"
10763+
- !AttributeID "NoUnwind"
10764+
memory_effects:
10765+
- !<MemoryRestriction>
10766+
memory_access: !MemoryAccessType NoModRef
1074810767
- !<IntrinsicDefinition>
1074910768
name: "GenISA_SyncStackPtr"
1075010769
comment: "Raytracing: Intrinsic used as marker in later passes to find per\

0 commit comments

Comments
 (0)