[PATCH] D80552: [PrintSCC] Fix printing a basic-block without a name

Stefanos Baziotis via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 28 13:45:40 PDT 2020


baziotis added inline comments.


================
Comment at: llvm/test/Other/print-cfg-sccs.ll:20
+2:
+  br i1 undef, label %1, label %3
+
----------------
ekatz wrote:
> fhahn wrote:
> > nit: branch on undef is UB. It would probably be better to pass in a condition as argument or something like that.
> 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).
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).
I also think that it would be better to use a valid value. Otherwise it looks good :)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D80552/new/

https://reviews.llvm.org/D80552





More information about the llvm-commits mailing list