This is an archive of the discontinued LLVM Phabricator instance.

[IRBuilder] Add utilities for materializing scalable values
ClosedPublic

Authored by reames on Mar 13 2023, 8:14 AM.

Details

Summary

These idioms already appear a number of places in code, and upcoming changes to the various sanitizers continue to need more instances of the same patterns.

Posting this for review to gather feedback on the naming. I don't particularly like the names I chose, and am wondering if anyone has a better idea.

Diff Detail

Event Timeline

reames created this revision.Mar 13 2023, 8:14 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2023, 8:14 AM
reames requested review of this revision.Mar 13 2023, 8:14 AM
paulwalker-arm added inline comments.Mar 13 2023, 8:33 AM
llvm/include/llvm/IR/IRBuilder.h
898

I guess this is bike shedding but given IRBuilder has functions like getInt16() to return the IR form on a 16-bit integer value, how about just CreateElementCount that returns the IR form of ElementCount?

Not isolated to this patch but in general I dislike the use of runtime when naming things we've already named in order to allow for fixed length and scalable vectors. By which I mean I don't really consider CompileTimeElementCount/TypeSize as something that exists. But then perhaps I'm just being too picky :)

luke added inline comments.Mar 13 2023, 8:53 AM
llvm/include/llvm/IR/IRBuilder.h
898

+1, CreateElementCount makes sense to me.

reames added inline comments.Mar 13 2023, 11:38 AM
llvm/include/llvm/IR/IRBuilder.h
898

I'm going to take this naming suggestion and run with it. Seems reasonable to me as well.

This revision was not accepted when it landed; it landed in state Needs Review.Mar 13 2023, 11:54 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.