Lancern wrote: > > Since h is external, LLVM cannot take the risk to eliminate the reload from > > alloca before calling use, despite that the reload is indeed unnecessary > > according to the C++ standard > > For the testcase in hand, If cir.alloca was marked as const, wouldn't this > allow a LoadOp folder to reuse any existing previous use (if available) > instead?
This indeed sounds like a possible way to implement the said "const-propagation" in CIR. Previously, we focused more on teaching LLVM optimizer about our intents, though, so we could get "free" implementations without re-inventing the wheels. https://github.com/llvm/llvm-project/pull/175037 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
