Print a basic-block as an operand to handle the case where it has no name.
Details
Diff Detail
Event Timeline
LGTM, thanks!
llvm/test/Other/print-cfg-sccs.ll | ||
---|---|---|
20 | nit: branch on undef is UB. It would probably be better to pass in a condition as argument or something like that. |
llvm/test/Other/print-cfg-sccs.ll | ||
---|---|---|
20 | You are correct of course, but I have seen many other test cases that take the undef approach where all that matters is the CFG, and not the contents. for example "loop-pass-ordering.ll" (in the same directory). |
llvm/test/Other/print-cfg-sccs.ll | ||
---|---|---|
20 | I'm not familiar with a big part of LLVM test-suite, but any test cases that branch on undef (or generally, that they have some undef or whatever UB) it was intended for specific reasons (for example, to test UB recognition or it was propagated somehow). |
llvm/test/Other/print-cfg-sccs.ll | ||
---|---|---|
20 | As far as I know, it is ok to use undef in a brach if the destination doesn't matter. |
llvm/test/Other/print-cfg-sccs.ll | ||
---|---|---|
20 |
IIRC some passes had/have this interpretation, but it was recently clarified in the LangRef to make branch on undef UB explicitly (rG05f0e598ab265a80fedb23225cde4176f11774ac)
Thanks! |
nit: branch on undef is UB. It would probably be better to pass in a condition as argument or something like that.