[InstCombine] add descriptive comments for tests; NFC

Also, remove unnecessary function attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307930 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Sanjay Patel 2017-07-13 17:24:57 +00:00
parent a87a22c9e1
commit 4632cb1499

View File

@ -1,7 +1,9 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -S -instcombine < %s | FileCheck %s
define i32 @test1(i32 %x, i32 %y) nounwind {
; X | ~(X | Y) --> X | ~Y
define i32 @test1(i32 %x, i32 %y) {
; CHECK-LABEL: @test1(
; CHECK-NEXT: [[Y_NOT:%.*]] = xor i32 %y, -1
; CHECK-NEXT: [[Z:%.*]] = or i32 [[Y_NOT]], %x
@ -13,7 +15,10 @@ define i32 @test1(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test2(i32 %x, i32 %y) nounwind {
; Commute (rename) the inner 'or' operands:
; Y | ~(X | Y) --> ~X | Y
define i32 @test2(i32 %x, i32 %y) {
; CHECK-LABEL: @test2(
; CHECK-NEXT: [[X_NOT:%.*]] = xor i32 %x, -1
; CHECK-NEXT: [[Z:%.*]] = or i32 [[X_NOT]], %y
@ -25,7 +30,9 @@ define i32 @test2(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test3(i32 %x, i32 %y) nounwind {
; X | ~(X ^ Y) --> X | ~Y
define i32 @test3(i32 %x, i32 %y) {
; CHECK-LABEL: @test3(
; CHECK-NEXT: [[Y_NOT:%.*]] = xor i32 %y, -1
; CHECK-NEXT: [[Z:%.*]] = or i32 [[Y_NOT]], %x
@ -37,7 +44,10 @@ define i32 @test3(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test4(i32 %x, i32 %y) nounwind {
; Commute (rename) the 'xor' operands:
; Y | ~(X ^ Y) --> ~X | Y
define i32 @test4(i32 %x, i32 %y) {
; CHECK-LABEL: @test4(
; CHECK-NEXT: [[X_NOT:%.*]] = xor i32 %x, -1
; CHECK-NEXT: [[Z:%.*]] = or i32 [[X_NOT]], %y
@ -49,7 +59,7 @@ define i32 @test4(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test5(i32 %x, i32 %y) nounwind {
define i32 @test5(i32 %x, i32 %y) {
; CHECK-LABEL: @test5(
; CHECK-NEXT: ret i32 -1
;
@ -59,7 +69,7 @@ define i32 @test5(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test6(i32 %x, i32 %y) nounwind {
define i32 @test6(i32 %x, i32 %y) {
; CHECK-LABEL: @test6(
; CHECK-NEXT: ret i32 -1
;
@ -69,7 +79,7 @@ define i32 @test6(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test7(i32 %x, i32 %y) nounwind {
define i32 @test7(i32 %x, i32 %y) {
; CHECK-LABEL: @test7(
; CHECK-NEXT: [[Z:%.*]] = or i32 %x, %y
; CHECK-NEXT: ret i32 [[Z]]
@ -79,7 +89,7 @@ define i32 @test7(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test8(i32 %x, i32 %y) nounwind {
define i32 @test8(i32 %x, i32 %y) {
; CHECK-LABEL: @test8(
; CHECK-NEXT: [[X_NOT:%.*]] = xor i32 %x, -1
; CHECK-NEXT: [[Z:%.*]] = or i32 [[X_NOT]], %y
@ -91,7 +101,7 @@ define i32 @test8(i32 %x, i32 %y) nounwind {
ret i32 %z
}
define i32 @test9(i32 %x, i32 %y) nounwind {
define i32 @test9(i32 %x, i32 %y) {
; CHECK-LABEL: @test9(
; CHECK-NEXT: [[Y_NOT:%.*]] = xor i32 %y, -1
; CHECK-NEXT: [[Z:%.*]] = or i32 [[Y_NOT]], %x