llvm-project
3210e201 - [CIR] Implement shouldCreateMemCpyFromGlobal in LoweringPrepare (#181276)

Commit
66 days ago
[CIR] Implement shouldCreateMemCpyFromGlobal in LoweringPrepare (#181276) CIRGen emits cir.const + cir.store for aggregate initialization, keeping closer to source-level semantics. LoweringPrepare transforms stores of constant aggregates (arrays, records) into cir.global + cir.get_global + cir.copy, matching OG codegen's shouldCreateMemCpyFromGlobal optimization. The transform only applies to stores targeting cir.alloca (local variables inside cir.func). Stores in other contexts (e.g. OpenACC reduction recipe init blocks, base class initialization) are left as cir.const + cir.store. Also fixes CopyOp lowering to use i64 for the memcpy length instead of i32, matching OG codegen behavior.
Author
Parents
Loading