1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2 ; RUN: opt -S -passes=gvn < %s | FileCheck %s
4 ; Make sure nsw/nuw flags are dropped.
6 define i32 @pr82884(i32 %x) {
7 ; CHECK-LABEL: define i32 @pr82884(
8 ; CHECK-SAME: i32 [[X:%.*]]) {
9 ; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[X]], [[X]]
10 ; CHECK-NEXT: call void @use(i32 [[MUL]])
11 ; CHECK-NEXT: [[MUL2:%.*]] = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 [[X]], i32 [[X]])
12 ; CHECK-NEXT: ret i32 [[MUL]]
14 %mul = mul nsw nuw i32 %x, %x
15 call void @use(i32 %mul)
16 %mul2 = call { i32, i1 } @llvm.smul.with.overflow.i32(i32 %x, i32 %x)
17 %ret = extractvalue { i32, i1 } %mul2, 0
21 declare void @use(i32)