This revision was automatically updated to reflect the committed changes.
Closed by commit rL311772: [IRGen] Evaluate constant static variables
referenced through member (authored by arphaman).
Changed prior to commit:
https://reviews.llvm.org/D36876?vs=112360=112675#toc
Repository:
rL LLVM
rjmccall accepted this revision.
rjmccall added a comment.
This revision is now accepted and ready to land.
Looks great, thanks.
Repository:
rL LLVM
https://reviews.llvm.org/D36876
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
arphaman updated this revision to Diff 112360.
arphaman marked 2 inline comments as done.
arphaman added a comment.
- Create `tryEmitAsConstant` for MemberExprs and `emitConstant` helper for
complex values as suggested by John.
- Remove dead constant emission code from CGExprAggregate.cpp
- Emit
arphaman added inline comments.
Comment at: lib/CodeGen/CGExprComplex.cpp:163
+else
+ CGF.EmitLValue(ME->getBase());
+return *Constant;
rjmccall wrote:
> rjmccall wrote:
> > There's an EmitIgnoredExpr you could use.
> >
> > Also, I
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExprComplex.cpp:163
+else
+ CGF.EmitLValue(ME->getBase());
+return *Constant;
rjmccall wrote:
> There's an EmitIgnoredExpr you could use.
>
> Also, I think it would be fine to
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExprComplex.cpp:163
+else
+ CGF.EmitLValue(ME->getBase());
+return *Constant;
There's an EmitIgnoredExpr you could use.
Also, I think it would be fine to add a generic
arphaman updated this revision to Diff 112149.
arphaman added a comment.
Revert most of the changes and use temporary DREs as suggested by John.
Repository:
rL LLVM
https://reviews.llvm.org/D36876
Files:
lib/CodeGen/CGExprComplex.cpp
lib/CodeGen/CGExprScalar.cpp
arphaman added inline comments.
Comment at: lib/CodeGen/CGExpr.cpp:1323
+ if (result.HasSideEffects && !AllowSideEffects) {
+assert(!isa(E) && "declrefs should not have side effects");
return ConstantEmission();
rjmccall wrote:
> The side effects here
rjmccall added inline comments.
Comment at: lib/CodeGen/CGExpr.cpp:1323
+ if (result.HasSideEffects && !AllowSideEffects) {
+assert(!isa(E) && "declrefs should not have side effects");
return ConstantEmission();
The side effects here are those
arphaman updated this revision to Diff 111956.
arphaman marked an inline comment as done.
arphaman added a comment.
- Get rid of the `AllowSideEffects` argument.
- Get rid of the old integer field evaluation code.
Repository:
rL LLVM
https://reviews.llvm.org/D36876
Files:
arphaman added inline comments.
Comment at: lib/CodeGen/CGExprComplex.cpp:156
+auto Constant = tryEmitDeclRefOrMemberExprAsConstant(
+ME, ME->getMemberDecl(), /*AllowSideEffects=*/true);
+if (Constant) {
rsmith wrote:
> If we can (correctly)
rsmith added inline comments.
Comment at: lib/CodeGen/CGExprComplex.cpp:156
+auto Constant = tryEmitDeclRefOrMemberExprAsConstant(
+ME, ME->getMemberDecl(), /*AllowSideEffects=*/true);
+if (Constant) {
If we can (correctly) allow side-effects in
arphaman created this revision.
C++ allows us to reference static variables through member expressions. Prior
to this patch, non-integer static variables that were referenced using a member
expression were always emitted using lvalue loads. The old behaviour introduced
an inconsistency between
13 matches
Mail list logo