Skip to content

Conversation

@rj-jesus
Copy link
Contributor

@rj-jesus rj-jesus commented Feb 20, 2025

At the LLVM level, going forward typed pointers are no longer supported.

This patch removes typed pointer support from the LLVM binding layer.

Initially, it also attempted to bump the LLVM version used to LLVM 16, but due to unrelated reasons with Anaconda, it seems it's easier to do that separately as a follow-up patch.

@gmarkall
Copy link
Member

Note from triage meeting: items pinned for opaque pointer fixes may also be required here.

@gmarkall
Copy link
Member

gmarkall commented Mar 4, 2025

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

At the LLVM level, typed pointers are no longer supported going forward.

This patch removes typed pointer support at the LLVM binding layer and
bumps the LLVM release used to LLVM 16.
@rj-jesus rj-jesus changed the title Drop binding layer typed pointer support and move to LLVM 16. Drop binding layer typed pointer support. Mar 12, 2025
#endif
}
return nullptr;
return size.getFixedValue();
Copy link
Member

Choose a reason for hiding this comment

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

Note on this change: getFixedSize() retured getFixedValue() anyway, and getFixedSize() is deprecated / removed in later LLVM versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I believe these are just API renames.

Copy link
Member

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

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

I think this is good, but I have a couple of questions on the diff to complete my understanding of the changes.

@property
def intrinsic_name(self):
return 'p%d%s' % (self.addrspace, self.pointee.intrinsic_name)
if ir_layer_typed_pointers_enabled:
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a fix for an error that was previously un-noticed / un-addressed - is that correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, it fixes an inconsistent behaviour in how pointer intrinsic names are printed.

Previously, even if we enabled IR layer typed pointers, the pointer's intrinsic name would still reflect its "true" underlying type. This is probably not the desired behaviour, so I've changed this to follow the same logic we have for the "_to_string" method.

I should have done this when we added IR layer typed pointers, but I think this got lost with the opaque pointer fixes (which in practice came after IR layer typed pointers, but I had initially thought them to come before).

# Note: Should this be adjusted based on the pointer mode?
self.assertEqual(ir.PointerType(int1).intrinsic_name, 'p0i1')
self.assertEqual(ir.PointerType(int1, 1).intrinsic_name, 'p1i1')
if not ir_layer_typed_pointers_enabled:
Copy link
Member

Choose a reason for hiding this comment

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

I think the changes here pertain to the fix I asked about above. Is that right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly, I wasn't sure if we should remove intrinsic names from typed pointers entirely (such that we would always print them in opaque pointer format), but then I thought we should probably keep consistency with _to_string, and so I've adjusted this accordingly.

Copy link
Member

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

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

Many thanks for the PR! I think this is good to approve, noting that:

  • I've experimented with this locally and run into no issues, including running the Numba test suite.
  • This isn't changing behaviour from the default, which has already had a full buildfarm run.
  • It only removes the non-default, deprecated path, which needs to be removed to move forward with LLVM versions.

@esc esc merged commit cb96457 into numba:main Mar 17, 2025
26 checks passed
@rj-jesus rj-jesus deleted the rjj/move-to-llvm-16 branch March 18, 2025 07:57
This was referenced Mar 20, 2025
yashssh pushed a commit to yashssh/llvmlite that referenced this pull request Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants