From c41d0c8a9b73eb844776b29328e3e2f63234a2a6 Mon Sep 17 00:00:00 2001 From: Sanjay Patel Date: Wed, 30 Nov 2016 18:49:56 +0000 Subject: [PATCH] [InstCombine] update test to use FileCheck and auto-generate checks; NFC llvm-svn: 288261 --- llvm/test/Transforms/InstCombine/narrow.ll | 29 +++++++++++----------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/llvm/test/Transforms/InstCombine/narrow.ll b/llvm/test/Transforms/InstCombine/narrow.ll index 5dd13a096621..7416568f5865 100644 --- a/llvm/test/Transforms/InstCombine/narrow.ll +++ b/llvm/test/Transforms/InstCombine/narrow.ll @@ -1,18 +1,19 @@ -; This file contains various testcases that check to see that instcombine -; is narrowing computations when possible. -; RUN: opt < %s -instcombine -S | \ -; RUN: grep "ret i1 false" +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; RUN: opt < %s -instcombine -S | FileCheck %s + +; Eliminating the casts in this testcase (by narrowing the AND operation) +; allows instcombine to realize the function always returns false. -; test1 - Eliminating the casts in this testcase (by narrowing the AND -; operation) allows instcombine to realize the function always returns false. -; define i1 @test1(i32 %A, i32 %B) { - %C1 = icmp slt i32 %A, %B ; [#uses=1] - %ELIM1 = zext i1 %C1 to i32 ; [#uses=1] - %C2 = icmp sgt i32 %A, %B ; [#uses=1] - %ELIM2 = zext i1 %C2 to i32 ; [#uses=1] - %C3 = and i32 %ELIM1, %ELIM2 ; [#uses=1] - %ELIM3 = trunc i32 %C3 to i1 ; [#uses=1] - ret i1 %ELIM3 +; CHECK-LABEL: @test1( +; CHECK-NEXT: ret i1 false +; + %C1 = icmp slt i32 %A, %B + %ELIM1 = zext i1 %C1 to i32 + %C2 = icmp sgt i32 %A, %B + %ELIM2 = zext i1 %C2 to i32 + %C3 = and i32 %ELIM1, %ELIM2 + %ELIM3 = trunc i32 %C3 to i1 + ret i1 %ELIM3 }