[PATCH] D59472: [InstCombine] Add tests for add nuw + uaddo

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 17 12:27:47 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/uadd-with-overflow.ll:54
+
+define { <2 x i32>, <2 x i1> } @no_fold_splat_undef_constant(<2 x i32> %x) {
+; CHECK-LABEL: @no_fold_splat_undef_constant(
----------------
dlrobertson wrote:
> lebedev.ri wrote:
> > You could also add variations with non-splat non-undef constants
> I'm not sure I follow. Wouldn't a non-splat non-undef variation of this test be something like `simple_fold` on line 10?
I meant something like
```
  %a = add nuw <2 x i32> %x, <i32 12, i32 13> ; not splat, but still no overflow, but won't get folded
  %b = tail call { <2 x i32>, <2 x i1> } @llvm.uadd.with.overflow.v2i32(<2 x i32> %a, <2 x i32> <i32 30, i32 30>)
```
```
  %a = add nuw <2 x i32> %x, <i32 12, i32 4294967280> ; not splat, overflow
  %b = tail call { <2 x i32>, <2 x i1> } @llvm.uadd.with.overflow.v2i32(<2 x i32> %a, <2 x i32> <i32 30, i32 255>)
```



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

https://reviews.llvm.org/D59472





More information about the llvm-commits mailing list