-
Notifications
You must be signed in to change notification settings - Fork 103
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
handle long long type in TBAA #1241
Comments
The problem here is that CIR integer types do not have a 1:1 correspondence to C/C++ integer types, so you could not tell whether a |
That sounds like a great idea! I will attempt to add def CIR_LongLong : CIR_Type<"LongLong", "long_long"> {
let parameters = (ins "mlir::Type":$underlying);
let assemblyFormat = [{
`<` $underlying `>`
}];
} |
This is a bit more tricky than it sounds, it would be odd to have I do agree FP is doing the more full and nicer path and it'd be nice to have it for integers (makes sense to better map the source info), but is the type indirection worth it? Seems like the only use so far is for handling TBAA - I'm curious if there are solutions where we can solve this without introducing new types? (cc @dkolsen-pgi @sitio-couto) |
Floating-point types in ClangIR do not have a 1-to-1 mapping to formats. Or they won't once extended floating-point support is added to Clang. Doing something special for just the type If we need to preserve the original C++ type in ClangIR, for TBAA or some other purpose, then we should do it right and have separate ClangIR types for all arithmetic language types, each with a corresponding underlying format attribute. But that would be a big change and not something to be done lightly. |
Agreed, same feeling here! @PikachuHyA an alternative is to optionally attach the clangtype to CIRtypes, like we do for ast nodes on operations, TBAA could query that information to grasp higher level semantics. |
The #1220 adds support for scalar types. However, it does not handle the
long long
type correctly; instead,long long
is treated aslong
. Specifically,long long
is represented ass64i
in CIR, which is then mapped to thelong
type.The text was updated successfully, but these errors were encountered: