1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
2 ; RUN: llc < %s -mtriple=powerpc-unknown-linux-gnu | FileCheck %s
3 ; RUN: llc < %s -mtriple=powerpc-ibm-aix-xcoff | FileCheck %s
5 define noundef i32 @add(i32 noundef %a, i32 noundef %b, ptr nocapture noundef writeonly %ovf) {
7 ; CHECK: # %bb.0: # %entry
9 ; CHECK-NEXT: addc 3, 3, 4
10 ; CHECK-NEXT: addze 4, 6
11 ; CHECK-NEXT: stw 4, 0(5)
14 %0 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %a, i32 %b)
15 %1 = extractvalue { i32, i1 } %0, 1
16 %2 = extractvalue { i32, i1 } %0, 0
17 %3 = zext i1 %1 to i32
18 store i32 %3, ptr %ovf, align 8
22 declare { i32, i1 } @llvm.uadd.with.overflow.i32(i32, i32)
24 define noundef zeroext i1 @add_overflow(i32 noundef %a, i32 noundef %b, ptr nocapture noundef writeonly %ovf) {
25 ; CHECK-LABEL: add_overflow:
26 ; CHECK: # %bb.0: # %entry
28 ; CHECK-NEXT: addc 4, 3, 4
29 ; CHECK-NEXT: addze 3, 6
30 ; CHECK-NEXT: stw 4, 0(5)
33 %0 = tail call { i32, i1 } @llvm.uadd.with.overflow.i32(i32 %a, i32 %b)
34 %1 = extractvalue { i32, i1 } %0, 1
35 %2 = extractvalue { i32, i1 } %0, 0
36 store i32 %2, ptr %ovf, align 8