[IR] Split const folding into necessary one and for optimizations only

In this commit we have a lot of change in test data. This was caused
by the way where we evaluate constants. We split constant evaluation
into two distinct parts: only necessary evaluations for `fir2ir`
(like const val and annotations) and optimizations for lowering.
Now we don't do all constant evaluation on `fir2ir`, but IR
dump is executed after this phase, so test data changed.

#KT-58923
This commit is contained in:
Ivan Kylchik
2023-05-28 18:43:30 +02:00
committed by Space Team
parent 8067df3c94
commit dd264cff50
96 changed files with 648 additions and 327 deletions
@@ -1,8 +1,8 @@
private fun test(x: Long) {
return countIssues(restrictionsBuilder = local fun ArgumentsBuilder.<anonymous>() {
($this$countIssues, <get-spentTime>().lessEq<Int>(t = 120)).unaryPlus()
($this$countIssues, <get-spentTime>().lessEq<Int>(t = id<Int>(arg = 120))).unaryPlus()
($this$countIssues, <get-spentTime>().select<Long>(t = 120L, r = x)).unaryPlus()
($this$countIssues, <get-spentTime>().lessEq<Int>(t = 2.times(other = 60))).unaryPlus()
($this$countIssues, <get-spentTime>().lessEq<Int>(t = id<Int>(arg = 2.times(other = 60)))).unaryPlus()
($this$countIssues, <get-spentTime>().select<Long>(t = 2.times(other = 60).toLong(), r = x)).unaryPlus()
}
)
}