Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Look through attributes and rates when determining by reference initialization #5023

Merged
merged 11 commits into from
Oct 8, 2024

Conversation

expipiplus1
Copy link
Collaborator

Closes #5022

@expipiplus1 expipiplus1 added the pr: non-breaking PRs without breaking changes label Sep 6, 2024
jkwak-work
jkwak-work previously approved these changes Sep 6, 2024
Copy link
Collaborator

@jkwak-work jkwak-work left a comment

Choose a reason for hiding this comment

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

Looks good to me

source/slang/slang-ir.cpp Outdated Show resolved Hide resolved
@@ -175,7 +175,9 @@ IRInst* maybeSpecializeWithGeneric(IRBuilder& builder, IRInst* genericToSpecaili
// Returns true if is not possible to produce side-effect from a value of `dataType`.
bool isValueType(IRInst* dataType)
{
dataType = getResolvedInstForDecorations(unwrapAttributedType(dataType));
if(auto t = as<IRType>(dataType))
Copy link
Collaborator

Choose a reason for hiding this comment

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

This if is unnecessary.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I changed the type of unwrapAttributedType to be on IRType, so it's required now.

Copy link
Collaborator

Choose a reason for hiding this comment

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

That means we are checking the opcode twice, once for the dynamic cast and once for the actual unwrapping, which seems unnecessary.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should feel comfortable to accept IRInst where a type is expected, and rely on static cast to convert between IRInst and IRType because there is not a clean way to separate a type and an inst anyways. IRType has no more meaning other than clarifying what an IRInst is for in code, but for unwrapAttributeType, it is verify clear what the param is, so it accepting IRInst is not wrong and I don't see a need for the change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok, I've reverted that change

@csyonghe csyonghe merged commit 50f44c1 into shader-slang:master Oct 8, 2024
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

groupshared types emit false uninitialized warnings
3 participants