]> granicus.if.org Git - llvm/commitdiff
[InstCombine] add descriptive comments for tests; NFC
authorSanjay Patel <spatel@rotateright.com>
Thu, 13 Jul 2017 17:24:57 +0000 (17:24 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 13 Jul 2017 17:24:57 +0000 (17:24 +0000)
Also, remove unnecessary function attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@307930 91177308-0d34-0410-b5e6-96231b3b80d8

test/Transforms/InstCombine/or-xor.ll

index 947971c6c83b0defd50dbc42c7372018a36086a9..be64f51b6c4c5bbae6cf7f2b3f1ac2765020fae8 100644 (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