[PATCH] D157798: [ValueTracking] Add tests for deducing non-zero based for incoming phi-edges; NFC

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 14 03:00:48 PDT 2023


nikic added inline comments.


================
Comment at: llvm/test/Analysis/ValueTracking/phi-known-nonzero.ll:24
+F:
+  br i1 true, label %T, label %F
+}
----------------
Does just `br label %T` not work here? I don't think the conditional is needed.


================
Comment at: llvm/test/Analysis/ValueTracking/phi-known-nonzero.ll:211
+  ret i1 %r
+}
----------------
goldstein.w.n wrote:
> nikic wrote:
> > Missing test for the equal successor case?
> > 
> > And unless I missed it, there is no test for swapped successors (F, T instead of T, F)?
> > Missing test for the equal successor case?
> What do you mean 'equal successor case'?
> > And unless I missed it, there is no test for swapped successors (F, T instead of T, F)?
> eq_non_zero2 and all the `*lt/*le` cases?
> But added a failure case for this as well.
> What do you mean 'equal successor case'?

`br i1 %cmp, label %T, label %T`

> What do you mean 'equal successor case'?

Oh, I see. You always use `br i1 %cmp, label %T, label %F`, but in some cases the phi is in `%T` and in some in  `%F`. Okay, that also works.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D157798



More information about the llvm-commits mailing list