[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 09:23:49 PDT 2019


lebedev.ri added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/uadd-with-overflow.ll:87-96
+define { i32, i1 } @no_fold_nsw(i32) {
+; CHECK-LABEL: @no_fold_nsw(
+; CHECK-NEXT:    [[TMP2:%.*]] = add nsw i32 [[TMP0:%.*]], 12
+; CHECK-NEXT:    [[TMP3:%.*]] = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 [[TMP2]], i32 30)
+; CHECK-NEXT:    ret { i32, i1 } [[TMP3]]
+;
+  %2 = add nsw i32 %0, 12
----------------
Also add test with plain `add`.


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

https://reviews.llvm.org/D59472





More information about the llvm-commits mailing list