Skip to content

[DxilSimplify] Constant-fold VectorReduce.*#8577

Open
llvm-beanz wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:8570
Open

[DxilSimplify] Constant-fold VectorReduce.*#8577
llvm-beanz wants to merge 1 commit into
microsoft:mainfrom
llvm-beanz:8570

Conversation

@llvm-beanz

@llvm-beanz llvm-beanz commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Add support for constant-evaluating VectorReduce operations on constant operands. This restores optimization parity between SM 6.8 and SM 6.9.

Fixes #8570

Assisted by Claude Opus 4.8

Add support for constant-evaluating VectorReduce operations on constant
operands. This restores optimization pairity between SM 6.8 and SM 6.9.

Assisted by Claude Opus 4.8
../tools/clang/test/DXC/Passes/DxilSimplify/vectorreduce-const-fold.ll

@hekota hekota left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

Comment on lines +106 to +112
declare i1 @dx.op.vectorReduce.v4i1(i32, <4 x i1>) #0
declare i32 @dx.op.vectorReduce.v4i32(i32, <4 x i32>) #0
declare void @dx.op.storeOutput.i32(i32, i32, i32, i8, i32) #1

attributes #0 = { nounwind readnone }
attributes #1 = { nounwind }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just a nit - I don't think this needs to be here.

Suggested change
declare i1 @dx.op.vectorReduce.v4i1(i32, <4 x i1>) #0
declare i32 @dx.op.vectorReduce.v4i32(i32, <4 x i32>) #0
declare void @dx.op.storeOutput.i32(i32, i32, i32, i8, i32) #1
attributes #0 = { nounwind readnone }
attributes #1 = { nounwind }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

[6.9] Failing to constant evaluate @dx.op.vectorReduce.*

3 participants