This is an archive of the discontinued LLVM Phabricator instance.

Use ConstantExpr cached APValues if present for code generation
AbandonedPublic

Authored by wchilders on Mar 19 2020, 12:15 PM.

Details

Reviewers
void
Tyker
rsmith
Summary

This patch allows code gen to use APValue Results from ConstantExprs.

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

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

Diff Detail

Event Timeline

wchilders created this revision.Mar 19 2020, 12:15 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 19 2020, 12:15 PM
wchilders added inline comments.Mar 19 2020, 12:18 PM
clang/lib/CodeGen/CGStmt.cpp
1098

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.

Tyker added inline comments.Mar 21 2020, 3:12 AM
clang/lib/CodeGen/CGExprConstant.cpp
1871 ↗(On Diff #251438)

this looks like it is doing the same thing as llvm::Constant *ConstantEmitter::tryEmitAbstract(const APValue &value, QualType T) how is it different ?

Updated to remove duplicated (and out dated) APValue generation logic, and fixed formatting issues. (Thanks for pointing out something was awry Tyker)