Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPrepare ConstVal for constant propagators and reduce `eval_const_expr` in MIR #33274
Conversation
rust-highfive
assigned
eddyb
Apr 29, 2016
This comment has been minimized.
This comment has been minimized.
|
@oli-obk I disagree with putting MIR constant aggregates in |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure I understand. We can refactor |
This comment has been minimized.
This comment has been minimized.
|
@oli-obk Yes, but you can't copy the |
This comment has been minimized.
This comment has been minimized.
When I suggested that on #rust-internals, I was told that we should end up merging aggregates that consist solely of constants into a constant aggregate.
Ah, we're talking about different structures. The fact that constprop exists should not change the MIR. The MIR should represent the code as is. All constant propagation can do is manipulate that code. The constant propagation pass can have internal datastructures that store additional info about certain temp/var decls. This way the const prop pass can propagate more than constants (it can do move-skips like |
This comment has been minimized.
This comment has been minimized.
|
@oli-obk Ah, do you have a link to that discussion? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
oli-obk
force-pushed the
oli-obk:eager_const
branch
from
066de64
to
37c3beb
May 9, 2016
This comment has been minimized.
This comment has been minimized.
|
|
oli-obk
added some commits
Apr 29, 2016
oli-obk
force-pushed the
oli-obk:eager_const
branch
from
37c3beb
to
6ac3812
May 11, 2016
This comment has been minimized.
This comment has been minimized.
|
@eddyb any update on the design decision? +rebased |
This comment has been minimized.
This comment has been minimized.
|
@rust-lang/compiler, do we want to discuss this PR today? |
This comment has been minimized.
This comment has been minimized.
let's discuss tomorrow, along with a bit more about constants in general |
This comment has been minimized.
This comment has been minimized.
|
Did the discussion yield any results wrt aggregate constants? |
This comment has been minimized.
This comment has been minimized.
|
We never did talk about it :( |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
since my original notion was to not have aggregates in MIR, and @eddyb feels that way, too, I'll close this. |
oli-obk commentedApr 29, 2016
•
edited
rebased eager const eval over @eddyb 's MIR-constants PR #33130
fixes #29928
fixes #33252
eval_const_expron literals and negated literalseval_const_exprcan't eval all kinds of constantseval_const_expr_partialConstValcontains owned versions of struct fields, tuple fields, array elements and the repeat valueRvalue::Aggregateinto a constantr? @eddyb