nickdesaulniers added a comment.

In D76096#1922239 <https://reviews.llvm.org/D76096#1922239>, @rsmith wrote:

> it's substantially more efficient for CodeGen to walk the AST representation 
> (the `InitListExpr`) and directly generate an IR constant than it is to 
> create an `APValue` representation of the array. (`APValue` is not especially 
> space-efficient, and the extra copying and data shuffling can be quite slow.)


Isn't that what my patch is doing? (Codegen walking the AST/`InitListExpr`, 
generating `Constant`s)?

Uploading what I have; handling arrays is trickier than structs; the index and 
the base both end up having complex subtrees to fetch values from.  As much fun 
as it is to build a compile time evaluator, it sounds like I should stop 
pursing  `CGExprConstant` visitors in favor of `ExprConstant`? (I guess it's 
not clear to me whether @rsmith is in agreement with @eli.friedman on whether 
we want to be more aggressive in compile time evaluation or not).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D76096/new/

https://reviews.llvm.org/D76096



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to