Comments (5)
This was also introduced by e60cb8a. :)
from p4c.
Actions inlining transforms foo()
to something like this:
@name("foo") action foo_0() {
{
@name("x") bit<28> x_0;
@name("y") bit<28> y_0;
if (true) {
if (false) {
__e(x_0);
}
} else if (false) {
__e2(y_0);
}
}
}
The problem is similar to #4500.
The condition
for both "if (false)" IR::IfStatement
s point to the same IR::BoolLiteral
, which is not expected by SimplifyDefUse
.
I was able to fix this with the following change to SubstituteParameters::postorder(IR::PathExpression *expr)
:
...
auto value = subst->lookup(param)->expression->clone();
...
from p4c.
I was able to fix this with the following change to
SubstituteParameters::postorder(IR::PathExpression *expr)
:
I am not sure if it would better to perform the cloning here or in ActionsInliner::preorder(IR::MethodCallStatement *statement)
instead.
from p4c.
Here is another case, which hits the same Compiler bug
, but is not fixed by my change described above:
extern void __e(in bit<28> arg);
extern void __e2(in bit<28> arg);
control C() {
action bar(bool a, bool b) {
bit<28> x; bit<28> y;
if (a) {
if (b) {
__e(x);
}
} else {
if (b) {
__e2(y);
}
}
}
action baz() {
bar(true, false);
}
action foo() {
baz();
baz();
}
table t {
actions = { foo; }
default_action = foo;
}
apply {
t.apply();
}
}
control proto();
package top(proto p);
top(C()) main;
from p4c.
or by inserting a pass that converts DAGs into trees before the def-use analysis.
This is starting to sound like the best solution..
from p4c.
Related Issues (20)
- `p4c` should prohibit different controllable entities having the same control-plane name HOT 3
- Wrong error message when arbitrary-precision int is shifted by runtime value
- Consider a centralized repository for dependency management? HOT 8
- Constant folding of bit width expressions is no longer complete
- Fix broken Ubuntu 18.04 test by pinning Boost dependencies using FetchContent
- Result of extern function call used in switch expression is incorrectly marked as a compile-time constant
- Emit the initial default action of a table in the P4Info file.
- Question about Static Analyzer HOT 2
- idea: IR validator, programatic pass pre/post conditions HOT 1
- Reduce p4c compile time HOT 15
- Spurious Bazel failures when compiling the graphs back end HOT 12
- [RFC] Make cstring constructor from `char*` explicit and `string_view` conversion implicit HOT 6
- Fix invalid format strings HOT 1
- Informing downstream compilers about sigificant code changes and how to migrate? HOT 4
- Improve json library internals HOT 2
- BDWGC and Z3 interact badly
- Unify debug / user-side node stringification HOT 1
- Build errors with gcc 14 HOT 9
- Clean up P4C namespaces
- Compiler does not reject assignment of `int` to header / runtime use of `int`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from p4c.