[InstCombine] Move test to instcombine; NFC

This test uses -instcombine, so move it into the appropriate
directory. Also fork it for expensive checks enabled/disabled.
This commit is contained in:
Nikita Popov 2020-03-20 12:40:11 +01:00
parent 9967352a03
commit ce6c95aaca
1 changed files with 14 additions and 5 deletions

View File

@ -1,5 +1,6 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -instcombine -S | FileCheck %s
; RUN: opt < %s -instcombine -expensive-combines=0 -S | FileCheck %s --check-prefixes=CHECK,EXPENSIVE-OFF
; RUN: opt < %s -instcombine -expensive-combines=1 -S | FileCheck %s --check-prefixes=CHECK,EXPENSIVE-ON
; Result of left shifting a non-negative integer
; with nsw flag should also be non-negative
@ -29,8 +30,12 @@ define i1 @test_shift_negative(i32 %a, i32 %b) {
; If sign bit is a known zero, it cannot be a known one.
; This test should not crash opt. The shift produces poison.
define i32 @test_no_sign_bit_conflict1(i1 %b) {
; CHECK-LABEL: @test_no_sign_bit_conflict1(
; CHECK-NEXT: ret i32 0
; EXPENSIVE-OFF-LABEL: @test_no_sign_bit_conflict1(
; EXPENSIVE-OFF-NEXT: [[SEL:%.*]] = select i1 [[B:%.*]], i32 -2147221504, i32 -2147483648
; EXPENSIVE-OFF-NEXT: ret i32 [[SEL]]
;
; EXPENSIVE-ON-LABEL: @test_no_sign_bit_conflict1(
; EXPENSIVE-ON-NEXT: ret i32 0
;
%sel = select i1 %b, i32 8193, i32 8192
%mul = shl nsw i32 %sel, 18
@ -40,8 +45,12 @@ define i32 @test_no_sign_bit_conflict1(i1 %b) {
; If sign bit is a known one, it cannot be a known zero.
; This test should not crash opt. The shift produces poison.
define i32 @test_no_sign_bit_conflict2(i1 %b) {
; CHECK-LABEL: @test_no_sign_bit_conflict2(
; CHECK-NEXT: ret i32 0
; EXPENSIVE-OFF-LABEL: @test_no_sign_bit_conflict2(
; EXPENSIVE-OFF-NEXT: [[SEL:%.*]] = select i1 [[B:%.*]], i32 2147221504, i32 2146959360
; EXPENSIVE-OFF-NEXT: ret i32 [[SEL]]
;
; EXPENSIVE-ON-LABEL: @test_no_sign_bit_conflict2(
; EXPENSIVE-ON-NEXT: ret i32 0
;
%sel = select i1 %b, i32 -8193, i32 -8194
%mul = shl nsw i32 %sel, 18