[PATCH] D76443: Use ConstantExpr cached APValues if present for code generation

Wyatt Childers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 19 12:33:03 PDT 2020


wchilders created this revision.
wchilders added reviewers: void, Tyker, rsmith.
Herald added subscribers: cfe-commits, jfb.
Herald added a project: clang.
wchilders added inline comments.


================
Comment at: clang/lib/CodeGen/CGStmt.cpp:1095
+    // preventing the cached results from being used.
+    if (!isa<ConstantExpr>(fe)) {
+      enterFullExpression(fe);
----------------
This one is a bit weird, I think the comment explains it well, but I feel there should be a better way to handle this or if there are similar issues lurking elsewhere.


This patch allows code gen to use `APValue` Results from `ConstantExpr`s.

There are some outstanding concerns I'll mark with inline comments.

This is the codegen "sister patch" of: https://reviews.llvm.org/D76438


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D76443

Files:
  clang/lib/CodeGen/CGExpr.cpp
  clang/lib/CodeGen/CGExprAgg.cpp
  clang/lib/CodeGen/CGExprConstant.cpp
  clang/lib/CodeGen/CGExprScalar.cpp
  clang/lib/CodeGen/CGStmt.cpp
  clang/lib/CodeGen/CodeGenFunction.cpp
  clang/lib/CodeGen/CodeGenFunction.h
  clang/lib/CodeGen/CodeGenModule.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D76443.251438.patch
Type: text/x-patch
Size: 22106 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200319/3f5fa6e4/attachment-0001.bin>


More information about the cfe-commits mailing list