[PATCH] D140849: [InstCombine] Add tests for binops with conditions/assume constraints

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 27 01:31:35 PST 2023


nikic added a comment.

I think we're stilling missing a test where the icmp constant is not zero.



================
Comment at: llvm/test/Transforms/InstCombine/icmp-binop.ll:25
+  %mul = mul <2 x i64> %v, <i64 3, i64 3>
+  %cmp = icmp eq <2 x i64> %mul, <i64 0, i64 0>
+  ret <2 x i1> %cmp
----------------
Either this should be `ne` or the test name adjusted.


================
Comment at: llvm/test/Transforms/InstCombine/icmp-binop.ll:102
+  %lb = and i64 %v, 1
+  %odd = icmp ne i64 %lb, 1
+  call void @llvm.assume(i1 %odd)
----------------
Was this supposed to be a 0 (or an eq)? Otherwise this is assuming even, not odd.


================
Comment at: llvm/test/Transforms/InstCombine/icmp-binop.ll:246
+;
+  %nz = icmp ne i64 %v, 0
+  br i1 %nz, label %true, label %false
----------------
I think we're still missing a test where the second op is non-zero, so maybe change `%v` to `%v2` here?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140849



More information about the llvm-commits mailing list