Skip to content

Conversation

simoll
Copy link
Collaborator

@simoll simoll commented Mar 26, 2025

  • HLSL -> DXIL lowering
  • ast, hlsl->dxil, dxilgen, and ScalarReplAggregatesHLSL tests

SER implementation tracker (#7214)

- HLSL -> DXIL lowering - ast, hlsl->dxil, dxilgen, and ScalarReplAggregatesHLSL tests SER implementation tracker (microsoft#7214)
@simoll simoll requested a review from a team as a code owner March 26, 2025 12:32
@simoll simoll mentioned this pull request Mar 26, 2025
41 tasks
@damyanp damyanp added this to the Next Release milestone Mar 28, 2025
@simoll simoll requested a review from llvm-beanz April 7, 2025 13:22
Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these test cases need reworking. It looks like many of the matches that you have in the tests would match on the input file so they aren't actually testing that the IR was changed.

%tmp2 = alloca %dx.types.HitObject, align 4
%0 = bitcast %dx.types.HitObject* %hit to i8*, !dbg !23 ; line:42 col:3
call void @llvm.lifetime.start(i64 4, i8* %0) #0, !dbg !23 ; line:42 col:3
; CHECK: %{{[^ ]+}} = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %{{[^ ]+}})
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This match would succeed even if the IR is unchanged from with is in the test case now, so we probably need some more specific matches, maybe a variable match in order to verify that this IR is actually being transformed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is because this call to HitObject_MakeNop is not expected to change. SroaHLSL must only flatten the RayDesc param in the DxHitObject_MakeMiss call below and the test is checking for exactly that.
@llvm-beanz If that is not what we want, could you provide more specific guidance of what you want to see changed?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the goal is to make sure this doesn't get scalarized, we should have some variable matches to make sure that the values move as expected through the operations.

Copy link
Collaborator Author

@simoll simoll Apr 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added explicit CHECKs that RayDesc gets scalarized and all other params remain in place. Also checking that the ptr from the default ctr remains unused.
@llvm-beanz does this resolve this request?

@github-project-automation github-project-automation bot moved this from New to In progress in HLSL Roadmap Apr 11, 2025
@simoll simoll changed the title [SER] DxHitObject::MakeNop|Miss lowering and tests [SER] MaybeReorderThread + Make(Nop|Miss) HLSL -> DXIL lowering and tests Apr 15, 2025
@simoll simoll requested a review from llvm-beanz April 16, 2025 05:52
Copy link
Collaborator

@llvm-beanz llvm-beanz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Copy link
Contributor

@tex3d tex3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor comments. Could address later.
In the future, let's put AST tests under SemaHLSL, not under CodeGenDXIL.

@simoll simoll requested review from llvm-beanz and tex3d April 17, 2025 05:14
@tex3d tex3d merged commit 0beaa76 into microsoft:main Apr 17, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in HLSL Roadmap Apr 17, 2025
@damyanp damyanp moved this to Closed in HLSL Support Apr 25, 2025
@damyanp damyanp removed this from HLSL Support Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants