llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
351 stars 95 forks source link

[CIR][LowerToLLVM][CXXABI] Lower cir.va.arg #573

Closed ghehg closed 4 months ago

ghehg commented 5 months ago

lowering var_arg op for ARM64 architecture. This is CIR lowering.

This PR modified LoweringPrepare CXXABI code to make LoweringPrepareArm64CXXABI class inherit more generic LoweringPrepareItaniumCXXABI, this way lowering var_arg would be only meaningful for arm64 targets and for other arch its no op for now.

The ABI doc and detailed algorithm description can be found in this official doc.

The following pic is a easier-to-understand and close to lowered code explanation

Screenshot 2024-04-29 at 4 02 17 PM