[InstCombine] avoid conflict between CHECK prefix and value name in test file; NFC

Tests can fail if a value name (%sqrt becomes SQRT) and that is the same as the RUN prefix.
This commit is contained in:
Sanjay Patel 2022-07-05 13:35:47 -04:00
parent a0468a56f0
commit 1562b1dcb9
1 changed files with 31 additions and 4 deletions

View File

@ -1,8 +1,8 @@
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt -passes=instcombine -S < %s -mtriple unknown | FileCheck %s --check-prefixes=CHECK,CHECKI32,SQRT
; RUN: opt -passes=instcombine -S < %s -mtriple unknown -disable-builtin sqrt | FileCheck %s --check-prefixes=CHECK,CHECKI32,NOSQRT
; RUN: opt -passes=instcombine -S < %s -mtriple msp430 | FileCheck %s --check-prefixes=CHECK,CHECKI16,SQRT
; RUN: opt -passes=instcombine -S < %s -mtriple msp430 -disable-builtin sqrt | FileCheck %s --check-prefixes=CHECK,CHECKI16,NOSQRT
; RUN: opt -passes=instcombine -S < %s -mtriple unknown | FileCheck %s --check-prefixes=CHECK,CHECKI32,CHECKSQRT
; RUN: opt -passes=instcombine -S < %s -mtriple unknown -disable-builtin sqrt | FileCheck %s --check-prefixes=CHECK,CHECKI32,CHECKNOSQRT
; RUN: opt -passes=instcombine -S < %s -mtriple msp430 | FileCheck %s --check-prefixes=CHECK,CHECKI16,CHECKSQRT
; RUN: opt -passes=instcombine -S < %s -mtriple msp430 -disable-builtin sqrt | FileCheck %s --check-prefixes=CHECK,CHECKI16,CHECKNOSQRT
declare double @llvm.pow.f64(double, double)
declare float @llvm.pow.f32(float, float)
@ -172,6 +172,19 @@ define double @test_simplify_16_5_libcall(double %x) {
; NOSQRT-LABEL: @test_simplify_16_5_libcall(
; NOSQRT-NEXT: [[TMP1:%.*]] = call fast double @pow(double [[X:%.*]], double 1.650000e+01)
; NOSQRT-NEXT: ret double [[TMP1]]
;
; CHECKSQRT-LABEL: @test_simplify_16_5_libcall(
; CHECKSQRT-NEXT: [[SQRT:%.*]] = call fast double @sqrt(double [[X:%.*]])
; CHECKSQRT-NEXT: [[SQUARE:%.*]] = fmul fast double [[X]], [[X]]
; CHECKSQRT-NEXT: [[TMP1:%.*]] = fmul fast double [[SQUARE]], [[SQUARE]]
; CHECKSQRT-NEXT: [[TMP2:%.*]] = fmul fast double [[TMP1]], [[TMP1]]
; CHECKSQRT-NEXT: [[TMP3:%.*]] = fmul fast double [[TMP2]], [[TMP2]]
; CHECKSQRT-NEXT: [[TMP4:%.*]] = fmul fast double [[TMP3]], [[SQRT]]
; CHECKSQRT-NEXT: ret double [[TMP4]]
;
; CHECKNOSQRT-LABEL: @test_simplify_16_5_libcall(
; CHECKNOSQRT-NEXT: [[TMP1:%.*]] = call fast double @pow(double [[X:%.*]], double 1.650000e+01)
; CHECKNOSQRT-NEXT: ret double [[TMP1]]
;
%1 = call fast double @pow(double %x, double 1.650000e+01)
ret double %1
@ -193,6 +206,20 @@ define double @test_simplify_neg_16_5_libcall(double %x) {
; NOSQRT-LABEL: @test_simplify_neg_16_5_libcall(
; NOSQRT-NEXT: [[TMP1:%.*]] = call fast double @pow(double [[X:%.*]], double -1.650000e+01)
; NOSQRT-NEXT: ret double [[TMP1]]
;
; CHECKSQRT-LABEL: @test_simplify_neg_16_5_libcall(
; CHECKSQRT-NEXT: [[SQRT:%.*]] = call fast double @sqrt(double [[X:%.*]])
; CHECKSQRT-NEXT: [[SQUARE:%.*]] = fmul fast double [[X]], [[X]]
; CHECKSQRT-NEXT: [[TMP1:%.*]] = fmul fast double [[SQUARE]], [[SQUARE]]
; CHECKSQRT-NEXT: [[TMP2:%.*]] = fmul fast double [[TMP1]], [[TMP1]]
; CHECKSQRT-NEXT: [[TMP3:%.*]] = fmul fast double [[TMP2]], [[TMP2]]
; CHECKSQRT-NEXT: [[TMP4:%.*]] = fmul fast double [[TMP3]], [[SQRT]]
; CHECKSQRT-NEXT: [[RECIPROCAL:%.*]] = fdiv fast double 1.000000e+00, [[TMP4]]
; CHECKSQRT-NEXT: ret double [[RECIPROCAL]]
;
; CHECKNOSQRT-LABEL: @test_simplify_neg_16_5_libcall(
; CHECKNOSQRT-NEXT: [[TMP1:%.*]] = call fast double @pow(double [[X:%.*]], double -1.650000e+01)
; CHECKNOSQRT-NEXT: ret double [[TMP1]]
;
%1 = call fast double @pow(double %x, double -1.650000e+01)
ret double %1