Skip to content

Commit 28a1e74

Browse files
mpagemeta-codesync[bot]
authored andcommitted
Fix HIR used in tests
Summary: Use update_hir_expected.py to fix the HIR used in runtime tests: - Fix Bool -> ImmortalBool updates that were missed in D102901394 - Remove some things that claude apparently just hallucinated last time Reviewed By: alexmalyshev Differential Revision: D103438307 fbshipit-source-id: 7f98f91e9388484a6e9c27b8420fe1726c0d498a
1 parent 830bc92 commit 28a1e74

11 files changed

Lines changed: 137 additions & 165 deletions

cinderx/RuntimeTests/hir_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,8 @@ TEST_F(HIRBuildTest, MatchMapping) {
11121112
CurInstrOffset 0
11131113
Locals<1> v0
11141114
}
1115-
v2 = LoadField<ob_type@24, Type, borrowed> v0
1116-
v3 = LoadField<tp_flags@184, CUInt64, borrowed> v2
1115+
v2 = LoadField<ob_type@8, Type, borrowed> v0
1116+
v3 = LoadField<tp_flags@168, CUInt64, borrowed> v2
11171117
v4 = LoadConst<CUInt64[64]>
11181118
v5 = IntBinaryOp<And> v3 v4
11191119
CondBranch<1, 2> v5
@@ -1196,8 +1196,8 @@ TEST_F(HIRBuildTest, MatchSequence) {
11961196
CurInstrOffset 0
11971197
Locals<1> v0
11981198
}
1199-
v2 = LoadField<ob_type@24, Type, borrowed> v0
1200-
v3 = LoadField<tp_flags@184, CUInt64, borrowed> v2
1199+
v2 = LoadField<ob_type@8, Type, borrowed> v0
1200+
v3 = LoadField<tp_flags@168, CUInt64, borrowed> v2
12011201
v4 = LoadConst<CUInt64[32]>
12021202
v5 = IntBinaryOp<And> v3 v4
12031203
CondBranch<1, 2> v5

cinderx/RuntimeTests/hir_tests/all_passes_test.txt

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ fun jittestmodule:test {
499499
}
500500
}
501501
v16:MortalUnicodeExact["foo"] = LoadConst<MortalUnicodeExact["foo"]>
502-
v18:Bool = VectorCall<2> v15 v8 v16 {
502+
v18:ImmortalBool = VectorCall<2> v15 v8 v16 {
503503
LiveValues<3> b:v8 b:v15 b:v16
504504
FrameState {
505505
CurInstrOffset 16
@@ -541,7 +541,7 @@ fun jittestmodule:test {
541541
}
542542
}
543543
v16:MortalUnicodeExact["foo"] = LoadConst<MortalUnicodeExact["foo"]>
544-
v18:Bool = VectorCall<2> v14 v8 v16 {
544+
v18:ImmortalBool = VectorCall<2> v14 v8 v16 {
545545
LiveValues<3> b:v8 b:v14 b:v16
546546
FrameState {
547547
CurInstrOffset 16
@@ -584,7 +584,7 @@ fun jittestmodule:test {
584584
}
585585
v16:MortalUnicodeExact["foo"] = LoadConst<MortalUnicodeExact["foo"]>
586586
UpdatePrevInstr<idx:9 line_no:2: no parent>
587-
v18:Bool = VectorCall<2> v14 v8 v16 {
587+
v18:ImmortalBool = VectorCall<2> v14 v8 v16 {
588588
LiveValues<3> b:v8 b:v14 b:v16
589589
FrameState {
590590
CurInstrOffset 18
@@ -622,7 +622,7 @@ fun jittestmodule:test {
622622
}
623623

624624
bb 1 (preds 0, 2) {
625-
v13:Bool = Compare<In> v6 v7 {
625+
v13:ImmortalBool = Compare<In> v6 v7 {
626626
LiveValues<2> b:v6 b:v7
627627
FrameState {
628628
CurInstrOffset 6
@@ -655,7 +655,7 @@ fun jittestmodule:test {
655655
}
656656

657657
bb 1 (preds 0, 2) {
658-
v13:Bool = Compare<In> v6 v7 {
658+
v13:ImmortalBool = Compare<In> v6 v7 {
659659
LiveValues<2> b:v6 b:v7
660660
FrameState {
661661
CurInstrOffset 4
@@ -689,7 +689,7 @@ fun jittestmodule:test {
689689

690690
bb 1 (preds 0, 2) {
691691
UpdatePrevInstr<idx:3 line_no:2: no parent>
692-
v13:Bool = Compare<In> v6 v7 {
692+
v13:ImmortalBool = Compare<In> v6 v7 {
693693
LiveValues<2> b:v6 b:v7
694694
FrameState {
695695
CurInstrOffset 6
@@ -727,7 +727,7 @@ fun jittestmodule:test {
727727
}
728728

729729
bb 1 (preds 0, 2) {
730-
v13:Bool = Compare<NotIn> v6 v7 {
730+
v13:ImmortalBool = Compare<NotIn> v6 v7 {
731731
LiveValues<2> b:v6 b:v7
732732
FrameState {
733733
CurInstrOffset 6
@@ -760,7 +760,7 @@ fun jittestmodule:test {
760760
}
761761

762762
bb 1 (preds 0, 2) {
763-
v13:Bool = Compare<NotIn> v6 v7 {
763+
v13:ImmortalBool = Compare<NotIn> v6 v7 {
764764
LiveValues<2> b:v6 b:v7
765765
FrameState {
766766
CurInstrOffset 4
@@ -794,7 +794,7 @@ fun jittestmodule:test {
794794

795795
bb 1 (preds 0, 2) {
796796
UpdatePrevInstr<idx:3 line_no:2: no parent>
797-
v13:Bool = Compare<NotIn> v6 v7 {
797+
v13:ImmortalBool = Compare<NotIn> v6 v7 {
798798
LiveValues<2> b:v6 b:v7
799799
FrameState {
800800
CurInstrOffset 6

cinderx/RuntimeTests/hir_tests/builtin_load_method_elimination_test.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ fun jittestmodule:test {
346346
Locals<3> v15 v16 v18
347347
}
348348
}
349-
v25:Bool = PrimitiveBoxBool v24
349+
v25:ImmortalBool = PrimitiveBoxBool v24
350350
Snapshot
351351
v26:ImmortalBool[True] = LoadConst<ImmortalBool[True]>
352352
CondBranch<1, 2> v24
@@ -417,7 +417,7 @@ fun jittestmodule:test {
417417
Locals<3> v15 v16 v18
418418
}
419419
}
420-
v25:Bool = PrimitiveBoxBool v24
420+
v25:ImmortalBool = PrimitiveBoxBool v24
421421
Snapshot
422422
v26:ImmortalBool[True] = LoadConst<ImmortalBool[True]>
423423
CondBranch<1, 2> v24

cinderx/RuntimeTests/hir_tests/clean_cfg_test.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ fun test {
296296
fun test {
297297
bb 0 {
298298
v0:Object = LoadArg<0>
299-
v3:Bool = UnaryOp<Not> v0 {
299+
v3:ImmortalBool = UnaryOp<Not> v0 {
300300
FrameState {
301301
CurInstrOffset -2
302302
}
@@ -308,7 +308,7 @@ fun test {
308308
fun test {
309309
bb 0 {
310310
v0:Object = LoadArg<0>
311-
v3:Bool = UnaryOp<Not> v0 {
311+
v3:ImmortalBool = UnaryOp<Not> v0 {
312312
FrameState {
313313
CurInstrOffset -2
314314
}
@@ -320,7 +320,7 @@ fun test {
320320
fun test {
321321
bb 0 {
322322
v0:Object = LoadArg<0>
323-
v3:Bool = UnaryOp<Not> v0 {
323+
v3:ImmortalBool = UnaryOp<Not> v0 {
324324
FrameState {
325325
CurInstrOffset -2
326326
}

cinderx/RuntimeTests/hir_tests/dynamic_comparison_elimination_test.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ fun jittestmodule:test {
316316

317317
bb 7 (preds 5, 6) {
318318
v37:CBool = Phi<5, 6> v35 v36
319-
v38:Bool = PrimitiveBoxBool v37
319+
v38:ImmortalBool = PrimitiveBoxBool v37
320320
Snapshot
321321
UseType<Bool> v38
322322
v32:ImmortalBool[True] = LoadConst<ImmortalBool[True]>
323-
v26:Bool = PrimitiveBoxBool v37
323+
v26:ImmortalBool = PrimitiveBoxBool v37
324324
Snapshot
325325
v27:ImmortalBool[True] = LoadConst<ImmortalBool[True]>
326326
CondBranch<1, 2> v37
@@ -395,11 +395,11 @@ fun jittestmodule:test {
395395

396396
bb 7 (preds 5, 6) {
397397
v37:CBool = Phi<5, 6> v35 v36
398-
v38:Bool = PrimitiveBoxBool v37
398+
v38:ImmortalBool = PrimitiveBoxBool v37
399399
Snapshot
400400
UseType<Bool> v38
401401
v32:ImmortalBool[True] = LoadConst<ImmortalBool[True]>
402-
v26:Bool = PrimitiveBoxBool v37
402+
v26:ImmortalBool = PrimitiveBoxBool v37
403403
Snapshot
404404
v27:ImmortalBool[True] = LoadConst<ImmortalBool[True]>
405405
CondBranch<1, 2> v37

cinderx/RuntimeTests/hir_tests/hir_builder_static_test.txt

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ fun jittestmodule:test {
143143
}
144144
}
145145
Snapshot
146-
AtQuiescentState
147146
v3 = LoadEvalBreaker
148147
CondBranch<7, 6> v3
149148
}
@@ -161,10 +160,10 @@ fun jittestmodule:test {
161160

162161
bb 6 (preds 0, 7) {
163162
Snapshot
164-
v5 = LoadField<ob_type@24, Type, borrowed> v0
165-
v6 = LoadField<tp_cache@368, Object, borrowed> v5
166-
v7 = LoadField<vte_state@96, Object, borrowed> v6
167-
v9 = LoadField<vte_load@104, CPtr, borrowed> v6
163+
v5 = LoadField<ob_type@8, Type, borrowed> v0
164+
v6 = LoadField<tp_cache@352, Object, borrowed> v5
165+
v7 = LoadField<vte_state@80, Object, borrowed> v6
166+
v9 = LoadField<vte_load@88, CPtr, borrowed> v6
168167
v7 = CallInd<vte_load> v9 v7 v0 {
169168
FrameState {
170169
CurInstrOffset 8
@@ -421,7 +420,6 @@ fun jittestmodule:test {
421420
v1 = LoadCurrentFunc
422421
LoadFrame
423422
Snapshot
424-
AtQuiescentState
425423
v2 = LoadEvalBreaker
426424
CondBranch<2, 1> v2
427425
}
@@ -439,7 +437,7 @@ fun jittestmodule:test {
439437

440438
bb 1 (preds 0, 2) {
441439
Snapshot
442-
v4 = LoadField<x@32, OptObject, borrowed> v0
440+
v4 = LoadField<x@16, OptObject, borrowed> v0
443441
v4 = CheckField<"x"> v4 {
444442
GuiltyReg v0
445443
FrameState {
@@ -538,7 +536,6 @@ fun jittestmodule:test {
538536
v2 = LoadCurrentFunc
539537
LoadFrame
540538
Snapshot
541-
AtQuiescentState
542539
v3 = LoadEvalBreaker
543540
CondBranch<2, 1> v3
544541
}
@@ -556,8 +553,8 @@ fun jittestmodule:test {
556553

557554
bb 1 (preds 0, 2) {
558555
Snapshot
559-
v5 = LoadField<x@32, OptObject, owned> v0
560-
StoreField<x@32> v0 v1 v5
556+
v5 = LoadField<x@16, OptObject, owned> v0
557+
StoreField<x@16> v0 v1 v5
561558
Snapshot
562559
v6 = LoadConst<ImmortalNoneType>
563560
Return v6
@@ -652,7 +649,6 @@ fun jittestmodule:test {
652649
v0 = LoadCurrentFunc
653650
LoadFrame
654651
Snapshot
655-
AtQuiescentState
656652
v1 = LoadEvalBreaker
657653
CondBranch<2, 1> v1
658654
}
@@ -675,15 +671,15 @@ fun jittestmodule:test {
675671
}
676672
}
677673
Snapshot
678-
v4 = LoadConst<ImmortalTupleExact[tuple:0xdeadbeef]>
674+
v4 = LoadConst<MortalTupleExact[tuple:0xdeadbeef]>
679675
v5 = ListExtend v3 v4 {
680676
FrameState {
681677
CurInstrOffset 6
682678
Stack<1> v3
683679
}
684680
}
685681
Snapshot
686-
v6 = LoadField<ob_size@32, CInt64, borrowed> v3
682+
v6 = LoadField<ob_size@16, CInt64, borrowed> v3
687683
Snapshot
688684
v7 = PrimitiveBox<CInt64> v6 {
689685
FrameState {
@@ -788,7 +784,6 @@ fun jittestmodule:test {
788784
v0 = LoadCurrentFunc
789785
LoadFrame
790786
Snapshot
791-
AtQuiescentState
792787
v1 = LoadEvalBreaker
793788
CondBranch<2, 1> v1
794789
}
@@ -805,7 +800,7 @@ fun jittestmodule:test {
805800

806801
bb 1 (preds 0, 2) {
807802
Snapshot
808-
v3 = LoadConst<ImmortalUnicodeExact["hello"]>
803+
v3 = LoadConst<MortalUnicodeExact["hello"]>
809804
v4 = LoadConst<ImmortalLongExact[123]>
810805
Snapshot
811806
v5 = LoadConst<MortalFunc[function:0xdeadbeef]>
@@ -978,7 +973,6 @@ fun jittestmodule:test {
978973
}
979974
}
980975
Snapshot
981-
AtQuiescentState
982976
v2 = LoadEvalBreaker
983977
CondBranch<7, 6> v2
984978
}
@@ -995,7 +989,7 @@ fun jittestmodule:test {
995989

996990
bb 6 (preds 0, 7) {
997991
Snapshot
998-
v4 = LoadConst<ImmortalUnicodeExact["hello"]>
992+
v4 = LoadConst<MortalUnicodeExact["hello"]>
999993
v5 = LoadConst<ImmortalLongExact[123]>
1000994
Snapshot
1001995
v6 = LoadConst<MortalFunc[function:0xdeadbeef]>
@@ -1354,7 +1348,6 @@ fun jittestmodule:test {
13541348
v1 = LoadCurrentFunc
13551349
LoadFrame
13561350
Snapshot
1357-
AtQuiescentState
13581351
v2 = LoadEvalBreaker
13591352
CondBranch<2, 1> v2
13601353
}
@@ -1372,7 +1365,7 @@ fun jittestmodule:test {
13721365

13731366
bb 1 (preds 0, 2) {
13741367
Snapshot
1375-
v4 = LoadConst<ImmortalTupleExact[tuple:0xdeadbeef]>
1368+
v4 = LoadConst<MortalTupleExact[tuple:0xdeadbeef]>
13761369
v0 = Assign v4
13771370
v5 = LoadConst<ImmortalLongExact[1]>
13781371
Snapshot
@@ -1737,7 +1730,6 @@ fun jittestmodule:test {
17371730
v1 = LoadCurrentFunc
17381731
LoadFrame
17391732
Snapshot
1740-
AtQuiescentState
17411733
v2 = LoadEvalBreaker
17421734
CondBranch<2, 1> v2
17431735
}
@@ -1901,7 +1893,6 @@ fun jittestmodule:test {
19011893
v2 = LoadCurrentFunc
19021894
LoadFrame
19031895
Snapshot
1904-
AtQuiescentState
19051896
v3 = LoadEvalBreaker
19061897
CondBranch<2, 1> v3
19071898
}
@@ -1934,7 +1925,7 @@ fun jittestmodule:test {
19341925
}
19351926
}
19361927
Snapshot
1937-
v7 = LoadConst<ImmortalTupleExact[tuple:0xdeadbeef]>
1928+
v7 = LoadConst<MortalTupleExact[tuple:0xdeadbeef]>
19381929
v8 = ListExtend v6 v7 {
19391930
FrameState {
19401931
CurInstrOffset 12
@@ -1961,7 +1952,7 @@ fun jittestmodule:test {
19611952
Locals<2> v0 v1
19621953
}
19631954
}
1964-
v13 = LoadField<ob_item@40, CPtr, borrowed> v0
1955+
v13 = LoadField<ob_item@24, CPtr, borrowed> v0
19651956
v14 = LoadArrayItem v13 v12 v0
19661957
Snapshot
19671958
v14 = RefineType<Long> v14
@@ -2148,7 +2139,6 @@ fun jittestmodule:test {
21482139
}
21492140
v0 = Assign v3
21502141
Snapshot
2151-
AtQuiescentState
21522142
v4 = LoadEvalBreaker
21532143
CondBranch<2, 1> v4
21542144
}
@@ -2365,7 +2355,6 @@ fun jittestmodule:test {
23652355
v1 = LoadCurrentFunc
23662356
LoadFrame
23672357
Snapshot
2368-
AtQuiescentState
23692358
v2 = LoadEvalBreaker
23702359
CondBranch<2, 1> v2
23712360
}
@@ -2383,7 +2372,7 @@ fun jittestmodule:test {
23832372

23842373
bb 1 (preds 0, 2) {
23852374
Snapshot
2386-
v4 = LoadField<_field@32, OptObject, borrowed> v0
2375+
v4 = LoadField<_field@16, OptObject, borrowed> v0
23872376
v4 = CheckField<"_field"> v4 {
23882377
GuiltyReg v0
23892378
FrameState {
@@ -2505,7 +2494,6 @@ fun jittestmodule:test {
25052494
v1 = LoadCurrentFunc
25062495
LoadFrame
25072496
Snapshot
2508-
AtQuiescentState
25092497
v2 = LoadEvalBreaker
25102498
CondBranch<2, 1> v2
25112499
}

0 commit comments

Comments
 (0)