This is the prelude of address space support. Linked issue: #418 .
I want to solve it by these steps:
This PR, add the attribute and implement asm format & type conversion.
Enable the feature flag of address space, but break it into several other flags. And re-categorize / fix occurrences in the codebase. There is already a draft commit for this part. PR coming soon.
The proposed new feature flags are: addressSpaceCasting and (existing) addressSpaceInGlobalVar
Implement clang::CK_AddressSpaceConversion as a new kind of cir.cast. Also fix the corresponding occurrences.
Make ops like cir.global and cir.get_global aware of address space, and solve the latter flag.
Relax the restriction of default alloca address space. Then we can use correct address spaces for languages like OpenCL in future.
Revert to this PR itself, which includes:
custom assembly format ~cir.ptr<T[, $addrspace]>~ cir.ptr<T[, addrspace($addrspace)]>
two build functions with optional argument addrspace = 0 extended
I set skipDefaultBuilders = 1, tell me if it's not a good practice😉
CIRGen / Lowering support for the two type converter from AST -> CIR -> LLVM pipeline
This is the prelude of address space support. Linked issue: #418 .
I want to solve it by these steps:
addressSpaceCasting
and (existing)addressSpaceInGlobalVar
clang::CK_AddressSpaceConversion
as a new kind ofcir.cast
. Also fix the corresponding occurrences.cir.global
andcir.get_global
aware of address space, and solve the latter flag.Revert to this PR itself, which includes:
cir.ptr<T[, $addrspace]>
~cir.ptr<T[, addrspace($addrspace)]>
addrspace = 0
extendedskipDefaultBuilders = 1
, tell me if it's not a good practice😉AST -> CIR -> LLVM
pipeline