[LoongArch] Fix the assertion for atomic store with 'ptr' type
[llvm-project.git] / llvm / test / Transforms / ConstraintElimination / overflows.ll
blob556ae0c56f9aad7ce90a88e950529425bb140d50
1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes=constraint-elimination -S %s | FileCheck %s
4 define i1 @test_overflow_sub_coefficients(i8 %x, i64 %y) {
5 ; CHECK-LABEL: define i1 @test_overflow_sub_coefficients
6 ; CHECK-SAME: (i8 [[X:%.*]], i64 [[Y:%.*]]) {
7 ; CHECK-NEXT:  bb:
8 ; CHECK-NEXT:    [[ZEXT:%.*]] = zext i8 [[X]] to i64
9 ; CHECK-NEXT:    [[SHL:%.*]] = shl nuw nsw i64 [[ZEXT]], 63
10 ; CHECK-NEXT:    [[ICMP:%.*]] = icmp uge i64 [[SHL]], [[Y]]
11 ; CHECK-NEXT:    ret i1 [[ICMP]]
13 bb:
14   %zext = zext i8 %x to i64
15   %shl = shl nuw nsw i64 %zext, 63
16   %icmp = icmp uge i64 %shl, %y
17   ret i1 %icmp
20 define i1 @test_overflow_in_negate_constraint(i8 %x, i64 %y) {
21 ; CHECK-LABEL: define i1 @test_overflow_in_negate_constraint
22 ; CHECK-SAME: (i8 [[X:%.*]], i64 [[Y:%.*]]) {
23 ; CHECK-NEXT:  bb:
24 ; CHECK-NEXT:    [[ZEXT:%.*]] = zext i8 [[X]] to i64
25 ; CHECK-NEXT:    [[SHL:%.*]] = shl nuw nsw i64 [[ZEXT]], 63
26 ; CHECK-NEXT:    [[ICMP:%.*]] = icmp uge i64 [[Y]], [[SHL]]
27 ; CHECK-NEXT:    ret i1 [[ICMP]]
29 bb:
30   %zext = zext i8 %x to i64
31   %shl = shl nuw nsw i64 %zext, 63
32   %icmp = icmp uge i64 %y, %shl
33   ret i1 %icmp