Skip to content

Try to fix frontend SimplifyDefUse pass#6

Draft
kfcripps wants to merge 5 commits intomainfrom
simplify-def-use-context
Draft

Try to fix frontend SimplifyDefUse pass#6
kfcripps wants to merge 5 commits intomainfrom
simplify-def-use-context

Conversation

@kfcripps
Copy link
Owner

No description provided.

@kfcripps kfcripps changed the title Try to fix frontend SimplifyDefUsa pass Try to fix frontend SimplifyDefUse pass Jul 10, 2024
@kfcripps kfcripps force-pushed the simplify-def-use-context branch 13 times, most recently from abfffee to 2e76c92 Compare July 13, 2024 15:18
@kfcripps
Copy link
Owner Author

Breakpoint 1, Util::CompilerBug::CompilerBug<P4::ProgramPoint&> (this=0x14ba5bbf0, line=32767, file=0x7fffffffbf80 "", format=0x7ff8779f8108 "") at /local/kfcripps/repos/p4c/lib/exceptions.h:101
101         CompilerBug(int line, const char *file, const char *format, Args &&...args)
(gdb) bt
#0  Util::CompilerBug::CompilerBug<P4::ProgramPoint&> (this=0x14ba5bbf0, line=32767, file=0x7fffffffbf80 "", format=0x7ff8779f8108 "") at /local/kfcripps/repos/p4c/lib/exceptions.h:101
#1  0x0000555557176342 in P4::AllDefinitions::setDefinitionsAt (this=0x7ff879b9f480, point=..., defs=0x7ff879bb2280, overwrite=false) at /local/kfcripps/repos/p4c/frontends/p4/def_use.h:481
#2  0x0000555557310a6b in P4::ComputeWriteSet::setDefinitions (this=0x7ff879ba6380, defs=0x7ff879bb2280, node=0x0, overwrite=false) at /local/kfcripps/repos/p4c/frontends/p4/def_use.cpp:477
#3  0x0000555557314b94 in P4::ComputeWriteSet::preorder (this=0x7ff879ba6380, statement=0x7ff87799d640) at /local/kfcripps/repos/p4c/frontends/p4/def_use.cpp:940
#4  0x00005555573ddfa3 in IR::BlockStatement::apply_visitor_preorder (this=0x7ff87799d640, v=...) at /local/kfcripps/repos/p4c/ir/visitor.cpp:742
#5  0x000055555738fc96 in Inspector::apply_visitor (this=0x7ff879ba6380, n=0x7ff87799d640, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:513
#6  0x00005555569f8470 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7fffffffc130: 0x7ff87799d640, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:124
#7  0x0000555557408dcb in Visitor::visit (this=0x7ff879ba64e8, n=@0x7ff87874fe48: 0x7ff87799d640, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:764
#8  0x0000555557315751 in P4::ComputeWriteSet::preorder (this=0x7ff879ba6380, statement=0x7ff879614b60) at /local/kfcripps/repos/p4c/frontends/p4/def_use.cpp:1007
#9  0x00005555573dea41 in IR::SwitchStatement::apply_visitor_preorder (this=0x7ff879614b60, v=...) at /local/kfcripps/repos/p4c/ir/visitor.cpp:742
#10 0x000055555738fc96 in Inspector::apply_visitor (this=0x7ff879ba6380, n=0x7ff879614b60, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:513
#11 0x00005555569f8470 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7fffffffc340: 0x7ff879614b60, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:124
#12 0x00005555573ec467 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7ff879991110: 0x7ff879614b60, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:764
#13 0x0000555556a06672 in IR::IndexedVector<IR::StatOrDecl>::visit_children (this=0x7ff8799c9048, v=...) at /local/kfcripps/repos/p4c/ir/ir-inline.h:182
#14 0x00005555569f85d6 in Visitor::visit (this=0x7ff879ba64e8, n=..., name=0x5555579a6e71 "components") at /local/kfcripps/repos/p4c/ir/visitor.h:151
#15 0x0000555557314b76 in P4::ComputeWriteSet::preorder (this=0x7ff879ba6380, statement=0x7ff8799c9000) at /local/kfcripps/repos/p4c/frontends/p4/def_use.cpp:939
#16 0x00005555573ddfa3 in IR::BlockStatement::apply_visitor_preorder (this=0x7ff8799c9000, v=...) at /local/kfcripps/repos/p4c/ir/visitor.cpp:742
#17 0x000055555738fc96 in Inspector::apply_visitor (this=0x7ff879ba6380, n=0x7ff8799c9000, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:513
#18 0x00005555569f8470 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7fffffffc500: 0x7ff8799c9000, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:124
#19 0x0000555557408dcb in Visitor::visit (this=0x7ff879ba64e8, n=@0x7ff879a06748: 0x7ff8799c9000, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:764
#20 0x0000555557315751 in P4::ComputeWriteSet::preorder (this=0x7ff879ba6380, statement=0x7ff879a03460) at /local/kfcripps/repos/p4c/frontends/p4/def_use.cpp:1007
#21 0x00005555573dea41 in IR::SwitchStatement::apply_visitor_preorder (this=0x7ff879a03460, v=...) at /local/kfcripps/repos/p4c/ir/visitor.cpp:742
#22 0x000055555738fc96 in Inspector::apply_visitor (this=0x7ff879ba6380, n=0x7ff879a03460, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:513
#23 0x00005555569f8470 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7fffffffc710: 0x7ff879a03460, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:124
#24 0x00005555573ec467 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7ff8799911d0: 0x7ff879a03460, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:764
#25 0x0000555556a06672 in IR::IndexedVector<IR::StatOrDecl>::visit_children (this=0x7ff8799c9548, v=...) at /local/kfcripps/repos/p4c/ir/ir-inline.h:182
#26 0x00005555569f85d6 in Visitor::visit (this=0x7ff879ba64e8, n=..., name=0x5555579a6e71 "components") at /local/kfcripps/repos/p4c/ir/visitor.h:151
#27 0x0000555557314b76 in P4::ComputeWriteSet::preorder (this=0x7ff879ba6380, statement=0x7ff8799c9500) at /local/kfcripps/repos/p4c/frontends/p4/def_use.cpp:939
#28 0x00005555573ddfa3 in IR::BlockStatement::apply_visitor_preorder (this=0x7ff8799c9500, v=...) at /local/kfcripps/repos/p4c/ir/visitor.cpp:742
#29 0x000055555738fc96 in Inspector::apply_visitor (this=0x7ff879ba6380, n=0x7ff8799c9500, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:513
#30 0x00005555569f8470 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7fffffffc8d0: 0x7ff8799c9500, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:124
#31 0x000055555740a6db in Visitor::visit (this=0x7ff879ba64e8, n=@0x7ff879ba66a0: 0x7ff8799c9500, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:764
#32 0x0000555557313bca in P4::ComputeWriteSet::preorder (this=0x7ff879ba6380, control=0x7ff879ba6540) at /local/kfcripps/repos/p4c/frontends/p4/def_use.cpp:852
#33 0x00005555573d7901 in IR::P4Control::apply_visitor_preorder (this=0x7ff879ba6540, v=...) at /local/kfcripps/repos/p4c/ir/visitor.cpp:742
#34 0x000055555738fc96 in Inspector::apply_visitor (this=0x7ff879ba6380, n=0x7ff879ba6540, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:513
#35 0x00005555569f8428 in Visitor::visit (this=0x7ff879ba64e8, n=@0x7fffffffcae8: 0x7ff879ba6540, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:122
#36 0x0000555557376f8c in IR::Node::apply (this=0x7ff879ba6540, v=..., ctxt=0x0) at /local/kfcripps/repos/p4c/ir/node.cpp:159
#37 0x0000555557378067 in PassManager::apply_visitor (this=0x7fffffffcce0, program=0x7ff879ba6540) at /local/kfcripps/repos/p4c/ir/pass_manager.cpp:82
#38 0x00005555569f8428 in Visitor::visit (this=0x7fffffffcd60, n=@0x7fffffffcc78: 0x7ff879ba6540, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:122
#39 0x0000555557376f8c in IR::Node::apply (this=0x7ff879ba6540, v=..., ctxt=0x0) at /local/kfcripps/repos/p4c/ir/node.cpp:159
#40 0x00005555571727ce in P4::DoSimplifyDefUse::process (this=0x7ff877a55620, node=0x7ff879ba6540) at /local/kfcripps/repos/p4c/frontends/p4/simplifyDefUse.cpp:1549
#41 0x00005555570bf0e9 in P4::DoSimplifyDefUse::postorder (this=0x7ff877a55620, control=0x7ff879ba6540) at /local/kfcripps/repos/p4c/frontends/p4/simplifyDefUse.h:47
#42 0x00005555573d7a73 in IR::P4Control::apply_visitor_postorder (this=0x7ff879ba6540, v=...) at /local/kfcripps/repos/p4c/ir/visitor.cpp:742
#43 0x000055555739032c in Transform::apply_visitor (this=0x7ff877a55620, n=0x7ff879a07540, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:576
#44 0x00005555569fb923 in IR::Vector<IR::Node>::visit_children (this=0x7ff879b61740, v=...) at /local/kfcripps/repos/p4c/ir/ir-inline.h:81
#45 0x00005555569373f4 in IR::P4Program::visit_children (this=0x7ff879b61700, v=...) at /local/kfcripps/repos/p4c/build/ninja/debug/ir/ir-generated.cpp:8460
#46 0x0000555557390305 in Transform::apply_visitor (this=0x7ff877a55620, n=0x7ff8799c72a0, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:575
#47 0x00005555569f8428 in Visitor::visit (this=0x7ff877a55650, n=@0x7fffffffd0f8: 0x7ff8799c72a0, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:122
#48 0x0000555557376f8c in IR::Node::apply (this=0x7ff8799c72a0, v=..., ctxt=0x0) at /local/kfcripps/repos/p4c/ir/node.cpp:159
#49 0x0000555557378067 in PassManager::apply_visitor (this=0x7ff877a5ee70, program=0x7ff8799c72a0) at /local/kfcripps/repos/p4c/ir/pass_manager.cpp:82
#50 0x0000555557378df3 in PassRepeated::apply_visitor (this=0x7ff877a5ee60, program=0x7ff8799c72a0, name=0x0) at /local/kfcripps/repos/p4c/ir/pass_manager.cpp:153
#51 0x00005555569f8428 in Visitor::visit (this=0x7ff877a5eeb8, n=@0x7fffffffd338: 0x7ff8799c72a0, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:122
#52 0x0000555557376f8c in IR::Node::apply (this=0x7ff8799c72a0, v=..., ctxt=0x0) at /local/kfcripps/repos/p4c/ir/node.cpp:159
#53 0x0000555557378067 in PassManager::apply_visitor (this=0x7ff877a5c7e0, program=0x7ff8799c72a0) at /local/kfcripps/repos/p4c/ir/pass_manager.cpp:82
#54 0x00005555569f8428 in Visitor::visit (this=0x7ff877a5c828, n=@0x7fffffffd4c8: 0x7ff8799c72a0, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.h:122
#55 0x0000555557376f8c in IR::Node::apply (this=0x7ff8799c72a0, v=..., ctxt=0x0) at /local/kfcripps/repos/p4c/ir/node.cpp:159
#56 0x0000555557378067 in PassManager::apply_visitor (this=0x7fffffffd750, program=0x7ff8799c72a0) at /local/kfcripps/repos/p4c/ir/pass_manager.cpp:82
#57 0x0000555557408990 in Visitor::visit (this=0x7fffffffd798, n=@0x7fffffffd678: 0x7ff877a47460, name=0x0) at /local/kfcripps/repos/p4c/ir/visitor.cpp:764
#58 0x0000555556937238 in IR::P4Program::apply (this=0x7ff877a47460, v=..., ctxt=0x0) at /local/kfcripps/repos/p4c/build/ninja/debug/ir/ir-generated.cpp:8447
#59 0x00005555570b6c3c in P4::FrontEnd::run (this=0x7fffffffdca0, options=..., program=0x7ff877a47460, outStream=0x0) at /local/kfcripps/repos/p4c/frontends/p4/frontend.cpp:282
#60 0x0000555556cccb8d in main (argc=4, argv=0x7fffffffe7a8) at /local/kfcripps/repos/p4c/backends/p4test/p4test.cpp:147

@kfcripps
Copy link
Owner Author

        300 - p4/testdata/p4_16_samples/header-stack-ops-bmv2.p4 (Failed)
        355 - p4/testdata/p4_16_samples/issue1127-bmv2.p4 (Failed)
        650 - p4/testdata/p4_16_samples/issue3650.p4 (Failed)
        660 - p4/testdata/p4_16_samples/issue3884.p4 (Failed)

@kfcripps
Copy link
Owner Author

        300 - p4/testdata/p4_16_samples/header-stack-ops-bmv2.p4 (Failed)
        355 - p4/testdata/p4_16_samples/issue1127-bmv2.p4 (Failed)
        650 - p4/testdata/p4_16_samples/issue3650.p4 (Failed)
        660 - p4/testdata/p4_16_samples/issue3884.p4 (Failed)
        1229 - p4/testdata/p4_16_samples/dash/dash-pipeline-pna-dpdk.p4 (Failed)
        1230 - p4/testdata/p4_16_samples/dash/dash-pipeline-v1model-bmv2.p4 (Failed)

@kfcripps kfcripps force-pushed the simplify-def-use-context branch from 148e2d4 to 50c0f9f Compare July 17, 2024 22:55
@asl asl force-pushed the simplify-def-use-context branch from 50c0f9f to 9d1fb35 Compare July 18, 2024 01:14
kfcripps added 5 commits July 19, 2024 08:41
…Expression*s

Signed-off-by: Kyle Cripps <kyle@pensando.io>
…_set instead of std::set for cached_locs

Signed-off-by: Kyle Cripps <kyle@pensando.io>
Signed-off-by: Kyle Cripps <kyle@pensando.io>
Signed-off-by: Kyle Cripps <kyle@pensando.io>
Signed-off-by: Kyle Cripps <kyle@pensando.io>
@kfcripps kfcripps force-pushed the simplify-def-use-context branch from 9d1fb35 to 6858f16 Compare July 19, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant