[llvm] [InstCombine] Fold (mul (shl X, C), Y) -> (shl (mul X, Y), C) when the shift has one use (PR #95466)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 15 08:21:14 PDT 2024
https://github.com/AtariDreams updated https://github.com/llvm/llvm-project/pull/95466
>From e44de14e749161e7f6a56038bbe129a3f48dd17d Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Thu, 13 Jun 2024 13:05:20 -0400
Subject: [PATCH 1/3] Pre-commit test (NFC)
---
llvm/test/Transforms/InstCombine/mul.ll | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/llvm/test/Transforms/InstCombine/mul.ll b/llvm/test/Transforms/InstCombine/mul.ll
index 66455479feaaa..b068e966e4b21 100644
--- a/llvm/test/Transforms/InstCombine/mul.ll
+++ b/llvm/test/Transforms/InstCombine/mul.ll
@@ -2201,3 +2201,14 @@ define i8 @mul_not_nsw_nonneg(i8 %x, i8 %y) {
%mul = mul i8 %x, %y
ret i8 %mul
}
+
+define <4 x i32> @combine_vec_mul_shl_oneuse0(<4 x i32> %x, <4 x i32> %y) {
+; CHECK-LABEL: @combine_vec_mul_shl_oneuse0(
+; CHECK-NEXT: [[TMP1:%.*]] = shl <4 x i32> [[X:%.*]], <i32 1, i32 2, i32 8, i32 16>
+; CHECK-NEXT: [[TMP2:%.*]] = mul <4 x i32> [[TMP1]], [[Y:%.*]]
+; CHECK-NEXT: ret <4 x i32> [[TMP2]]
+;
+ %1 = shl <4 x i32> %x, <i32 1, i32 2, i32 8, i32 16>
+ %2 = mul <4 x i32> %1, %y
+ ret <4 x i32> %2
+}
>From 51275eaace72602ab7a71bc35382a8c616163afe Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Thu, 13 Jun 2024 13:00:57 -0400
Subject: [PATCH 2/3] [InstCombine] Fold (mul (shl X, C), Y) -> (shl (mul X,
Y), C) when the shift has one use
https://alive2.llvm.org/ce/z/F-eKTV
---
.../InstCombine/InstCombineMulDivRem.cpp | 30 ++++++++++-
llvm/test/Transforms/InstCombine/mul.ll | 51 +++++++++----------
2 files changed, 54 insertions(+), 27 deletions(-)
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index ca1b1921404d8..c48020f5a8d9d 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -220,7 +220,7 @@ Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
// Also allow combining multiply instructions on vectors.
{
- Value *NewOp;
+ Value *NewOp, *NewOp2;
Constant *C1, *C2;
const APInt *IVal;
if (match(&I, m_Mul(m_Shl(m_Value(NewOp), m_Constant(C2)),
@@ -253,6 +253,34 @@ Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
return Shl;
}
}
+
+ // (mul (shl X, C), Y) -> (shl (mul X, Y), C)
+ if (match(Op0, m_OneUse(m_Shl(m_Value(NewOp), m_Value(NewOp2))))) {
+ OverflowingBinaryOperator *Op0BO = cast<OverflowingBinaryOperator>(Op0);
+ bool AllHaveNUW = HasNUW && Op0BO->hasNoUnsignedWrap();
+ bool AllHaveNSW = HasNSW && Op0BO->hasNoSignedWrap();
+ Value *Mul = Builder.CreateMul(Op1, NewOp, "", AllHaveNUW, AllHaveNSW);
+ BinaryOperator *BO = BinaryOperator::CreateShl(Mul, NewOp2);
+ if (AllHaveNUW)
+ BO->setHasNoUnsignedWrap();
+ if (AllHaveNSW)
+ BO->setHasNoSignedWrap();
+ return BO;
+ }
+
+ // (mul Y, (shl X, C)) -> (shl (mul X, Y), C)
+ if (match(Op1, m_OneUse(m_Shl(m_Value(NewOp), m_Value(NewOp2))))) {
+ OverflowingBinaryOperator *Op1BO = cast<OverflowingBinaryOperator>(Op1);
+ bool AllHaveNUW = HasNUW && Op1BO->hasNoUnsignedWrap();
+ bool AllHaveNSW = HasNSW && Op1BO->hasNoSignedWrap();
+ Value *Mul = Builder.CreateMul(Op0, NewOp, "", AllHaveNUW, AllHaveNSW);
+ BinaryOperator *BO = BinaryOperator::CreateShl(Mul, NewOp2);
+ if (AllHaveNUW)
+ BO->setHasNoUnsignedWrap();
+ if (AllHaveNSW)
+ BO->setHasNoSignedWrap();
+ return BO;
+ }
}
if (Op0->hasOneUse() && match(Op1, m_NegatedPower2())) {
diff --git a/llvm/test/Transforms/InstCombine/mul.ll b/llvm/test/Transforms/InstCombine/mul.ll
index b068e966e4b21..80ea0e5a229ea 100644
--- a/llvm/test/Transforms/InstCombine/mul.ll
+++ b/llvm/test/Transforms/InstCombine/mul.ll
@@ -87,8 +87,8 @@ define i32 @test12(i32 %a, i32 %b) {
; rdar://7293527
define i32 @shl1(i32 %a, i32 %b) {
; CHECK-LABEL: @shl1(
-; CHECK-NEXT: [[M1:%.*]] = shl i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret i32 [[M1]]
+; CHECK-NEXT: [[M:%.*]] = shl i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret i32 [[M]]
;
%shl = shl i32 1, %b
%m = mul i32 %shl, %a
@@ -97,8 +97,8 @@ define i32 @shl1(i32 %a, i32 %b) {
define i32 @shl1_nsw_nsw(i32 %A, i32 %B) {
; CHECK-LABEL: @shl1_nsw_nsw(
-; CHECK-NEXT: [[D1:%.*]] = shl nsw i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret i32 [[D1]]
+; CHECK-NEXT: [[D:%.*]] = shl nsw i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret i32 [[D]]
;
%shl = shl nsw i32 1, %B
%D = mul nsw i32 %A, %shl
@@ -107,8 +107,8 @@ define i32 @shl1_nsw_nsw(i32 %A, i32 %B) {
define <2 x i32> @shl1_nsw_nsw_commute(<2 x i32> %A, <2 x i32> %B) {
; CHECK-LABEL: @shl1_nsw_nsw_commute(
-; CHECK-NEXT: [[D1:%.*]] = shl nsw <2 x i32> [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret <2 x i32> [[D1]]
+; CHECK-NEXT: [[D:%.*]] = shl nsw <2 x i32> [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret <2 x i32> [[D]]
;
%shl = shl nsw <2 x i32> <i32 1, i32 poison>, %B
%D = mul nsw <2 x i32> %shl, %A
@@ -117,8 +117,8 @@ define <2 x i32> @shl1_nsw_nsw_commute(<2 x i32> %A, <2 x i32> %B) {
define i32 @shl1_nuw(i32 %A, i32 %B) {
; CHECK-LABEL: @shl1_nuw(
-; CHECK-NEXT: [[D1:%.*]] = shl nuw i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret i32 [[D1]]
+; CHECK-NEXT: [[D:%.*]] = shl nuw i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret i32 [[D]]
;
%shl = shl i32 1, %B
%D = mul nuw i32 %A, %shl
@@ -127,8 +127,8 @@ define i32 @shl1_nuw(i32 %A, i32 %B) {
define i32 @shl1_nuw_commute(i32 %A, i32 %B) {
; CHECK-LABEL: @shl1_nuw_commute(
-; CHECK-NEXT: [[D1:%.*]] = shl i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret i32 [[D1]]
+; CHECK-NEXT: [[D:%.*]] = shl i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret i32 [[D]]
;
%shl = shl nuw i32 1, %B
%D = mul i32 %shl, %A
@@ -1001,8 +1001,7 @@ define <2 x i32> @PR57278_shl_vec(<2 x i32> %v1) {
; TODO: vector with poison should also be supported, https://alive2.llvm.org/ce/z/XYpv9q
define <2 x i32> @PR57278_shl_vec_poison(<2 x i32> %v1) {
; CHECK-LABEL: @PR57278_shl_vec_poison(
-; CHECK-NEXT: [[SHL:%.*]] = shl nuw <2 x i32> [[V1:%.*]], <i32 2, i32 poison>
-; CHECK-NEXT: [[TMP1:%.*]] = mul nuw <2 x i32> [[SHL]], <i32 3, i32 poison>
+; CHECK-NEXT: [[TMP1:%.*]] = mul <2 x i32> [[V1:%.*]], <i32 12, i32 poison>
; CHECK-NEXT: [[MUL:%.*]] = add nuw <2 x i32> [[TMP1]], <i32 9, i32 poison>
; CHECK-NEXT: ret <2 x i32> [[MUL]]
;
@@ -1154,8 +1153,8 @@ define i32 @test31(i32 %V) {
; CHECK-LABEL: @test31(
; CHECK-NEXT: [[CMP:%.*]] = icmp ne ptr inttoptr (i64 1 to ptr), @PR22087
; CHECK-NEXT: [[EXT:%.*]] = zext i1 [[CMP]] to i32
-; CHECK-NEXT: [[MUL1:%.*]] = shl i32 [[V:%.*]], [[EXT]]
-; CHECK-NEXT: ret i32 [[MUL1]]
+; CHECK-NEXT: [[MUL:%.*]] = shl i32 [[V:%.*]], [[EXT]]
+; CHECK-NEXT: ret i32 [[MUL]]
;
%cmp = icmp ne ptr inttoptr (i64 1 to ptr), @PR22087
%ext = zext i1 %cmp to i32
@@ -1340,8 +1339,8 @@ define i32 @mul_nsw_mul_nsw_neg_onearg(i32 %x) {
define i32 @mul_nsw_shl_nsw_neg(i32 %x, i32 %y) {
; CHECK-LABEL: @mul_nsw_shl_nsw_neg(
-; CHECK-NEXT: [[SHL_NEG:%.*]] = shl i32 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[SHL_NEG]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X:%.*]], [[X]]
+; CHECK-NEXT: [[MUL:%.*]] = shl nsw i32 [[TMP1]], [[Y:%.*]]
; CHECK-NEXT: ret i32 [[MUL]]
;
%neg = sub i32 0, %x
@@ -1352,8 +1351,8 @@ define i32 @mul_nsw_shl_nsw_neg(i32 %x, i32 %y) {
define i32 @mul_shl_nsw_neg(i32 %x,i32 %y) {
; CHECK-LABEL: @mul_shl_nsw_neg(
-; CHECK-NEXT: [[SHL_NEG:%.*]] = shl i32 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[SHL_NEG]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X:%.*]], [[X]]
+; CHECK-NEXT: [[MUL:%.*]] = shl i32 [[TMP1]], [[Y:%.*]]
; CHECK-NEXT: ret i32 [[MUL]]
;
%neg = sub i32 0, %x
@@ -1364,8 +1363,8 @@ define i32 @mul_shl_nsw_neg(i32 %x,i32 %y) {
define i32 @mul_nsw_shl_neg(i32 %x,i32 %y) {
; CHECK-LABEL: @mul_nsw_shl_neg(
-; CHECK-NEXT: [[SHL_NEG:%.*]] = shl i32 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[SHL_NEG]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X:%.*]], [[X]]
+; CHECK-NEXT: [[MUL:%.*]] = shl i32 [[TMP1]], [[Y:%.*]]
; CHECK-NEXT: ret i32 [[MUL]]
;
%neg = sub i32 0, %x
@@ -1376,8 +1375,8 @@ define i32 @mul_nsw_shl_neg(i32 %x,i32 %y) {
define i32 @mul_nsw_shl_neg_onearg(i32 %x) {
; CHECK-LABEL: @mul_nsw_shl_neg_onearg(
-; CHECK-NEXT: [[SHL_NEG:%.*]] = shl i32 [[X:%.*]], [[X]]
-; CHECK-NEXT: [[MUL:%.*]] = mul i32 [[SHL_NEG]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X:%.*]], [[X]]
+; CHECK-NEXT: [[MUL:%.*]] = shl i32 [[TMP1]], [[X]]
; CHECK-NEXT: ret i32 [[MUL]]
;
%neg = sub i32 0, %x
@@ -1388,8 +1387,8 @@ define i32 @mul_nsw_shl_neg_onearg(i32 %x) {
define i8 @mul_shl_nsw_neg_onearg(i8 %x) {
; CHECK-LABEL: @mul_shl_nsw_neg_onearg(
-; CHECK-NEXT: [[SHL_NEG:%.*]] = shl i8 [[X:%.*]], [[X]]
-; CHECK-NEXT: [[MUL:%.*]] = mul i8 [[SHL_NEG]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i8 [[X:%.*]], [[X]]
+; CHECK-NEXT: [[MUL:%.*]] = shl i8 [[TMP1]], [[X]]
; CHECK-NEXT: ret i8 [[MUL]]
;
%neg = sub i8 0, %x
@@ -2204,8 +2203,8 @@ define i8 @mul_not_nsw_nonneg(i8 %x, i8 %y) {
define <4 x i32> @combine_vec_mul_shl_oneuse0(<4 x i32> %x, <4 x i32> %y) {
; CHECK-LABEL: @combine_vec_mul_shl_oneuse0(
-; CHECK-NEXT: [[TMP1:%.*]] = shl <4 x i32> [[X:%.*]], <i32 1, i32 2, i32 8, i32 16>
-; CHECK-NEXT: [[TMP2:%.*]] = mul <4 x i32> [[TMP1]], [[Y:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul <4 x i32> [[Y:%.*]], [[X:%.*]]
+; CHECK-NEXT: [[TMP2:%.*]] = shl <4 x i32> [[TMP1]], <i32 1, i32 2, i32 8, i32 16>
; CHECK-NEXT: ret <4 x i32> [[TMP2]]
;
%1 = shl <4 x i32> %x, <i32 1, i32 2, i32 8, i32 16>
>From 18e0a532bea4bbed025ae45897a859997babeb65 Mon Sep 17 00:00:00 2001
From: Rose <gfunni234 at gmail.com>
Date: Sat, 15 Jun 2024 11:20:58 -0400
Subject: [PATCH 3/3] b
---
llvm/test/Transforms/InstCombine/add.ll | 90 +--
.../test/Transforms/InstCombine/align-addr.ll | 8 +-
llvm/test/Transforms/InstCombine/and2.ll | 20 +-
.../InstCombine/apint-and-compare.ll | 17 +-
.../InstCombine/apint-and-or-and.ll | 41 +-
llvm/test/Transforms/InstCombine/apint-and.ll | 8 +-
.../InstCombine/apint-cast-and-cast.ll | 5 +-
.../InstCombine/apint-cast-cast-to-and.ll | 7 +-
.../test/Transforms/InstCombine/apint-div1.ll | 17 +-
.../test/Transforms/InstCombine/apint-div2.ll | 17 +-
llvm/test/Transforms/InstCombine/apint-not.ll | 13 +-
.../test/Transforms/InstCombine/apint-rem1.ll | 17 +-
.../test/Transforms/InstCombine/apint-rem2.ll | 17 +-
.../InstCombine/apint-shift-simplify.ll | 55 +-
.../Transforms/InstCombine/apint-shift.ll | 14 +-
.../test/Transforms/InstCombine/apint-xor1.ll | 41 +-
.../test/Transforms/InstCombine/apint-xor2.ll | 41 +-
.../test/Transforms/InstCombine/bswap-fold.ll | 18 +-
.../InstCombine/dbg-simplify-alloca-size.ll | 27 +-
.../Transforms/InstCombine/dce-iterate.ll | 37 +-
llvm/test/Transforms/InstCombine/deadcode.ll | 21 +-
.../test/Transforms/InstCombine/debug-line.ll | 18 +-
.../Transforms/InstCombine/debuginfo-dce.ll | 81 ++-
.../Transforms/InstCombine/debuginfo-dce2.ll | 36 +-
.../debuginfo-scalable-typesize.ll | 23 +-
.../Transforms/InstCombine/debuginfo-sink.ll | 87 ++-
.../Transforms/InstCombine/debuginfo-skip.ll | 8 +-
.../InstCombine/debuginfo-variables.ll | 215 +++++--
llvm/test/Transforms/InstCombine/debuginfo.ll | 53 +-
.../Transforms/InstCombine/debuginfo_add.ll | 75 ++-
.../InstCombine/default-alignment.ll | 1 +
llvm/test/Transforms/InstCombine/demorgan.ll | 4 +-
.../Transforms/InstCombine/deref-alloc-fns.ll | 30 +-
.../Transforms/InstCombine/disable-builtin.ll | 8 +-
.../InstCombine/disable-simplify-libcalls.ll | 253 +++++---
.../test/Transforms/InstCombine/distribute.ll | 10 +-
.../Transforms/InstCombine/div-shift-crash.ll | 1 +
.../InstCombine/double-float-shrink-1.ll | 609 ++++++++++++++----
.../InstCombine/double-float-shrink-2.ll | 432 +++++++++++++
.../InstCombine/early_constfold_changes_IR.ll | 8 +-
.../early_dce_clobbers_callgraph.ll | 6 +-
.../InstCombine/enforce-known-alignment.ll | 37 +-
.../erase-dbg-values-at-dead-alloc-site.ll | 26 +-
.../Transforms/InstCombine/err-rep-cold.ll | 48 +-
.../Transforms/InstCombine/extractelement.ll | 7 +-
.../InstCombine/extractinsert-tbaa.ll | 68 +-
.../InstCombine/gc.relocate-verify.ll | 17 +-
.../Transforms/InstCombine/gc.relocate.ll | 71 +-
llvm/test/Transforms/InstCombine/gep-alias.ll | 9 +-
...-can-replace-gep-idx-with-zero-typesize.ll | 1 +
llvm/test/Transforms/InstCombine/gep-sext.ll | 54 +-
.../Transforms/InstCombine/gepofconstgepi8.ll | 4 +-
llvm/test/Transforms/InstCombine/gepphigep.ll | 4 +-
.../InstCombine/getelementptr-folding.ll | 4 +-
.../Transforms/InstCombine/icmp-and-shift.ll | 8 +-
.../InstCombine/icmp-bitcast-glob.ll | 19 +-
.../InstCombine/icmp-fold-into-phi.ll | 4 +-
llvm/test/Transforms/InstCombine/icmp-gep.ll | 16 +-
.../Transforms/InstCombine/icmp-logical.ll | 6 +-
.../Transforms/InstCombine/icmp-mul-and.ll | 4 +-
.../Transforms/InstCombine/icmp-mul-zext.ll | 8 +-
.../test/Transforms/InstCombine/icmp-range.ll | 26 +-
.../icmp-select-implies-common-op.ll | 20 +-
.../Transforms/InstCombine/icmp-uadd-sat.ll | 80 +--
.../malloc-free-delete-dbginvar.ll | 1 +
.../InstCombine/masked-merge-xor.ll | 24 +-
llvm/test/Transforms/InstCombine/memcmp-1.ll | 53 +-
llvm/test/Transforms/InstCombine/memcmp-2.ll | 9 +-
llvm/test/Transforms/InstCombine/memcpy-2.ll | 6 +-
.../Transforms/InstCombine/memcpy_chk-2.ll | 7 +-
llvm/test/Transforms/InstCombine/memmove-1.ll | 33 +-
llvm/test/Transforms/InstCombine/memmove-2.ll | 9 +-
.../Transforms/InstCombine/memmove_chk-2.ll | 7 +-
.../Transforms/InstCombine/memset_chk-2.ll | 7 +-
.../Transforms/InstCombine/minmax-fold.ll | 8 +-
.../InstCombine/minmax-intrinsics.ll | 24 +-
.../InstCombine/mul-inseltpoison.ll | 16 +-
.../Transforms/InstCombine/mul-min-max.ll | 4 +-
llvm/test/Transforms/InstCombine/mul-pow2.ll | 12 +-
llvm/test/Transforms/InstCombine/mul_fold.ll | 2 +-
.../Transforms/InstCombine/multi-use-or.ll | 31 +-
.../Transforms/InstCombine/musttail-thunk.ll | 25 +-
.../InstCombine/object-size-opaque.ll | 8 +-
.../test/Transforms/InstCombine/objsize-64.ll | 4 +-
.../InstCombine/objsize-address-space.ll | 43 +-
.../Transforms/InstCombine/odr-linkage.ll | 5 +-
llvm/test/Transforms/InstCombine/opaque.ll | 1 +
llvm/test/Transforms/InstCombine/or.ll | 14 +-
llvm/test/Transforms/InstCombine/osx-names.ll | 11 +-
llvm/test/Transforms/InstCombine/sadd_sat.ll | 36 +-
.../InstCombine/salvage-dbg-declare.ll | 34 +-
.../scalable-bitcast-inseltpoison.ll | 11 +-
.../InstCombine/scalable-bitcast.ll | 11 +-
.../InstCombine/scalable-const-fp-splat.ll | 9 +-
.../Transforms/InstCombine/scalarization.ll | 4 +-
llvm/test/Transforms/InstCombine/sdiv-2.ll | 29 +-
.../InstCombine/sdiv-exact-by-power-of-two.ll | 4 +-
.../Transforms/InstCombine/select-crash.ll | 32 +-
.../InstCombine/select-ctlz-to-cttz.ll | 4 +-
.../InstCombine/select-load-call.ll | 1 +
.../Transforms/InstCombine/select-select.ll | 6 +-
.../InstCombine/setcc-strength-reduce.ll | 23 +-
.../InstCombine/shift-by-signext.ll | 8 +-
.../test/Transforms/InstCombine/shl-demand.ll | 12 +-
.../signmask-of-sext-vs-of-shl-of-zext.ll | 8 +-
.../InstCombine/simple_phi_condition.ll | 60 +-
.../simplify-demanded-bits-pointer.ll | 81 +--
.../InstCombine/simplify-libcalls-inreg.ll | 31 +-
.../InstCombine/simplify-libcalls-new.ll | 220 +++++--
.../Transforms/InstCombine/sink-alloca.ll | 31 +-
...ion-introduces-unnecessary-poison-value.ll | 12 +-
.../InstCombine/sink-into-catchswitch.ll | 4 +-
.../InstCombine/sink-into-resume-block.ll | 4 +-
.../InstCombine/sink-not-into-logical-and.ll | 4 +-
.../InstCombine/sink_instruction.ll | 8 +-
llvm/test/Transforms/InstCombine/sitofp.ll | 4 +-
.../InstCombine/srem-simplify-bug.ll | 1 +
llvm/test/Transforms/InstCombine/srem1.ll | 17 +-
.../Transforms/InstCombine/stack-overalign.ll | 1 +
.../InstCombine/stacksaverestore.ll | 168 +++--
.../InstCombine/statepoint-cleanup.ll | 12 +-
.../test/Transforms/InstCombine/statepoint.ll | 16 +-
.../InstCombine/stdiocall-bad-sig.ll | 22 +-
.../InstCombine/store-load-unaliased-gep.ll | 10 +-
.../Transforms/InstCombine/storemerge-dbg.ll | 41 +-
llvm/test/Transforms/InstCombine/stpcpy-2.ll | 7 +-
.../Transforms/InstCombine/stpcpy_chk-2.ll | 7 +-
llvm/test/Transforms/InstCombine/strcat-1.ll | 13 +-
llvm/test/Transforms/InstCombine/strcat-2.ll | 15 +-
llvm/test/Transforms/InstCombine/strcat-3.ll | 8 +-
llvm/test/Transforms/InstCombine/strchr-2.ll | 9 +-
llvm/test/Transforms/InstCombine/strcmp-2.ll | 8 +-
llvm/test/Transforms/InstCombine/strcpy-2.ll | 7 +-
.../Transforms/InstCombine/strcpy_chk-2.ll | 7 +-
llvm/test/Transforms/InstCombine/strcspn-2.ll | 9 +-
.../test/Transforms/InstCombine/strlen_chk.ll | 35 +-
llvm/test/Transforms/InstCombine/strncat-1.ll | 13 +-
llvm/test/Transforms/InstCombine/strncat-3.ll | 4 +-
.../InstCombine/strncmp-wrong-datalayout.ll | 8 +-
llvm/test/Transforms/InstCombine/strncpy-2.ll | 4 +-
.../Transforms/InstCombine/strncpy_chk-2.ll | 7 +-
llvm/test/Transforms/InstCombine/strpbrk-2.ll | 8 +-
llvm/test/Transforms/InstCombine/strrchr-2.ll | 9 +-
llvm/test/Transforms/InstCombine/strspn-1.ll | 26 +-
llvm/test/Transforms/InstCombine/strstr-2.ll | 9 +-
llvm/test/Transforms/InstCombine/strto-1.ll | 64 +-
.../InstCombine/struct-assign-tbaa-new.ll | 10 +-
.../InstCombine/struct-assign-tbaa.ll | 9 +-
llvm/test/Transforms/InstCombine/sub-gep.ll | 4 +-
.../InstCombine/switch-constant-expr.ll | 4 +-
.../InstCombine/switch-truncate-crash.ll | 1 +
151 files changed, 3288 insertions(+), 1390 deletions(-)
diff --git a/llvm/test/Transforms/InstCombine/add.ll b/llvm/test/Transforms/InstCombine/add.ll
index 239e14682c306..18ebe14be30dd 100644
--- a/llvm/test/Transforms/InstCombine/add.ll
+++ b/llvm/test/Transforms/InstCombine/add.ll
@@ -3356,8 +3356,12 @@ define i32 @add_reduce_sqr_sum_flipped3(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order2(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order2(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
+; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
+; CHECK-NEXT: [[TWOAB_B2:%.*]] = add i32 [[TWOAB]], [[B_SQ]]
+; CHECK-NEXT: [[AB2:%.*]] = add i32 [[A_SQ]], [[TWOAB_B2]]
; CHECK-NEXT: ret i32 [[AB2]]
;
%a_sq = mul nsw i32 %a, %a
@@ -3371,8 +3375,12 @@ define i32 @add_reduce_sqr_sum_order2(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order2_flipped(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order2_flipped(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
+; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
+; CHECK-NEXT: [[TWOAB_B2:%.*]] = add i32 [[TWOAB]], [[B_SQ]]
+; CHECK-NEXT: [[AB2:%.*]] = add i32 [[TWOAB_B2]], [[A_SQ]]
; CHECK-NEXT: ret i32 [[AB2]]
;
%a_sq = mul nsw i32 %a, %a
@@ -3387,8 +3395,12 @@ define i32 @add_reduce_sqr_sum_order2_flipped(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order2_flipped2(i32 %a, i32 %bx) {
; CHECK-LABEL: @add_reduce_sqr_sum_order2_flipped2(
; CHECK-NEXT: [[B:%.*]] = xor i32 [[BX:%.*]], 42
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B]], [[A:%.*]]
-; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
+; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
+; CHECK-NEXT: [[TWOAB_B2:%.*]] = add i32 [[B_SQ]], [[TWOAB]]
+; CHECK-NEXT: [[AB2:%.*]] = add i32 [[A_SQ]], [[TWOAB_B2]]
; CHECK-NEXT: ret i32 [[AB2]]
;
%b = xor i32 %bx, 42 ; thwart complexity-based canonicalization
@@ -3404,8 +3416,12 @@ define i32 @add_reduce_sqr_sum_order2_flipped2(i32 %a, i32 %bx) {
define i32 @add_reduce_sqr_sum_order2_flipped3(i32 %a, i32 %bx) {
; CHECK-LABEL: @add_reduce_sqr_sum_order2_flipped3(
; CHECK-NEXT: [[B:%.*]] = xor i32 [[BX:%.*]], 42
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B]], [[A:%.*]]
-; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
+; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
+; CHECK-NEXT: [[TWOAB_B2:%.*]] = add i32 [[TWOAB]], [[B_SQ]]
+; CHECK-NEXT: [[AB2:%.*]] = add i32 [[A_SQ]], [[TWOAB_B2]]
; CHECK-NEXT: ret i32 [[AB2]]
;
%b = xor i32 %bx, 42 ; thwart complexity-based canonicalization
@@ -3420,7 +3436,7 @@ define i32 @add_reduce_sqr_sum_order2_flipped3(i32 %a, i32 %bx) {
define i32 @add_reduce_sqr_sum_order3(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order3(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3435,7 +3451,7 @@ define i32 @add_reduce_sqr_sum_order3(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order3_flipped(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order3_flipped(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3450,7 +3466,7 @@ define i32 @add_reduce_sqr_sum_order3_flipped(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order3_flipped2(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order3_flipped2(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3465,7 +3481,7 @@ define i32 @add_reduce_sqr_sum_order3_flipped2(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order3_flipped3(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order3_flipped3(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3555,7 +3571,7 @@ define i32 @add_reduce_sqr_sum_order4_flipped4(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order5(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order5(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3570,7 +3586,7 @@ define i32 @add_reduce_sqr_sum_order5(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order5_flipped(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order5_flipped(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3585,7 +3601,7 @@ define i32 @add_reduce_sqr_sum_order5_flipped(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order5_flipped2(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order5_flipped2(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3617,7 +3633,7 @@ define i32 @add_reduce_sqr_sum_order5_flipped3(i32 %ax, i32 %b) {
define i32 @add_reduce_sqr_sum_order5_flipped4(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order5_flipped4(
-; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[B:%.*]], [[A:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = add i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: [[AB2:%.*]] = mul i32 [[TMP1]], [[TMP1]]
; CHECK-NEXT: ret i32 [[AB2]]
;
@@ -3671,9 +3687,10 @@ define i32 @add_reduce_sqr_sum_not_one_use2(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order2_not_one_use(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order2_not_one_use(
; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
-; CHECK-NEXT: [[TWOA:%.*]] = shl i32 [[A]], 1
-; CHECK-NEXT: [[TWOAB1:%.*]] = add i32 [[TWOA]], [[B:%.*]]
-; CHECK-NEXT: [[TWOAB_B2:%.*]] = mul i32 [[TWOAB1]], [[B]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
+; CHECK-NEXT: [[TWOAB_B2:%.*]] = add i32 [[TWOAB]], [[B_SQ]]
; CHECK-NEXT: tail call void @fake_func(i32 [[TWOAB_B2]])
; CHECK-NEXT: [[AB2:%.*]] = add i32 [[A_SQ]], [[TWOAB_B2]]
; CHECK-NEXT: ret i32 [[AB2]]
@@ -3691,9 +3708,10 @@ define i32 @add_reduce_sqr_sum_order2_not_one_use(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order2_not_one_use2(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order2_not_one_use2(
; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
-; CHECK-NEXT: [[TWOA:%.*]] = shl i32 [[A]], 1
-; CHECK-NEXT: [[TWOAB1:%.*]] = add i32 [[TWOA]], [[B:%.*]]
-; CHECK-NEXT: [[TWOAB_B2:%.*]] = mul i32 [[TWOAB1]], [[B]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
+; CHECK-NEXT: [[TWOAB_B2:%.*]] = add i32 [[TWOAB]], [[B_SQ]]
; CHECK-NEXT: tail call void @fake_func(i32 [[A_SQ]])
; CHECK-NEXT: [[AB2:%.*]] = add i32 [[A_SQ]], [[TWOAB_B2]]
; CHECK-NEXT: ret i32 [[AB2]]
@@ -3711,8 +3729,8 @@ define i32 @add_reduce_sqr_sum_order2_not_one_use2(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order3_not_one_use(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order3_not_one_use(
; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
-; CHECK-NEXT: [[TWOA:%.*]] = shl i32 [[A]], 1
-; CHECK-NEXT: [[TWOAB:%.*]] = mul i32 [[TWOA]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
; CHECK-NEXT: [[A2_B2:%.*]] = add i32 [[A_SQ]], [[B_SQ]]
; CHECK-NEXT: tail call void @fake_func(i32 [[TWOAB]])
@@ -3732,8 +3750,8 @@ define i32 @add_reduce_sqr_sum_order3_not_one_use(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order3_not_one_use2(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order3_not_one_use2(
; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
-; CHECK-NEXT: [[TWOA:%.*]] = shl i32 [[A]], 1
-; CHECK-NEXT: [[TWOAB:%.*]] = mul i32 [[TWOA]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[A]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
; CHECK-NEXT: [[A2_B2:%.*]] = add i32 [[A_SQ]], [[B_SQ]]
; CHECK-NEXT: tail call void @fake_func(i32 [[A2_B2]])
@@ -3795,8 +3813,8 @@ define i32 @add_reduce_sqr_sum_order4_not_one_use2(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order5_not_one_use(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order5_not_one_use(
; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
-; CHECK-NEXT: [[TWOB:%.*]] = shl i32 [[B:%.*]], 1
-; CHECK-NEXT: [[TWOAB:%.*]] = mul i32 [[TWOB]], [[A]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[A]], [[B:%.*]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
; CHECK-NEXT: [[A2_B2:%.*]] = add i32 [[A_SQ]], [[B_SQ]]
; CHECK-NEXT: tail call void @fake_func(i32 [[TWOAB]])
@@ -3816,8 +3834,8 @@ define i32 @add_reduce_sqr_sum_order5_not_one_use(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_order5_not_one_use2(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_order5_not_one_use2(
; CHECK-NEXT: [[A_SQ:%.*]] = mul nsw i32 [[A:%.*]], [[A]]
-; CHECK-NEXT: [[TWOB:%.*]] = shl i32 [[B:%.*]], 1
-; CHECK-NEXT: [[TWOAB:%.*]] = mul i32 [[TWOB]], [[A]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[A]], [[B:%.*]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
; CHECK-NEXT: [[A2_B2:%.*]] = add i32 [[A_SQ]], [[B_SQ]]
; CHECK-NEXT: tail call void @fake_func(i32 [[A2_B2]])
@@ -4009,8 +4027,8 @@ define i32 @add_reduce_sqr_sum_varB_invalid4(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_varC_invalid0(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_varC_invalid0(
-; CHECK-NEXT: [[NOT_TWOA:%.*]] = shl nsw i32 [[B:%.*]], 1
-; CHECK-NEXT: [[TWOAB:%.*]] = mul i32 [[NOT_TWOA]], [[B]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[B]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 1
; CHECK-NEXT: [[A_SQ:%.*]] = mul i32 [[A:%.*]], [[A]]
; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
; CHECK-NEXT: [[A2_B2:%.*]] = add i32 [[A_SQ]], [[B_SQ]]
@@ -4028,8 +4046,8 @@ define i32 @add_reduce_sqr_sum_varC_invalid0(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_varC_invalid1(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_varC_invalid1(
-; CHECK-NEXT: [[NOT_TWOA:%.*]] = shl nsw i32 [[A:%.*]], 2
-; CHECK-NEXT: [[TWOAB:%.*]] = mul i32 [[NOT_TWOA]], [[B:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[B:%.*]], [[A:%.*]]
+; CHECK-NEXT: [[TWOAB:%.*]] = shl i32 [[TMP1]], 2
; CHECK-NEXT: [[A_SQ:%.*]] = mul i32 [[A]], [[A]]
; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B]], [[B]]
; CHECK-NEXT: [[A2_B2:%.*]] = add i32 [[A_SQ]], [[B_SQ]]
@@ -4047,8 +4065,8 @@ define i32 @add_reduce_sqr_sum_varC_invalid1(i32 %a, i32 %b) {
define i32 @add_reduce_sqr_sum_varC_invalid2(i32 %a, i32 %b) {
; CHECK-LABEL: @add_reduce_sqr_sum_varC_invalid2(
-; CHECK-NEXT: [[TWOA:%.*]] = shl nsw i32 [[A:%.*]], 1
-; CHECK-NEXT: [[NOT_TWOAB:%.*]] = mul i32 [[TWOA]], [[A]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[A:%.*]], [[A]]
+; CHECK-NEXT: [[NOT_TWOAB:%.*]] = shl i32 [[TMP1]], 1
; CHECK-NEXT: [[A_SQ:%.*]] = mul i32 [[A]], [[A]]
; CHECK-NEXT: [[B_SQ:%.*]] = mul i32 [[B:%.*]], [[B]]
; CHECK-NEXT: [[A2_B2:%.*]] = add i32 [[A_SQ]], [[B_SQ]]
diff --git a/llvm/test/Transforms/InstCombine/align-addr.ll b/llvm/test/Transforms/InstCombine/align-addr.ll
index 58647dc9595d8..8374f3dc6bdb1 100644
--- a/llvm/test/Transforms/InstCombine/align-addr.ll
+++ b/llvm/test/Transforms/InstCombine/align-addr.ll
@@ -11,15 +11,15 @@ define void @test0(ptr %b, i64 %n, i64 %u, i64 %y) nounwind {
; CHECK-NEXT: [[C:%.*]] = ptrtoint ptr [[B:%.*]] to i64
; CHECK-NEXT: [[D:%.*]] = and i64 [[C]], -16
; CHECK-NEXT: [[E:%.*]] = inttoptr i64 [[D]] to ptr
-; CHECK-NEXT: [[V:%.*]] = shl i64 [[U:%.*]], 1
; CHECK-NEXT: [[Z:%.*]] = and i64 [[Y:%.*]], -2
; CHECK-NEXT: [[T1421:%.*]] = icmp eq i64 [[N:%.*]], 0
; CHECK-NEXT: br i1 [[T1421]], label [[RETURN:%.*]], label [[BB:%.*]]
; CHECK: bb:
; CHECK-NEXT: [[I:%.*]] = phi i64 [ [[INDVAR_NEXT:%.*]], [[BB]] ], [ 20, [[ENTRY:%.*]] ]
-; CHECK-NEXT: [[J:%.*]] = mul i64 [[I]], [[V]]
-; CHECK-NEXT: [[TMP0:%.*]] = getelementptr double, ptr [[E]], i64 [[J]]
-; CHECK-NEXT: [[T8:%.*]] = getelementptr double, ptr [[TMP0]], i64 [[Z]]
+; CHECK-NEXT: [[TMP0:%.*]] = mul i64 [[I]], [[U:%.*]]
+; CHECK-NEXT: [[J:%.*]] = shl i64 [[TMP0]], 1
+; CHECK-NEXT: [[TMP1:%.*]] = getelementptr double, ptr [[E]], i64 [[J]]
+; CHECK-NEXT: [[T8:%.*]] = getelementptr double, ptr [[TMP1]], i64 [[Z]]
; CHECK-NEXT: store <2 x double> zeroinitializer, ptr [[T8]], align 8
; CHECK-NEXT: [[INDVAR_NEXT]] = add i64 [[I]], 1
; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i64 [[INDVAR_NEXT]], [[N]]
diff --git a/llvm/test/Transforms/InstCombine/and2.ll b/llvm/test/Transforms/InstCombine/and2.ll
index 104486e7638f5..01cce5ea2bd19 100644
--- a/llvm/test/Transforms/InstCombine/and2.ll
+++ b/llvm/test/Transforms/InstCombine/and2.ll
@@ -217,8 +217,8 @@ define <2 x i8> @and1_lshr1_is_cmp_eq_0_vec(<2 x i8> %x) {
define <2 x i8> @and1_lshr1_is_cmp_eq_0_vec_poison(<2 x i8> %x) {
; CHECK-LABEL: @and1_lshr1_is_cmp_eq_0_vec_poison(
-; CHECK-NEXT: [[AND:%.*]] = lshr <2 x i8> <i8 1, i8 poison>, [[X:%.*]]
-; CHECK-NEXT: ret <2 x i8> [[AND]]
+; CHECK-NEXT: [[SH:%.*]] = lshr <2 x i8> <i8 1, i8 poison>, [[X:%.*]]
+; CHECK-NEXT: ret <2 x i8> [[SH]]
;
%sh = lshr <2 x i8> <i8 1, i8 poison>, %x
%and = and <2 x i8> %sh, <i8 1, i8 poison>
@@ -228,9 +228,9 @@ define <2 x i8> @and1_lshr1_is_cmp_eq_0_vec_poison(<2 x i8> %x) {
; The add in this test is unnecessary because the LSBs of the LHS are 0 and the 'and' only consumes bits from those LSBs. It doesn't matter what happens to the upper bits.
define i32 @test11(i32 %a, i32 %b) {
; CHECK-LABEL: @test11(
-; CHECK-NEXT: [[X:%.*]] = shl i32 [[A:%.*]], 8
; CHECK-NEXT: [[Z:%.*]] = and i32 [[B:%.*]], 128
-; CHECK-NEXT: [[W:%.*]] = mul i32 [[Z]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[Z]], [[A:%.*]]
+; CHECK-NEXT: [[W:%.*]] = shl i32 [[TMP1]], 8
; CHECK-NEXT: ret i32 [[W]]
;
%x = shl i32 %a, 8
@@ -243,9 +243,9 @@ define i32 @test11(i32 %a, i32 %b) {
; The add in this test is unnecessary because the LSBs of the RHS are 0 and the 'and' only consumes bits from those LSBs. It doesn't matter what happens to the upper bits.
define i32 @test12(i32 %a, i32 %b) {
; CHECK-LABEL: @test12(
-; CHECK-NEXT: [[X:%.*]] = shl i32 [[A:%.*]], 8
; CHECK-NEXT: [[Z:%.*]] = and i32 [[B:%.*]], 128
-; CHECK-NEXT: [[W:%.*]] = mul i32 [[Z]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[Z]], [[A:%.*]]
+; CHECK-NEXT: [[W:%.*]] = shl i32 [[TMP1]], 8
; CHECK-NEXT: ret i32 [[W]]
;
%x = shl i32 %a, 8
@@ -258,9 +258,9 @@ define i32 @test12(i32 %a, i32 %b) {
; The sub in this test is unnecessary because the LSBs of the RHS are 0 and the 'and' only consumes bits from those LSBs. It doesn't matter what happens to the upper bits.
define i32 @test13(i32 %a, i32 %b) {
; CHECK-LABEL: @test13(
-; CHECK-NEXT: [[X:%.*]] = shl i32 [[A:%.*]], 8
; CHECK-NEXT: [[Z:%.*]] = and i32 [[B:%.*]], 128
-; CHECK-NEXT: [[W:%.*]] = mul i32 [[Z]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[Z]], [[A:%.*]]
+; CHECK-NEXT: [[W:%.*]] = shl i32 [[TMP1]], 8
; CHECK-NEXT: ret i32 [[W]]
;
%x = shl i32 %a, 8
@@ -273,10 +273,10 @@ define i32 @test13(i32 %a, i32 %b) {
; The sub in this test cannot be removed because we need to keep the negation of %b. TODO: But we should be able to replace the LHS of it with a 0.
define i32 @test14(i32 %a, i32 %b) {
; CHECK-LABEL: @test14(
-; CHECK-NEXT: [[X:%.*]] = shl i32 [[A:%.*]], 8
; CHECK-NEXT: [[Y:%.*]] = sub i32 0, [[B:%.*]]
; CHECK-NEXT: [[Z:%.*]] = and i32 [[Y]], 128
-; CHECK-NEXT: [[W:%.*]] = mul i32 [[Z]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[Z]], [[A:%.*]]
+; CHECK-NEXT: [[W:%.*]] = shl i32 [[TMP1]], 8
; CHECK-NEXT: ret i32 [[W]]
;
%x = shl i32 %a, 8
diff --git a/llvm/test/Transforms/InstCombine/apint-and-compare.ll b/llvm/test/Transforms/InstCombine/apint-and-compare.ll
index 55ff1d1588eee..2abc083745f0e 100644
--- a/llvm/test/Transforms/InstCombine/apint-and-compare.ll
+++ b/llvm/test/Transforms/InstCombine/apint-and-compare.ll
@@ -1,16 +1,17 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep and | count 2
; Should be optimized to one and.
define i1 @test1(i33 %a, i33 %b) {
- %tmp1 = and i33 %a, 65280
- %tmp3 = and i33 %b, 65280
- %tmp = icmp ne i33 %tmp1, %tmp3
- ret i1 %tmp
+ %tmp1 = and i33 %a, 65280
+ %tmp3 = and i33 %b, 65280
+ %tmp = icmp ne i33 %tmp1, %tmp3
+ ret i1 %tmp
}
define i1 @test2(i999 %a, i999 %b) {
- %tmp1 = and i999 %a, 65280
- %tmp3 = and i999 %b, 65280
- %tmp = icmp ne i999 %tmp1, %tmp3
- ret i1 %tmp
+ %tmp1 = and i999 %a, 65280
+ %tmp3 = and i999 %b, 65280
+ %tmp = icmp ne i999 %tmp1, %tmp3
+ ret i1 %tmp
}
diff --git a/llvm/test/Transforms/InstCombine/apint-and-or-and.ll b/llvm/test/Transforms/InstCombine/apint-and-or-and.ll
index e30b30870922d..b28a184acc09a 100644
--- a/llvm/test/Transforms/InstCombine/apint-and-or-and.ll
+++ b/llvm/test/Transforms/InstCombine/apint-and-or-and.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; If we have an 'and' of the result of an 'or', and one of the 'or' operands
; cannot have contributed any of the resultant bits, delete the or. This
; occurs for very common C/C++ code like this:
@@ -8,43 +9,43 @@
; }
;
; Which corresponds to test1.
-;
+;
; This tests arbitrary precision integers.
; RUN: opt < %s -passes=instcombine -S | not grep "or "
; END.
define i17 @test1(i17 %X, i17 %Y) {
- %A = and i17 %X, 7
- %B = and i17 %Y, 8
- %C = or i17 %A, %B
- %D = and i17 %C, 7 ;; This cannot include any bits from %Y!
- ret i17 %D
+ %A = and i17 %X, 7
+ %B = and i17 %Y, 8
+ %C = or i17 %A, %B
+ %D = and i17 %C, 7 ;; This cannot include any bits from %Y!
+ ret i17 %D
}
define i49 @test3(i49 %X, i49 %Y) {
- %B = shl i49 %Y, 1
- %C = or i49 %X, %B
- %D = and i49 %C, 1 ;; This cannot include any bits from %Y!
- ret i49 %D
+ %B = shl i49 %Y, 1
+ %C = or i49 %X, %B
+ %D = and i49 %C, 1 ;; This cannot include any bits from %Y!
+ ret i49 %D
}
define i67 @test4(i67 %X, i67 %Y) {
- %B = lshr i67 %Y, 66
- %C = or i67 %X, %B
- %D = and i67 %C, 2 ;; This cannot include any bits from %Y!
- ret i67 %D
+ %B = lshr i67 %Y, 66
+ %C = or i67 %X, %B
+ %D = and i67 %C, 2 ;; This cannot include any bits from %Y!
+ ret i67 %D
}
define i231 @or_test1(i231 %X, i231 %Y) {
- %A = and i231 %X, 1
- %B = or i231 %A, 1 ;; This cannot include any bits from X!
- ret i231 %B
+ %A = and i231 %X, 1
+ %B = or i231 %A, 1 ;; This cannot include any bits from X!
+ ret i231 %B
}
define i7 @or_test2(i7 %X, i7 %Y) {
- %A = shl i7 %X, 6
- %B = or i7 %A, 64 ;; This cannot include any bits from X!
- ret i7 %B
+ %A = shl i7 %X, 6
+ %B = or i7 %A, 64 ;; This cannot include any bits from X!
+ ret i7 %B
}
diff --git a/llvm/test/Transforms/InstCombine/apint-and.ll b/llvm/test/Transforms/InstCombine/apint-and.ll
index c5f2087ee02fd..60d80f6d1b8e0 100644
--- a/llvm/test/Transforms/InstCombine/apint-and.ll
+++ b/llvm/test/Transforms/InstCombine/apint-and.ll
@@ -56,8 +56,8 @@ define i7 @test5(i7 %A, ptr %P) {
define i47 @test7(i47 %A) {
; CHECK-LABEL: @test7(
-; CHECK-NEXT: [[TMP1:%.*]] = lshr i47 [[A:%.*]], 39
-; CHECK-NEXT: ret i47 [[TMP1]]
+; CHECK-NEXT: [[X:%.*]] = lshr i47 [[A:%.*]], 39
+; CHECK-NEXT: ret i47 [[X]]
;
%X = ashr i47 %A, 39 ;; sign extend
%C1 = and i47 %X, 255
@@ -117,8 +117,8 @@ define i117 @test12(i117 %A, ptr %P) {
define i1024 @test13(i1024 %A) {
; CHECK-LABEL: @test13(
-; CHECK-NEXT: [[TMP1:%.*]] = lshr i1024 [[A:%.*]], 1016
-; CHECK-NEXT: ret i1024 [[TMP1]]
+; CHECK-NEXT: [[X:%.*]] = lshr i1024 [[A:%.*]], 1016
+; CHECK-NEXT: ret i1024 [[X]]
;
%X = ashr i1024 %A, 1016 ;; sign extend
%C1 = and i1024 %X, 255
diff --git a/llvm/test/Transforms/InstCombine/apint-cast-and-cast.ll b/llvm/test/Transforms/InstCombine/apint-cast-and-cast.ll
index 06e0dcdc0ca50..8878ac1d2913e 100644
--- a/llvm/test/Transforms/InstCombine/apint-cast-and-cast.ll
+++ b/llvm/test/Transforms/InstCombine/apint-cast-and-cast.ll
@@ -1,14 +1,15 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | not grep bitcast
define i19 @test1(i43 %val) {
- %t1 = bitcast i43 %val to i43
+ %t1 = bitcast i43 %val to i43
%t2 = and i43 %t1, 1
%t3 = trunc i43 %t2 to i19
ret i19 %t3
}
define i73 @test2(i677 %val) {
- %t1 = bitcast i677 %val to i677
+ %t1 = bitcast i677 %val to i677
%t2 = and i677 %t1, 1
%t3 = trunc i677 %t2 to i73
ret i73 %t3
diff --git a/llvm/test/Transforms/InstCombine/apint-cast-cast-to-and.ll b/llvm/test/Transforms/InstCombine/apint-cast-cast-to-and.ll
index 0c98cc3535023..fa710dc442695 100644
--- a/llvm/test/Transforms/InstCombine/apint-cast-cast-to-and.ll
+++ b/llvm/test/Transforms/InstCombine/apint-cast-cast-to-and.ll
@@ -1,8 +1,9 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | not grep i41
define i61 @test1(i61 %X) {
- %Y = trunc i61 %X to i41 ;; Turn i61o an AND
- %Z = zext i41 %Y to i61
- ret i61 %Z
+ %Y = trunc i61 %X to i41 ;; Turn i61o an AND
+ %Z = zext i41 %Y to i61
+ ret i61 %Z
}
diff --git a/llvm/test/Transforms/InstCombine/apint-div1.ll b/llvm/test/Transforms/InstCombine/apint-div1.ll
index 22af6e9b9867f..37f12d57f60f4 100644
--- a/llvm/test/Transforms/InstCombine/apint-div1.ll
+++ b/llvm/test/Transforms/InstCombine/apint-div1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test makes sure that div instructions are properly eliminated.
; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.
;
@@ -5,18 +6,18 @@
define i33 @test1(i33 %X) {
- %Y = udiv i33 %X, 4096
- ret i33 %Y
+ %Y = udiv i33 %X, 4096
+ ret i33 %Y
}
define i49 @test2(i49 %X) {
- %tmp.0 = shl i49 4096, 17
- %Y = udiv i49 %X, %tmp.0
- ret i49 %Y
+ %tmp.0 = shl i49 4096, 17
+ %Y = udiv i49 %X, %tmp.0
+ ret i49 %Y
}
define i59 @test3(i59 %X, i1 %C) {
- %V = select i1 %C, i59 1024, i59 4096
- %R = udiv i59 %X, %V
- ret i59 %R
+ %V = select i1 %C, i59 1024, i59 4096
+ %R = udiv i59 %X, %V
+ ret i59 %R
}
diff --git a/llvm/test/Transforms/InstCombine/apint-div2.ll b/llvm/test/Transforms/InstCombine/apint-div2.ll
index 36a5bff23383f..431ec8319bd96 100644
--- a/llvm/test/Transforms/InstCombine/apint-div2.ll
+++ b/llvm/test/Transforms/InstCombine/apint-div2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test makes sure that div instructions are properly eliminated.
; This test is for Integer BitWidth >= 64 && BitWidth <= 1024.
;
@@ -5,18 +6,18 @@
define i333 @test1(i333 %X) {
- %Y = udiv i333 %X, 70368744177664
- ret i333 %Y
+ %Y = udiv i333 %X, 70368744177664
+ ret i333 %Y
}
define i499 @test2(i499 %X) {
- %tmp.0 = shl i499 4096, 197
- %Y = udiv i499 %X, %tmp.0
- ret i499 %Y
+ %tmp.0 = shl i499 4096, 197
+ %Y = udiv i499 %X, %tmp.0
+ ret i499 %Y
}
define i599 @test3(i599 %X, i1 %C) {
- %V = select i1 %C, i599 70368744177664, i599 4096
- %R = udiv i599 %X, %V
- ret i599 %R
+ %V = select i1 %C, i599 70368744177664, i599 4096
+ %R = udiv i599 %X, %V
+ ret i599 %R
}
diff --git a/llvm/test/Transforms/InstCombine/apint-not.ll b/llvm/test/Transforms/InstCombine/apint-not.ll
index 1da03726c6e63..9fa685d30a384 100644
--- a/llvm/test/Transforms/InstCombine/apint-not.ll
+++ b/llvm/test/Transforms/InstCombine/apint-not.ll
@@ -1,17 +1,18 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test makes sure that the xor instructions are properly eliminated
; when arbitrary precision integers are used.
; RUN: opt < %s -passes=instcombine -S | not grep xor
define i33 @test1(i33 %A) {
- %B = xor i33 %A, -1
- %C = xor i33 %B, -1
- ret i33 %C
+ %B = xor i33 %A, -1
+ %C = xor i33 %B, -1
+ ret i33 %C
}
define i1 @test2(i52 %A, i52 %B) {
- %cond = icmp ule i52 %A, %B ; Can change into uge
- %Ret = xor i1 %cond, true
- ret i1 %Ret
+ %cond = icmp ule i52 %A, %B ; Can change into uge
+ %Ret = xor i1 %cond, true
+ ret i1 %Ret
}
diff --git a/llvm/test/Transforms/InstCombine/apint-rem1.ll b/llvm/test/Transforms/InstCombine/apint-rem1.ll
index 05537ed72c2cc..49ccc9441618b 100644
--- a/llvm/test/Transforms/InstCombine/apint-rem1.ll
+++ b/llvm/test/Transforms/InstCombine/apint-rem1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test makes sure that these instructions are properly eliminated.
; This test is for Integer BitWidth < 64 && BitWidth % 2 != 0.
;
@@ -5,18 +6,18 @@
define i33 @test1(i33 %A) {
- %B = urem i33 %A, 4096
- ret i33 %B
+ %B = urem i33 %A, 4096
+ ret i33 %B
}
define i49 @test2(i49 %A) {
- %B = shl i49 4096, 11
- %Y = urem i49 %A, %B
- ret i49 %Y
+ %B = shl i49 4096, 11
+ %Y = urem i49 %A, %B
+ ret i49 %Y
}
define i59 @test3(i59 %X, i1 %C) {
- %V = select i1 %C, i59 70368744177664, i59 4096
- %R = urem i59 %X, %V
- ret i59 %R
+ %V = select i1 %C, i59 70368744177664, i59 4096
+ %R = urem i59 %X, %V
+ ret i59 %R
}
diff --git a/llvm/test/Transforms/InstCombine/apint-rem2.ll b/llvm/test/Transforms/InstCombine/apint-rem2.ll
index 49724689790cc..2115cd76d973c 100644
--- a/llvm/test/Transforms/InstCombine/apint-rem2.ll
+++ b/llvm/test/Transforms/InstCombine/apint-rem2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test makes sure that these instructions are properly eliminated.
; This test is for Integer BitWidth >= 64 && BitWidth <= 1024.
;
@@ -5,18 +6,18 @@
define i333 @test1(i333 %A) {
- %B = urem i333 %A, 70368744177664
- ret i333 %B
+ %B = urem i333 %A, 70368744177664
+ ret i333 %B
}
define i499 @test2(i499 %A) {
- %B = shl i499 4096, 111
- %Y = urem i499 %A, %B
- ret i499 %Y
+ %B = shl i499 4096, 111
+ %Y = urem i499 %A, %B
+ ret i499 %Y
}
define i599 @test3(i599 %X, i1 %C) {
- %V = select i1 %C, i599 70368744177664, i599 4096
- %R = urem i599 %X, %V
- ret i599 %R
+ %V = select i1 %C, i599 70368744177664, i599 4096
+ %R = urem i599 %X, %V
+ ret i599 %R
}
diff --git a/llvm/test/Transforms/InstCombine/apint-shift-simplify.ll b/llvm/test/Transforms/InstCombine/apint-shift-simplify.ll
index 693e807520063..936932cdaf6fa 100644
--- a/llvm/test/Transforms/InstCombine/apint-shift-simplify.ll
+++ b/llvm/test/Transforms/InstCombine/apint-shift-simplify.ll
@@ -1,34 +1,41 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define i41 @test0(i41 %A, i41 %B, i41 %C) {
- %X = shl i41 %A, %C
- %Y = shl i41 %B, %C
- %Z = and i41 %X, %Y
- ret i41 %Z
-; CHECK-LABEL: @test0(
-; CHECK-NEXT: and i41 %A, %B
-; CHECK-NEXT: shl i41
-; CHECK-NEXT: ret
+; CHECK-LABEL: define i41 @test0(
+; CHECK-SAME: i41 [[A:%.*]], i41 [[B:%.*]], i41 [[C:%.*]]) {
+; CHECK-NEXT: [[X1:%.*]] = and i41 [[A]], [[B]]
+; CHECK-NEXT: [[Z:%.*]] = shl i41 [[X1]], [[C]]
+; CHECK-NEXT: ret i41 [[Z]]
+;
+ %X = shl i41 %A, %C
+ %Y = shl i41 %B, %C
+ %Z = and i41 %X, %Y
+ ret i41 %Z
}
define i57 @test1(i57 %A, i57 %B, i57 %C) {
- %X = lshr i57 %A, %C
- %Y = lshr i57 %B, %C
- %Z = or i57 %X, %Y
- ret i57 %Z
-; CHECK-LABEL: @test1(
-; CHECK-NEXT: or i57 %A, %B
-; CHECK-NEXT: lshr i57
-; CHECK-NEXT: ret
+; CHECK-LABEL: define i57 @test1(
+; CHECK-SAME: i57 [[A:%.*]], i57 [[B:%.*]], i57 [[C:%.*]]) {
+; CHECK-NEXT: [[X1:%.*]] = or i57 [[A]], [[B]]
+; CHECK-NEXT: [[Z:%.*]] = lshr i57 [[X1]], [[C]]
+; CHECK-NEXT: ret i57 [[Z]]
+;
+ %X = lshr i57 %A, %C
+ %Y = lshr i57 %B, %C
+ %Z = or i57 %X, %Y
+ ret i57 %Z
}
define i49 @test2(i49 %A, i49 %B, i49 %C) {
- %X = ashr i49 %A, %C
- %Y = ashr i49 %B, %C
- %Z = xor i49 %X, %Y
- ret i49 %Z
-; CHECK-LABEL: @test2(
-; CHECK-NEXT: xor i49 %A, %B
-; CHECK-NEXT: ashr i49
-; CHECK-NEXT: ret
+; CHECK-LABEL: define i49 @test2(
+; CHECK-SAME: i49 [[A:%.*]], i49 [[B:%.*]], i49 [[C:%.*]]) {
+; CHECK-NEXT: [[X1:%.*]] = xor i49 [[A]], [[B]]
+; CHECK-NEXT: [[Z:%.*]] = ashr i49 [[X1]], [[C]]
+; CHECK-NEXT: ret i49 [[Z]]
+;
+ %X = ashr i49 %A, %C
+ %Y = ashr i49 %B, %C
+ %Z = xor i49 %X, %Y
+ ret i49 %Z
}
diff --git a/llvm/test/Transforms/InstCombine/apint-shift.ll b/llvm/test/Transforms/InstCombine/apint-shift.ll
index ecf9c4e9c4e69..06c867bfb8a14 100644
--- a/llvm/test/Transforms/InstCombine/apint-shift.ll
+++ b/llvm/test/Transforms/InstCombine/apint-shift.ll
@@ -144,10 +144,9 @@ define <2 x i19> @shl_shl_splat_vec(<2 x i19> %X) {
define i42 @multiuse_shl_shl(i42 %x) {
; CHECK-LABEL: @multiuse_shl_shl(
-; CHECK-NEXT: [[SH1:%.*]] = shl i42 [[X:%.*]], 8
-; CHECK-NEXT: [[SH2:%.*]] = shl i42 [[X]], 17
-; CHECK-NEXT: [[MUL:%.*]] = mul i42 [[SH1]], [[SH2]]
-; CHECK-NEXT: ret i42 [[MUL]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i42 [[X:%.*]], [[X]]
+; CHECK-NEXT: [[TMP2:%.*]] = shl i42 [[TMP1]], 25
+; CHECK-NEXT: ret i42 [[TMP2]]
;
%sh1 = shl i42 %x, 8
%sh2 = shl i42 %sh1, 9
@@ -157,10 +156,9 @@ define i42 @multiuse_shl_shl(i42 %x) {
define <2 x i42> @multiuse_shl_shl_splat(<2 x i42> %x) {
; CHECK-LABEL: @multiuse_shl_shl_splat(
-; CHECK-NEXT: [[SH1:%.*]] = shl <2 x i42> [[X:%.*]], <i42 8, i42 8>
-; CHECK-NEXT: [[SH2:%.*]] = shl <2 x i42> [[X]], <i42 17, i42 17>
-; CHECK-NEXT: [[MUL:%.*]] = mul <2 x i42> [[SH1]], [[SH2]]
-; CHECK-NEXT: ret <2 x i42> [[MUL]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul <2 x i42> [[X:%.*]], [[X]]
+; CHECK-NEXT: [[TMP2:%.*]] = shl <2 x i42> [[TMP1]], <i42 25, i42 25>
+; CHECK-NEXT: ret <2 x i42> [[TMP2]]
;
%sh1 = shl <2 x i42> %x, <i42 8, i42 8>
%sh2 = shl <2 x i42> %sh1, <i42 9, i42 9>
diff --git a/llvm/test/Transforms/InstCombine/apint-xor1.ll b/llvm/test/Transforms/InstCombine/apint-xor1.ll
index 71436f141b7b2..2073bf07caa7a 100644
--- a/llvm/test/Transforms/InstCombine/apint-xor1.ll
+++ b/llvm/test/Transforms/InstCombine/apint-xor1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test makes sure that xor instructions are properly eliminated.
; This test is for Integer BitWidth <= 64 && BitWidth % 8 != 0.
@@ -6,45 +7,45 @@
define i47 @test1(i47 %A, i47 %B) {
;; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
- %A1 = and i47 %A, 70368744177664
- %B1 = and i47 %B, 70368744177661
- %C1 = xor i47 %A1, %B1
- ret i47 %C1
+ %A1 = and i47 %A, 70368744177664
+ %B1 = and i47 %B, 70368744177661
+ %C1 = xor i47 %A1, %B1
+ ret i47 %C1
}
define i15 @test2(i15 %x) {
- %tmp.2 = xor i15 %x, 0
- ret i15 %tmp.2
+ %tmp.2 = xor i15 %x, 0
+ ret i15 %tmp.2
}
define i23 @test3(i23 %x) {
- %tmp.2 = xor i23 %x, %x
- ret i23 %tmp.2
+ %tmp.2 = xor i23 %x, %x
+ ret i23 %tmp.2
}
define i37 @test4(i37 %x) {
; x ^ ~x == -1
- %NotX = xor i37 -1, %x
- %B = xor i37 %x, %NotX
- ret i37 %B
+ %NotX = xor i37 -1, %x
+ %B = xor i37 %x, %NotX
+ ret i37 %B
}
define i7 @test5(i7 %A) {
;; (A|B)^B == A & (~B)
- %t1 = or i7 %A, 23
- %r = xor i7 %t1, 23
- ret i7 %r
+ %t1 = or i7 %A, 23
+ %r = xor i7 %t1, 23
+ ret i7 %r
}
define i7 @test6(i7 %A) {
- %t1 = xor i7 %A, 23
- %r = xor i7 %t1, 23
- ret i7 %r
+ %t1 = xor i7 %A, 23
+ %r = xor i7 %t1, 23
+ ret i7 %r
}
define i47 @test7(i47 %A) {
;; (A | C1) ^ C2 -> (A | C1) & ~C2 iff (C1&C2) == C2
- %B1 = or i47 %A, 70368744177663
- %C1 = xor i47 %B1, 703687463
- ret i47 %C1
+ %B1 = or i47 %A, 70368744177663
+ %C1 = xor i47 %B1, 703687463
+ ret i47 %C1
}
diff --git a/llvm/test/Transforms/InstCombine/apint-xor2.ll b/llvm/test/Transforms/InstCombine/apint-xor2.ll
index a340c89f91a77..46e7fcbfe2974 100644
--- a/llvm/test/Transforms/InstCombine/apint-xor2.ll
+++ b/llvm/test/Transforms/InstCombine/apint-xor2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test makes sure that xor instructions are properly eliminated.
; This test is for Integer BitWidth > 64 && BitWidth <= 1024.
@@ -7,45 +8,45 @@
define i447 @test1(i447 %A, i447 %B) {
;; (A & C1)^(B & C2) -> (A & C1)|(B & C2) iff C1&C2 == 0
- %A1 = and i447 %A, 70368744177664
- %B1 = and i447 %B, 70368744177663
- %C1 = xor i447 %A1, %B1
- ret i447 %C1
+ %A1 = and i447 %A, 70368744177664
+ %B1 = and i447 %B, 70368744177663
+ %C1 = xor i447 %A1, %B1
+ ret i447 %C1
}
define i1005 @test2(i1005 %x) {
- %tmp.2 = xor i1005 %x, 0
- ret i1005 %tmp.2
+ %tmp.2 = xor i1005 %x, 0
+ ret i1005 %tmp.2
}
define i123 @test3(i123 %x) {
- %tmp.2 = xor i123 %x, %x
- ret i123 %tmp.2
+ %tmp.2 = xor i123 %x, %x
+ ret i123 %tmp.2
}
define i737 @test4(i737 %x) {
; x ^ ~x == -1
- %NotX = xor i737 -1, %x
- %B = xor i737 %x, %NotX
- ret i737 %B
+ %NotX = xor i737 -1, %x
+ %B = xor i737 %x, %NotX
+ ret i737 %B
}
define i700 @test5(i700 %A) {
;; (A|B)^B == A & (~B)
- %t1 = or i700 %A, 288230376151711743
- %r = xor i700 %t1, 288230376151711743
- ret i700 %r
+ %t1 = or i700 %A, 288230376151711743
+ %r = xor i700 %t1, 288230376151711743
+ ret i700 %r
}
define i77 @test6(i77 %A) {
- %t1 = xor i77 %A, 23
- %r = xor i77 %t1, 23
- ret i77 %r
+ %t1 = xor i77 %A, 23
+ %r = xor i77 %t1, 23
+ ret i77 %r
}
define i1023 @test7(i1023 %A) {
;; (A | C1) ^ C2 -> (A | C1) & ~C2 iff (C1&C2) == C2
- %B1 = or i1023 %A, 70368744177663
- %C1 = xor i1023 %B1, 703687463
- ret i1023 %C1
+ %B1 = or i1023 %A, 70368744177663
+ %C1 = xor i1023 %B1, 703687463
+ ret i1023 %C1
}
diff --git a/llvm/test/Transforms/InstCombine/bswap-fold.ll b/llvm/test/Transforms/InstCombine/bswap-fold.ll
index 91674c6017a9e..8a64ad2f29300 100644
--- a/llvm/test/Transforms/InstCombine/bswap-fold.ll
+++ b/llvm/test/Transforms/InstCombine/bswap-fold.ll
@@ -883,10 +883,9 @@ define <2 x i64> @bs_active_high_poison(<2 x i64> %0) {
define i64 @bs_active_high8_multiuse(i64 %0) {
; CHECK-LABEL: @bs_active_high8_multiuse(
-; CHECK-NEXT: [[TMP2:%.*]] = shl i64 [[TMP0:%.*]], 56
-; CHECK-NEXT: [[TMP3:%.*]] = and i64 [[TMP0]], 255
-; CHECK-NEXT: [[TMP4:%.*]] = mul i64 [[TMP2]], [[TMP3]]
-; CHECK-NEXT: ret i64 [[TMP4]]
+; CHECK-NEXT: [[TMP2:%.*]] = mul i64 [[TMP0:%.*]], [[TMP0]]
+; CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 56
+; CHECK-NEXT: ret i64 [[TMP3]]
;
%2 = shl i64 %0, 56
%3 = call i64 @llvm.bswap.i64(i64 %2)
@@ -1011,10 +1010,9 @@ define <2 x i32> @bs_active_low_undef(<2 x i32> %0) {
define i64 @bs_active_low8_multiuse(i64 %0) {
; CHECK-LABEL: @bs_active_low8_multiuse(
-; CHECK-NEXT: [[TMP2:%.*]] = and i64 [[TMP0:%.*]], 255
-; CHECK-NEXT: [[TMP3:%.*]] = shl nuw i64 [[TMP2]], 56
-; CHECK-NEXT: [[TMP4:%.*]] = mul i64 [[TMP2]], [[TMP3]]
-; CHECK-NEXT: ret i64 [[TMP4]]
+; CHECK-NEXT: [[TMP2:%.*]] = mul i64 [[TMP0:%.*]], [[TMP0]]
+; CHECK-NEXT: [[TMP3:%.*]] = shl i64 [[TMP2]], 56
+; CHECK-NEXT: ret i64 [[TMP3]]
;
%2 = and i64 %0, 255
%3 = call i64 @llvm.bswap.i64(i64 %2)
@@ -1025,8 +1023,8 @@ define i64 @bs_active_low8_multiuse(i64 %0) {
define i64 @bs_active_low7_multiuse(i64 %0) {
; CHECK-LABEL: @bs_active_low7_multiuse(
; CHECK-NEXT: [[TMP2:%.*]] = and i64 [[TMP0:%.*]], 127
-; CHECK-NEXT: [[TMP3:%.*]] = shl nuw nsw i64 [[TMP2]], 56
-; CHECK-NEXT: [[TMP4:%.*]] = mul i64 [[TMP2]], [[TMP3]]
+; CHECK-NEXT: [[TMP3:%.*]] = mul nuw nsw i64 [[TMP2]], [[TMP2]]
+; CHECK-NEXT: [[TMP4:%.*]] = shl i64 [[TMP3]], 56
; CHECK-NEXT: ret i64 [[TMP4]]
;
%2 = and i64 %0, 127
diff --git a/llvm/test/Transforms/InstCombine/dbg-simplify-alloca-size.ll b/llvm/test/Transforms/InstCombine/dbg-simplify-alloca-size.ll
index 343a679950e66..5afe716dc49f7 100644
--- a/llvm/test/Transforms/InstCombine/dbg-simplify-alloca-size.ll
+++ b/llvm/test/Transforms/InstCombine/dbg-simplify-alloca-size.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S --passes=instcombine %s | FileCheck %s
; RUN: opt --try-experimental-debuginfo-iterators -S --passes=instcombine %s | FileCheck %s
@@ -6,13 +7,14 @@ declare void @foo(ptr %pixels)
declare void @llvm.dbg.declare(metadata, metadata, metadata)
-; CHECK-LABEL: @toplevel(
-; CHECK: entry:
-; CHECK-NEXT: %pixels1 = alloca [3 x i8], align 1
-; CHECK-NEXT: #dbg_declare(ptr %pixels1, ![[MD:[0-9]+]], !DIExpression(), ![[DBG:[0-9]+]]
-; CHECK-NEXT: call void @foo(ptr nonnull %pixels1)
-; CHECK-NEXT: ret void
define dso_local void @toplevel() {
+; CHECK-LABEL: define dso_local void @toplevel() {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[PIXELS1:%.*]] = alloca [3 x i8], align 1
+; CHECK-NEXT: #dbg_declare(ptr [[PIXELS1]], [[META6:![0-9]+]], !DIExpression(), [[META11:![0-9]+]])
+; CHECK-NEXT: call void @foo(ptr nonnull [[PIXELS1]])
+; CHECK-NEXT: ret void
+;
entry:
%pixels = alloca i8, i32 3
call void @llvm.dbg.declare(metadata ptr %pixels, metadata !11, metadata !DIExpression()), !dbg !12
@@ -33,8 +35,17 @@ entry:
!8 = !DISubroutineType(types: !9)
!9 = !{!10, !10}
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-; CHECK: ![[MD]] = !DILocalVariable(name: "pixels"
!11 = !DILocalVariable(name: "pixels", arg: 1, scope: !7, file: !1, line: 9, type: !10)
-; CHECK: ![[DBG]] = !DILocation(line: 9, column: 16,
!12 = !DILocation(line: 9, column: 16, scope: !7)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]], splitDebugInlining: false, nameTableKind: None)
+; CHECK: [[META1]] = !DIFile(filename: "test.cpp", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[META6]] = !DILocalVariable(name: "pixels", arg: 1, scope: [[META7:![0-9]+]], file: [[META1]], line: 9, type: [[META10:![0-9]+]])
+; CHECK: [[META7]] = distinct !DISubprogram(name: "toplevel", linkageName: "_Z8toplevelv", scope: [[META1]], file: [[META1]], line: 9, type: [[META8:![0-9]+]], scopeLine: 9, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META2]])
+; CHECK: [[META8]] = !DISubroutineType(types: [[META9:![0-9]+]])
+; CHECK: [[META9]] = !{[[META10]], [[META10]]}
+; CHECK: [[META10]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+; CHECK: [[META11]] = !DILocation(line: 9, column: 16, scope: [[META7]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/dce-iterate.ll b/llvm/test/Transforms/InstCombine/dce-iterate.ll
index 08d3c8feb4589..07ce079ffa7d2 100644
--- a/llvm/test/Transforms/InstCombine/dce-iterate.ll
+++ b/llvm/test/Transforms/InstCombine/dce-iterate.ll
@@ -1,24 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep "ret double .sy"
define internal double @ScaleObjectAdd(double %sx, double %sy, double %sz) nounwind {
entry:
- %sx34 = bitcast double %sx to i64 ; <i64> [#uses=1]
- %sx3435 = zext i64 %sx34 to i960 ; <i960> [#uses=1]
- %sy22 = bitcast double %sy to i64 ; <i64> [#uses=1]
- %sy2223 = zext i64 %sy22 to i960 ; <i960> [#uses=1]
- %sy222324 = shl i960 %sy2223, 320 ; <i960> [#uses=1]
- %sy222324.ins = or i960 %sx3435, %sy222324 ; <i960> [#uses=1]
- %sz10 = bitcast double %sz to i64 ; <i64> [#uses=1]
- %sz1011 = zext i64 %sz10 to i960 ; <i960> [#uses=1]
- %sz101112 = shl i960 %sz1011, 640 ; <i960> [#uses=1]
- %sz101112.ins = or i960 %sy222324.ins, %sz101112
-
- %a = trunc i960 %sz101112.ins to i64 ; <i64> [#uses=1]
- %b = bitcast i64 %a to double ; <double> [#uses=1]
- %c = lshr i960 %sz101112.ins, 320 ; <i960> [#uses=1]
- %d = trunc i960 %c to i64 ; <i64> [#uses=1]
- %e = bitcast i64 %d to double ; <double> [#uses=1]
- %f = fadd double %b, %e
+ %sx34 = bitcast double %sx to i64 ; <i64> [#uses=1]
+ %sx3435 = zext i64 %sx34 to i960 ; <i960> [#uses=1]
+ %sy22 = bitcast double %sy to i64 ; <i64> [#uses=1]
+ %sy2223 = zext i64 %sy22 to i960 ; <i960> [#uses=1]
+ %sy222324 = shl i960 %sy2223, 320 ; <i960> [#uses=1]
+ %sy222324.ins = or i960 %sx3435, %sy222324 ; <i960> [#uses=1]
+ %sz10 = bitcast double %sz to i64 ; <i64> [#uses=1]
+ %sz1011 = zext i64 %sz10 to i960 ; <i960> [#uses=1]
+ %sz101112 = shl i960 %sz1011, 640 ; <i960> [#uses=1]
+ %sz101112.ins = or i960 %sy222324.ins, %sz101112
- ret double %e
+ %a = trunc i960 %sz101112.ins to i64 ; <i64> [#uses=1]
+ %b = bitcast i64 %a to double ; <double> [#uses=1]
+ %c = lshr i960 %sz101112.ins, 320 ; <i960> [#uses=1]
+ %d = trunc i960 %c to i64 ; <i64> [#uses=1]
+ %e = bitcast i64 %d to double ; <double> [#uses=1]
+ %f = fadd double %b, %e
+
+ ret double %e
}
diff --git a/llvm/test/Transforms/InstCombine/deadcode.ll b/llvm/test/Transforms/InstCombine/deadcode.ll
index e65f0ab6e8d87..f292684f68972 100644
--- a/llvm/test/Transforms/InstCombine/deadcode.ll
+++ b/llvm/test/Transforms/InstCombine/deadcode.ll
@@ -1,24 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep "ret i32 %A"
; RUN: opt < %s -passes=dce -S | not grep call.*llvm
define i32 @test(i32 %A) {
- %X = or i1 false, false
- br i1 %X, label %T, label %C
+ %X = or i1 false, false
+ br i1 %X, label %T, label %C
T: ; preds = %0
- %B = add i32 %A, 1
- br label %C
+ %B = add i32 %A, 1
+ br label %C
C: ; preds = %T, %0
- %C.upgrd.1 = phi i32 [ %B, %T ], [ %A, %0 ]
- ret i32 %C.upgrd.1
+ %C.upgrd.1 = phi i32 [ %B, %T ], [ %A, %0 ]
+ ret i32 %C.upgrd.1
}
define ptr @test2(i32 %width) {
- %tmp = call ptr @llvm.stacksave( )
- %tmp14 = alloca i32, i32 %width
- ret ptr %tmp14
-}
+ %tmp = call ptr @llvm.stacksave( )
+ %tmp14 = alloca i32, i32 %width
+ ret ptr %tmp14
+}
declare ptr @llvm.stacksave()
diff --git a/llvm/test/Transforms/InstCombine/debug-line.ll b/llvm/test/Transforms/InstCombine/debug-line.ll
index 6fe56e4d7ae56..62c08cade9f98 100644
--- a/llvm/test/Transforms/InstCombine/debug-line.ll
+++ b/llvm/test/Transforms/InstCombine/debug-line.ll
@@ -1,10 +1,15 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
@.str = private constant [3 x i8] c"%c\00"
define void @foo() nounwind ssp !dbg !0 {
-;CHECK: call i32 @putchar{{.+}} !dbg
+; CHECK-LABEL: define void @foo(
+; CHECK-SAME: ) #[[ATTR0:[0-9]+]] !dbg [[DBG4:![0-9]+]] {
+; CHECK-NEXT: [[PUTCHAR:%.*]] = call i32 @putchar(i32 97), !dbg [[DBG7:![0-9]+]]
+; CHECK-NEXT: ret void, !dbg [[DBG9:![0-9]+]]
+;
%1 = call i32 (ptr, ...) @printf(ptr @.str, i32 97), !dbg !5
ret void, !dbg !7
}
@@ -24,3 +29,14 @@ declare i32 @printf(ptr, ...)
!7 = !DILocation(line: 6, column: 1, scope: !6)
!8 = !DIFile(filename: "m.c", directory: "/private/tmp")
!10 = !{i32 1, !"Debug Info Version", i32 3}
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "clang", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]], retainedTypes: [[META2]])
+; CHECK: [[META1]] = !DIFile(filename: "m.c", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[DBG4]] = distinct !DISubprogram(name: "foo", scope: [[META1]], file: [[META1]], line: 4, type: [[META5:![0-9]+]], virtualIndex: 6, spFlags: DISPFlagDefinition, unit: [[META0]])
+; CHECK: [[META5]] = !DISubroutineType(types: [[META6:![0-9]+]])
+; CHECK: [[META6]] = !{null}
+; CHECK: [[DBG7]] = !DILocation(line: 5, column: 2, scope: [[META8:![0-9]+]])
+; CHECK: [[META8]] = distinct !DILexicalBlock(scope: [[DBG4]], file: [[META1]], line: 4, column: 12)
+; CHECK: [[DBG9]] = !DILocation(line: 6, column: 1, scope: [[META8]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/debuginfo-dce.ll b/llvm/test/Transforms/InstCombine/debuginfo-dce.ll
index 5fcf26362a341..cb9f299e6e7ba 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo-dce.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo-dce.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine %s -S -o - | FileCheck %s
; RUN: opt -passes=instcombine %s -S -o - --try-experimental-debuginfo-iterators | FileCheck %s
; Verify that the eliminated instructions (bitcast, gep, load) are salvaged into
@@ -28,68 +29,79 @@ target triple = "x86_64-apple-macosx10.12.0"
; ever fixed, then this is definitely a piece of test coverage that should
; be maintained.
define void @salvage_load(ptr %queue) local_unnamed_addr #0 !dbg !14 {
+; CHECK-LABEL: define void @salvage_load(
+; CHECK-SAME: ptr [[QUEUE:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] !dbg [[DBG14:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr poison, [[META18:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 0), [[META19:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG20:![0-9]+]]
+;
entry:
%im_not_dead = alloca ptr
%0 = load ptr, ptr %queue, align 8, !dbg !19
%1 = load ptr, ptr %queue, align 8, !dbg !19
call void @llvm.dbg.value(metadata ptr %1, metadata !18, metadata !20), !dbg !19
-; CHECK: define void @salvage_load
-; CHECK-NEXT: entry:
-; CHECK-NEXT: #dbg_value(ptr poison
store ptr %1, ptr %im_not_dead, align 8
ret void, !dbg !21
}
define void @salvage_bitcast(ptr %queue) local_unnamed_addr #0 !dbg !22 {
+; CHECK-LABEL: define void @salvage_bitcast(
+; CHECK-SAME: ptr [[QUEUE:%.*]]) local_unnamed_addr #[[ATTR0]] !dbg [[DBG21:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[QUEUE]], [[META22:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 0), [[META23:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[META23]]
+;
entry:
%im_not_dead = alloca ptr
call void @llvm.dbg.value(metadata ptr %queue, metadata !24, metadata !20), !dbg !23
-; CHECK: define void @salvage_bitcast
-; CHECK-NEXT: entry:
-; CHECK-NEXT: #dbg_value(ptr %queue,
-; CHECK-SAME: !DIExpression(DW_OP_plus_uconst, 0),
store ptr %queue, ptr %im_not_dead, align 8
ret void, !dbg !23
}
define void @salvage_gep0(ptr %queue, ptr %end) local_unnamed_addr #0 !dbg !25 {
+; CHECK-LABEL: define void @salvage_gep0(
+; CHECK-SAME: ptr [[QUEUE:%.*]], ptr [[END:%.*]]) local_unnamed_addr #[[ATTR0]] !dbg [[DBG24:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[QUEUE]], [[META25:![0-9]+]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value), [[META26:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[META26]]
+;
entry:
%im_not_dead = alloca ptr
%0 = getelementptr inbounds %struct.entry, ptr %queue, i32 -1, i32 0, !dbg !26
%1 = getelementptr inbounds %struct.entry, ptr %queue, i32 -1, i32 0, !dbg !26
call void @llvm.dbg.value(metadata ptr %1, metadata !27, metadata !20), !dbg !26
-; CHECK: define void @salvage_gep0
-; CHECK-NEXT: entry:
-; CHECK-NEXT: #dbg_value(ptr %queue,
-; CHECK-SAME: !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value),
store ptr %1, ptr %im_not_dead, align 8
ret void, !dbg !26
}
define void @salvage_gep1(ptr %queue, ptr %end) local_unnamed_addr #0 !dbg !28 {
+; CHECK-LABEL: define void @salvage_gep1(
+; CHECK-SAME: ptr [[QUEUE:%.*]], ptr [[END:%.*]]) local_unnamed_addr #[[ATTR0]] !dbg [[DBG27:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[QUEUE]], [[META28:![0-9]+]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32), [[META29:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[META29]]
+;
entry:
%im_not_dead = alloca ptr
%0 = getelementptr inbounds %struct.entry, ptr %queue, i32 -1, i32 0, !dbg !29
%1 = getelementptr inbounds %struct.entry, ptr %queue, i32 -1, i32 0, !dbg !29
call void @llvm.dbg.value(metadata ptr %1, metadata !30, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !29
-; CHECK: define void @salvage_gep1
-; CHECK-NEXT: entry:
-; CHECK-NEXT: #dbg_value(ptr %queue,
-; CHECK-SAME: !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 32),
store ptr %1, ptr %im_not_dead, align 8
ret void, !dbg !29
}
define void @salvage_gep2(ptr %queue, ptr %end) local_unnamed_addr #0 !dbg !31 {
+; CHECK-LABEL: define void @salvage_gep2(
+; CHECK-SAME: ptr [[QUEUE:%.*]], ptr [[END:%.*]]) local_unnamed_addr #[[ATTR0]] !dbg [[DBG30:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[QUEUE]], [[META31:![0-9]+]], !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value), [[META32:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[META32]]
+;
entry:
%im_not_dead = alloca ptr
%0 = getelementptr inbounds %struct.entry, ptr %queue, i32 -1, i32 0, !dbg !32
%1 = getelementptr inbounds %struct.entry, ptr %queue, i32 -1, i32 0, !dbg !32
call void @llvm.dbg.value(metadata ptr %1, metadata !33, metadata !DIExpression(DW_OP_stack_value)), !dbg !32
-; CHECK: define void @salvage_gep2
-; CHECK-NEXT: entry:
-; CHECK-NEXT: #dbg_value(ptr %queue,
-; CHECK-SAME: !DIExpression(DW_OP_constu, 8, DW_OP_minus, DW_OP_stack_value),
store ptr %1, ptr %im_not_dead, align 8
ret void, !dbg !32
}
@@ -138,3 +150,34 @@ attributes #1 = { nounwind readnone }
!31 = distinct !DISubprogram(name: "scan", scope: !1, file: !1, line: 4, type: !15, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: true, unit: !0, retainedNodes: !17)
!32 = !DILocation(line: 6, column: 17, scope: !31)
!33 = !DILocalVariable(name: "entry", scope: !31, file: !1, line: 6, type: !4)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}} (llvm/trunk 297643)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]], retainedTypes: [[META3:![0-9]+]])
+; CHECK: [[META1]] = !DIFile(filename: "test.c", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[META3]] = !{[[META4:![0-9]+]], [[META8:![0-9]+]]}
+; CHECK: [[META4]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META5:![0-9]+]], size: 64)
+; CHECK: [[META5]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "entry", file: [[META1]], line: 1, size: 64, elements: [[META6:![0-9]+]])
+; CHECK: [[META6]] = !{[[META7:![0-9]+]]}
+; CHECK: [[META7]] = !DIDerivedType(tag: DW_TAG_member, name: "next", scope: [[META5]], file: [[META1]], line: 2, baseType: [[META4]], size: 64)
+; CHECK: [[META8]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META9:![0-9]+]], size: 64)
+; CHECK: [[META9]] = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
+; CHECK: [[DBG14]] = distinct !DISubprogram(name: "scan", scope: [[META1]], file: [[META1]], line: 4, type: [[META15:![0-9]+]], scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META17:![0-9]+]])
+; CHECK: [[META15]] = !DISubroutineType(types: [[META16:![0-9]+]])
+; CHECK: [[META16]] = !{null, [[META4]], [[META4]]}
+; CHECK: [[META17]] = !{[[META18]]}
+; CHECK: [[META18]] = !DILocalVariable(name: "entry", scope: [[DBG14]], file: [[META1]], line: 6, type: [[META4]])
+; CHECK: [[META19]] = !DILocation(line: 6, column: 17, scope: [[DBG14]])
+; CHECK: [[DBG20]] = !DILocation(line: 11, column: 1, scope: [[DBG14]])
+; CHECK: [[DBG21]] = distinct !DISubprogram(name: "scan", scope: [[META1]], file: [[META1]], line: 4, type: [[META15]], scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META17]])
+; CHECK: [[META22]] = !DILocalVariable(name: "entry", scope: [[DBG21]], file: [[META1]], line: 6, type: [[META4]])
+; CHECK: [[META23]] = !DILocation(line: 6, column: 17, scope: [[DBG21]])
+; CHECK: [[DBG24]] = distinct !DISubprogram(name: "scan", scope: [[META1]], file: [[META1]], line: 4, type: [[META15]], scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META17]])
+; CHECK: [[META25]] = !DILocalVariable(name: "entry", scope: [[DBG24]], file: [[META1]], line: 6, type: [[META4]])
+; CHECK: [[META26]] = !DILocation(line: 6, column: 17, scope: [[DBG24]])
+; CHECK: [[DBG27]] = distinct !DISubprogram(name: "scan", scope: [[META1]], file: [[META1]], line: 4, type: [[META15]], scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META17]])
+; CHECK: [[META28]] = !DILocalVariable(name: "entry", scope: [[DBG27]], file: [[META1]], line: 6, type: [[META4]])
+; CHECK: [[META29]] = !DILocation(line: 6, column: 17, scope: [[DBG27]])
+; CHECK: [[DBG30]] = distinct !DISubprogram(name: "scan", scope: [[META1]], file: [[META1]], line: 4, type: [[META15]], scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META17]])
+; CHECK: [[META31]] = !DILocalVariable(name: "entry", scope: [[DBG30]], file: [[META1]], line: 6, type: [[META4]])
+; CHECK: [[META32]] = !DILocation(line: 6, column: 17, scope: [[DBG30]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/debuginfo-dce2.ll b/llvm/test/Transforms/InstCombine/debuginfo-dce2.ll
index 87981ee5694d4..fbb9ec16a0f60 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo-dce2.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo-dce2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S %s -o - | FileCheck %s
; RUN: opt -passes=instcombine -S %s -o - --try-experimental-debuginfo-iterators | FileCheck %s
@@ -18,6 +19,14 @@ target triple = "x86_64-pc-windows-msvc19.11.25508"
; Function Attrs: nounwind uwtable
define void @f(ptr %p) !dbg !11 {
+; CHECK-LABEL: define void @f(
+; CHECK-SAME: ptr [[P:%.*]]) !dbg [[DBG11:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[P]], [[META16:![0-9]+]], !DIExpression(), [[META18:![0-9]+]])
+; CHECK-NEXT: #dbg_value(ptr [[P]], [[META17:![0-9]+]], !DIExpression(), [[META19:![0-9]+]])
+; CHECK-NEXT: call void @use_as_void(ptr [[P]]), !dbg [[DBG20:![0-9]+]]
+; CHECK-NEXT: ret void, !dbg [[DBG21:![0-9]+]]
+;
entry:
call void @llvm.dbg.value(metadata ptr %p, metadata !16, metadata !DIExpression()), !dbg !18
call void @llvm.dbg.value(metadata ptr %p, metadata !17, metadata !DIExpression()), !dbg !20
@@ -25,15 +34,7 @@ entry:
ret void, !dbg !23
}
-; CHECK-LABEL: define void @f(ptr %p)
-; CHECK: #dbg_value(ptr %p, ![[P_VAR:[0-9]+]], !DIExpression(),
-; CHECK-NOT: bitcast
-; CHECK: #dbg_value(ptr %p, ![[Q_VAR:[0-9]+]], !DIExpression(),
-; CHECK-NOT: bitcast
-; CHECK: ret void
-; CHECK: ![[P_VAR]] = !DILocalVariable(name: "p", {{.*}})
-; CHECK: ![[Q_VAR]] = !DILocalVariable(name: "q", {{.*}})
declare void @use_as_void(ptr)
@@ -67,3 +68,22 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
!21 = !DILocation(line: 4, column: 15, scope: !11)
!22 = !DILocation(line: 4, column: 3, scope: !11)
!23 = !DILocation(line: 5, column: 1, scope: !11)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}} ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]], retainedTypes: [[META3:![0-9]+]])
+; CHECK: [[META1]] = !DIFile(filename: "t.c", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[META3]] = !{[[META4:![0-9]+]]}
+; CHECK: [[META4]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META5:![0-9]+]], size: 64)
+; CHECK: [[META5]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+; CHECK: [[DBG11]] = distinct !DISubprogram(name: "f", scope: [[META1]], file: [[META1]], line: 2, type: [[META12:![0-9]+]], scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META15:![0-9]+]])
+; CHECK: [[META12]] = !DISubroutineType(types: [[META13:![0-9]+]])
+; CHECK: [[META13]] = !{null, [[META14:![0-9]+]]}
+; CHECK: [[META14]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64)
+; CHECK: [[META15]] = !{[[META16]], [[META17]]}
+; CHECK: [[META16]] = !DILocalVariable(name: "p", arg: 1, scope: [[DBG11]], file: [[META1]], line: 2, type: [[META14]])
+; CHECK: [[META17]] = !DILocalVariable(name: "q", scope: [[DBG11]], file: [[META1]], line: 3, type: [[META4]])
+; CHECK: [[META18]] = !DILocation(line: 2, column: 14, scope: [[DBG11]])
+; CHECK: [[META19]] = !DILocation(line: 3, column: 8, scope: [[DBG11]])
+; CHECK: [[DBG20]] = !DILocation(line: 4, column: 3, scope: [[DBG11]])
+; CHECK: [[DBG21]] = !DILocation(line: 5, column: 1, scope: [[DBG11]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll b/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
index feea036519b85..c1061b6c27cf5 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo-scalable-typesize.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
; RUN: opt --try-experimental-debuginfo-iterators -passes=instcombine -S < %s | FileCheck %s
@@ -6,8 +7,16 @@
; `TypeSize` to `uint64_t`. This particular TypeSize message only occurred when
; debug info was available.
-; CHECK-LABEL: @debug_local_scalable(
define <vscale x 2 x double> @debug_local_scalable(<vscale x 2 x double> %tostore) {
+; CHECK-LABEL: define <vscale x 2 x double> @debug_local_scalable(
+; CHECK-SAME: <vscale x 2 x double> [[TOSTORE:%.*]]) {
+; CHECK-NEXT: [[VX:%.*]] = alloca <vscale x 2 x double>, align 16
+; CHECK-NEXT: #dbg_value(<vscale x 2 x double> [[TOSTORE]], [[META3:![0-9]+]], !DIExpression(), [[META5:![0-9]+]])
+; CHECK-NEXT: store <vscale x 2 x double> [[TOSTORE]], ptr [[VX]], align 16
+; CHECK-NEXT: #dbg_value(ptr [[VX]], [[META3]], !DIExpression(DW_OP_deref), [[META5]])
+; CHECK-NEXT: [[RET:%.*]] = call <vscale x 2 x double> @f(ptr nonnull [[VX]])
+; CHECK-NEXT: ret <vscale x 2 x double> [[RET]]
+;
%vx = alloca <vscale x 2 x double>, align 16
call void @llvm.dbg.declare(metadata ptr %vx, metadata !3, metadata !DIExpression()), !dbg !5
store <vscale x 2 x double> %tostore, ptr %vx, align 16
@@ -18,6 +27,11 @@ define <vscale x 2 x double> @debug_local_scalable(<vscale x 2 x double> %tostor
declare <vscale x 2 x double> @f(ptr)
define float @debug_scalablevec_bitcast_to_scalar() {
+; CHECK-LABEL: define float @debug_scalablevec_bitcast_to_scalar() {
+; CHECK-NEXT: [[V_ADDR:%.*]] = alloca <vscale x 4 x float>, align 16
+; CHECK-NEXT: [[B:%.*]] = load float, ptr [[V_ADDR]], align 16
+; CHECK-NEXT: ret float [[B]]
+;
%v.addr = alloca <vscale x 4 x float>, align 16
call void @llvm.dbg.declare(metadata ptr %v.addr, metadata !3, metadata !DIExpression()), !dbg !5
%b = load float, ptr %v.addr, align 16
@@ -35,3 +49,10 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata)
!3 = !DILocalVariable(scope: !4)
!4 = distinct !DISubprogram(unit: !0)
!5 = !DILocation(scope: !4)
+;.
+; CHECK: [[META1:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META2:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: NoDebug)
+; CHECK: [[META2]] = !DIFile(filename: "/tmp/test.c", directory: {{.*}})
+; CHECK: [[META3]] = !DILocalVariable(scope: [[META4:![0-9]+]])
+; CHECK: [[META4]] = distinct !DISubprogram(scope: null, spFlags: DISPFlagDefinition, unit: [[META1]])
+; CHECK: [[META5]] = !DILocation(line: 0, scope: [[META4]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/debuginfo-sink.ll b/llvm/test/Transforms/InstCombine/debuginfo-sink.ll
index c02aefe0723c5..854aca7d2de34 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo-sink.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo-sink.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt %s -passes=instcombine -S | FileCheck %s
; Test sinking of dbg.values when instcombine sinks associated instructions.
@@ -8,22 +9,25 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
; gets folded. The dbg.value should be duplicated in the block its sunk
; into, to maximise liveness.
;
-; CHECK-LABEL: define i32 @foo(ptr
-; CHECK: #dbg_value(ptr %a, !{{[0-9]+}},
-; CHECK-SAME: !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value),
-; CHECK-NEXT: br label %sink1
define i32 @foo(ptr %a) !dbg !7 {
+; CHECK-LABEL: define i32 @foo(
+; CHECK-SAME: ptr [[A:%.*]]) !dbg [[DBG6:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[A]], [[META11:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value), [[META12:![0-9]+]])
+; CHECK-NEXT: br label %[[SINK1:.*]]
+; CHECK: [[SINK1]]:
+; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[A]], i64 4
+; CHECK-NEXT: #dbg_value(ptr [[GEP]], [[META11]], !DIExpression(), [[META12]])
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[GEP]], align 4, !dbg [[META12]]
+; CHECK-NEXT: ret i32 [[TMP0]], !dbg [[META12]]
+;
entry:
%gep = getelementptr i32, ptr %a, i32 1
call void @llvm.dbg.value(metadata ptr %gep, metadata !16, metadata !12), !dbg !15
br label %sink1
sink1:
-; CHECK-LABEL: sink1:
-; CHECK: #dbg_value(ptr %gep,
-; CHECK-SAME: !{{[0-9]+}}, !DIExpression(),
-; CHECK-NEXT: load
%0 = load i32, ptr %gep, align 4, !dbg !15
ret i32 %0, !dbg !15
}
@@ -32,23 +36,30 @@ sink1:
; dbg.value sunk, but an undef dbg.value is left to terminate any earlier
; value range.
-; CHECK-LABEL: define i32 @bar(
-; CHECK: #dbg_value(ptr poison,
-; CHECK-NEXT: br label %sink2
define i32 @bar(ptr %a, i32 %b) !dbg !70 {
+; CHECK-LABEL: define i32 @bar(
+; CHECK-SAME: ptr [[A:%.*]], i32 [[B:%.*]]) !dbg [[DBG13:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr poison, [[META16:![0-9]+]], !DIExpression(), [[META17:![0-9]+]])
+; CHECK-NEXT: br label %[[SINK2:.*]]
+; CHECK: [[SINK2]]:
+; CHECK-NEXT: [[TMP0:%.*]] = sext i32 [[B]] to i64
+; CHECK-NEXT: [[TMP1:%.*]] = call i64 @llvm.vscale.i64()
+; CHECK-NEXT: [[TMP2:%.*]] = mul i64 [[TMP1]], [[TMP0]]
+; CHECK-NEXT: [[GEP_IDX:%.*]] = shl i64 [[TMP2]], 4
+; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[A]], i64 [[GEP_IDX]]
+; CHECK-NEXT: #dbg_value(ptr [[GEP]], [[META16]], !DIExpression(), [[META17]])
+; CHECK-NEXT: [[TMP3:%.*]] = load <vscale x 4 x i32>, ptr [[GEP]], align 16
+; CHECK-NEXT: [[EXTRACT:%.*]] = extractelement <vscale x 4 x i32> [[TMP3]], i64 1
+; CHECK-NEXT: ret i32 [[EXTRACT]]
+;
entry:
%gep = getelementptr <vscale x 4 x i32>, ptr %a, i32 %b
call void @llvm.dbg.value(metadata ptr %gep, metadata !73, metadata !12), !dbg !74
br label %sink2
sink2:
-; CHECK-LABEL: sink2:
-; CHECK: #dbg_value(ptr %gep,
-; CHECK-SAME: !{{[0-9]+}}, !DIExpression(),
-; CHECK-NEXT: load
-; CHECK-NEXT: extractelement
-; CHECK-NEXT: ret
%0 = load <vscale x 4 x i32>, ptr %gep
%extract = extractelement <vscale x 4 x i32> %0, i32 1
ret i32 %extract
@@ -58,14 +69,20 @@ sink2:
; only the last use is cloned into the sunk block, and that both of the
; original dbg.values are salvaged.
;
-; CHECK-LABEL: define i32 @baz(ptr
-; CHECK: #dbg_value(ptr %a, !{{[0-9]+}},
-; CHECK-SAME: !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value),
-; CHECK-NEXT: #dbg_value(ptr %a, !{{[0-9]+}},
-; CHECK-SAME: !DIExpression(DW_OP_plus_uconst, 9, DW_OP_stack_value),
-; CHECK-NEXT: br label %sink1
define i32 @baz(ptr %a) !dbg !80 {
+; CHECK-LABEL: define i32 @baz(
+; CHECK-SAME: ptr [[A:%.*]]) !dbg [[DBG18:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[A]], [[META19:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 4, DW_OP_stack_value), [[META20:![0-9]+]])
+; CHECK-NEXT: #dbg_value(ptr [[A]], [[META19]], !DIExpression(DW_OP_plus_uconst, 9, DW_OP_stack_value), [[META21:![0-9]+]])
+; CHECK-NEXT: br label %[[SINK1:.*]]
+; CHECK: [[SINK1]]:
+; CHECK-NEXT: [[GEP:%.*]] = getelementptr i8, ptr [[A]], i64 4
+; CHECK-NEXT: #dbg_value(ptr [[GEP]], [[META19]], !DIExpression(DW_OP_plus_uconst, 5), [[META21]])
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[GEP]], align 4, !dbg [[META21]]
+; CHECK-NEXT: ret i32 [[TMP0]], !dbg [[META21]]
+;
entry:
%gep = getelementptr i32, ptr %a, i32 1
call void @llvm.dbg.value(metadata ptr %gep, metadata !83, metadata !12), !dbg !84
@@ -73,10 +90,6 @@ entry:
br label %sink1
sink1:
-; CHECK-LABEL: sink1:
-; CHECK: #dbg_value(ptr %gep,
-; CHECK-SAME: !{{[0-9]+}}, !DIExpression(DW_OP_plus_uconst, 5),
-; CHECK-NEXT: load
%0 = load i32, ptr %gep, align 4, !dbg !85
ret i32 %0, !dbg !85
}
@@ -109,3 +122,23 @@ sink1:
!83 = !DILocalVariable(name: "l", scope: !80, file: !1, line: 2, type: !10)
!84 = !DILocation(line: 5, column: 3, scope: !80)
!85 = !DILocation(line: 6, column: 3, scope: !80)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "clang", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug)
+; CHECK: [[META1]] = !DIFile(filename: "a.c", directory: {{.*}})
+; CHECK: [[DBG6]] = distinct !DISubprogram(name: "foo", scope: [[META1]], file: [[META1]], line: 2, type: [[META7:![0-9]+]], scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META10:![0-9]+]])
+; CHECK: [[META7]] = !DISubroutineType(types: [[META8:![0-9]+]])
+; CHECK: [[META8]] = !{[[META9:![0-9]+]], [[META9]]}
+; CHECK: [[META9]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+; CHECK: [[META10]] = !{}
+; CHECK: [[META11]] = !DILocalVariable(name: "h", scope: [[DBG6]], file: [[META1]], line: 4, type: [[META9]])
+; CHECK: [[META12]] = !DILocation(line: 5, column: 3, scope: [[DBG6]])
+; CHECK: [[DBG13]] = distinct !DISubprogram(name: "bar", scope: [[META1]], file: [[META1]], line: 2, type: [[META14:![0-9]+]], scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META10]])
+; CHECK: [[META14]] = !DISubroutineType(types: [[META15:![0-9]+]])
+; CHECK: [[META15]] = !{[[META9]], [[META9]], [[META9]]}
+; CHECK: [[META16]] = !DILocalVariable(name: "k", scope: [[DBG13]], file: [[META1]], line: 2, type: [[META9]])
+; CHECK: [[META17]] = !DILocation(line: 5, column: 3, scope: [[DBG13]])
+; CHECK: [[DBG18]] = distinct !DISubprogram(name: "baz", scope: [[META1]], file: [[META1]], line: 2, type: [[META7]], scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META0]], retainedNodes: [[META10]])
+; CHECK: [[META19]] = !DILocalVariable(name: "l", scope: [[DBG18]], file: [[META1]], line: 2, type: [[META9]])
+; CHECK: [[META20]] = !DILocation(line: 5, column: 3, scope: [[DBG18]])
+; CHECK: [[META21]] = !DILocation(line: 6, column: 3, scope: [[DBG18]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/debuginfo-skip.ll b/llvm/test/Transforms/InstCombine/debuginfo-skip.ll
index 9aebbabf4eb1a..b858de5d2b8b0 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo-skip.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo-skip.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -instcombine-lower-dbg-declare=0 < %s -passes=instcombine -S | FileCheck %s
; RUN: opt -instcombine-lower-dbg-declare=1 < %s -passes=instcombine -S | FileCheck %s
@@ -16,11 +17,6 @@ entry:
; Instcombine can remove the alloca and forward the load to store, but it
; should convert the declare to dbg value.
-; CHECK-LABEL: define i32 @foo(i32 %j)
-; CHECK-NOT: alloca
-; CHECK: #dbg_value(i32 %j, {{.*}})
-; CHECK: #dbg_value(i32 10, {{.*}})
-; CHECK: ret i32 %j
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
@@ -46,3 +42,5 @@ declare void @llvm.dbg.value(metadata, metadata, metadata) #1
!14 = !DILocation(line: 5, column: 10, scope: !7)
!15 = !DILocation(line: 5, column: 3, scope: !7)
!16 = !DILocalVariable(name: "h", scope: !7, file: !1, line: 4, type: !10)
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; CHECK: {{.*}}
diff --git a/llvm/test/Transforms/InstCombine/debuginfo-variables.ll b/llvm/test/Transforms/InstCombine/debuginfo-variables.ll
index f25cf2782e095..fab3381b46674 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo-variables.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo-variables.ll
@@ -1,26 +1,32 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=debugify,instcombine -S | FileCheck %s
; RUN: opt < %s -passes=debugify,instcombine -S --try-experimental-debuginfo-iterators | FileCheck %s
declare void @escape32(i32)
define i64 @test_sext_zext(i16 %A) {
-; CHECK-LABEL: @test_sext_zext(
-; CHECK-NEXT: [[C2:%.*]] = zext i16 %A to i64
-; CHECK-NEXT: #dbg_value(i64 [[C2]], {{.*}}, !DIExpression(),
-; CHECK-NEXT: #dbg_value(i64 [[C2]], {{.*}}, !DIExpression(),
+; CHECK-LABEL: define i64 @test_sext_zext(
+; CHECK-SAME: i16 [[A:%.*]]) !dbg [[DBG5:![0-9]+]] {
+; CHECK-NEXT: [[C2:%.*]] = zext i16 [[A]] to i64, !dbg [[DBG13:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i64 [[C2]], [[META9:![0-9]+]], !DIExpression(), [[META14:![0-9]+]])
+; CHECK-NEXT: #dbg_value(i64 [[C2]], [[META11:![0-9]+]], !DIExpression(), [[DBG13]])
+; CHECK-NEXT: ret i64 [[C2]], !dbg [[DBG15:![0-9]+]]
+;
%c1 = zext i16 %A to i32
%c2 = sext i32 %c1 to i64
ret i64 %c2
}
define i64 @test_used_sext_zext(i16 %A) {
-; CHECK-LABEL: @test_used_sext_zext(
-; CHECK-NEXT: [[C1:%.*]] = zext i16 %A to i32
-; CHECK-NEXT: #dbg_value(i32 [[C1]], {{.*}}, !DIExpression(),
-; CHECK-NEXT: [[C2:%.*]] = zext i16 %A to i64
-; CHECK-NEXT: #dbg_value(i64 [[C2]], {{.*}}, !DIExpression(),
-; CHECK-NEXT: call void @escape32(i32 %c1)
-; CHECK-NEXT: ret i64 %c2
+; CHECK-LABEL: define i64 @test_used_sext_zext(
+; CHECK-SAME: i16 [[A:%.*]]) !dbg [[DBG16:![0-9]+]] {
+; CHECK-NEXT: [[C1:%.*]] = zext i16 [[A]] to i32, !dbg [[DBG20:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i32 [[C1]], [[META18:![0-9]+]], !DIExpression(), [[DBG20]])
+; CHECK-NEXT: [[C2:%.*]] = zext i16 [[A]] to i64, !dbg [[DBG21:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i64 [[C2]], [[META19:![0-9]+]], !DIExpression(), [[DBG21]])
+; CHECK-NEXT: call void @escape32(i32 [[C1]]), !dbg [[DBG22:![0-9]+]]
+; CHECK-NEXT: ret i64 [[C2]], !dbg [[DBG23:![0-9]+]]
+;
%c1 = zext i16 %A to i32
%c2 = sext i32 %c1 to i64
call void @escape32(i32 %c1)
@@ -28,96 +34,225 @@ define i64 @test_used_sext_zext(i16 %A) {
}
define i32 @test_cast_select(i1 %cond) {
-; CHECK-LABEL: @test_cast_select(
-; CHECK-NEXT: [[sel:%.*]] = select i1 %cond, i32 3, i32 5
-; CHECK-NEXT: #dbg_value(i32 [[sel]], {{.*}}, !DIExpression(),
-; CHECK-NEXT: #dbg_value(i32 [[sel]], {{.*}}, !DIExpression(),
-; CHECK-NEXT: ret i32 [[sel]]
+; CHECK-LABEL: define i32 @test_cast_select(
+; CHECK-SAME: i1 [[COND:%.*]]) !dbg [[DBG24:![0-9]+]] {
+; CHECK-NEXT: [[CAST:%.*]] = select i1 [[COND]], i32 3, i32 5, !dbg [[DBG29:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i32 [[CAST]], [[META26:![0-9]+]], !DIExpression(), [[META30:![0-9]+]])
+; CHECK-NEXT: #dbg_value(i32 [[CAST]], [[META28:![0-9]+]], !DIExpression(), [[DBG29]])
+; CHECK-NEXT: ret i32 [[CAST]], !dbg [[DBG31:![0-9]+]]
+;
%sel = select i1 %cond, i16 3, i16 5
%cast = zext i16 %sel to i32
ret i32 %cast
}
define void @test_or(i64 %A) {
-; CHECK-LABEL: @test_or(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 256, DW_OP_or, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_or(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG32:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META34:![0-9]+]], !DIExpression(DW_OP_constu, 256, DW_OP_or, DW_OP_stack_value), [[META35:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG36:![0-9]+]]
+;
%1 = or i64 %A, 256
ret void
}
define void @test_xor(i32 %A) {
-; CHECK-LABEL: @test_xor(
-; CHECK-NEXT: #dbg_value(i32 %A, {{.*}}, !DIExpression(DW_OP_constu, 1, DW_OP_xor, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_xor(
+; CHECK-SAME: i32 [[A:%.*]]) !dbg [[DBG37:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i32 [[A]], [[META39:![0-9]+]], !DIExpression(DW_OP_constu, 1, DW_OP_xor, DW_OP_stack_value), [[META40:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG41:![0-9]+]]
+;
%1 = xor i32 %A, 1
ret void
}
define void @test_sub_neg(i64 %A) {
-; CHECK-LABEL: @test_sub_neg(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_sub_neg(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG42:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META44:![0-9]+]], !DIExpression(DW_OP_plus_uconst, 1, DW_OP_stack_value), [[META45:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG46:![0-9]+]]
+;
%1 = sub i64 %A, -1
ret void
}
define void @test_sub_pos(i64 %A) {
-; CHECK-LABEL: @test_sub_pos(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 1, DW_OP_minus, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_sub_pos(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG47:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META49:![0-9]+]], !DIExpression(DW_OP_constu, 1, DW_OP_minus, DW_OP_stack_value), [[META50:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG51:![0-9]+]]
+;
%1 = sub i64 %A, 1
ret void
}
define void @test_shl(i64 %A) {
-; CHECK-LABEL: @test_shl(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 7, DW_OP_shl, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_shl(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG52:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META54:![0-9]+]], !DIExpression(DW_OP_constu, 7, DW_OP_shl, DW_OP_stack_value), [[META55:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG56:![0-9]+]]
+;
%1 = shl i64 %A, 7
ret void
}
define void @test_lshr(i64 %A) {
-; CHECK-LABEL: @test_lshr(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 7, DW_OP_shr, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_lshr(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG57:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META59:![0-9]+]], !DIExpression(DW_OP_constu, 7, DW_OP_shr, DW_OP_stack_value), [[META60:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG61:![0-9]+]]
+;
%1 = lshr i64 %A, 7
ret void
}
define void @test_ashr(i64 %A) {
-; CHECK-LABEL: @test_ashr(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 7, DW_OP_shra, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_ashr(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG62:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META64:![0-9]+]], !DIExpression(DW_OP_constu, 7, DW_OP_shra, DW_OP_stack_value), [[META65:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG66:![0-9]+]]
+;
%1 = ashr i64 %A, 7
ret void
}
define void @test_mul(i64 %A) {
-; CHECK-LABEL: @test_mul(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 7, DW_OP_mul, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_mul(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG67:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META69:![0-9]+]], !DIExpression(DW_OP_constu, 7, DW_OP_mul, DW_OP_stack_value), [[META70:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG71:![0-9]+]]
+;
%1 = mul i64 %A, 7
ret void
}
define void @test_sdiv(i64 %A) {
-; CHECK-LABEL: @test_sdiv(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 7, DW_OP_div, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_sdiv(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG72:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META74:![0-9]+]], !DIExpression(DW_OP_constu, 7, DW_OP_div, DW_OP_stack_value), [[META75:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG76:![0-9]+]]
+;
%1 = sdiv i64 %A, 7
ret void
}
define void @test_srem(i64 %A) {
-; CHECK-LABEL: @test_srem(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 7, DW_OP_mod, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_srem(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG77:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META79:![0-9]+]], !DIExpression(DW_OP_constu, 7, DW_OP_mod, DW_OP_stack_value), [[META80:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG81:![0-9]+]]
+;
%1 = srem i64 %A, 7
ret void
}
define void @test_ptrtoint(ptr %P) {
-; CHECK-LABEL: @test_ptrtoint
-; CHECK-NEXT: #dbg_value(ptr %P, {{.*}}, !DIExpression(),
+; CHECK-LABEL: define void @test_ptrtoint(
+; CHECK-SAME: ptr [[P:%.*]]) !dbg [[DBG82:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(ptr [[P]], [[META84:![0-9]+]], !DIExpression(), [[META85:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG86:![0-9]+]]
+;
%1 = ptrtoint ptr %P to i64
ret void
}
define void @test_and(i64 %A) {
-; CHECK-LABEL: @test_and(
-; CHECK-NEXT: #dbg_value(i64 %A, {{.*}}, !DIExpression(DW_OP_constu, 256, DW_OP_and, DW_OP_stack_value),
+; CHECK-LABEL: define void @test_and(
+; CHECK-SAME: i64 [[A:%.*]]) !dbg [[DBG87:![0-9]+]] {
+; CHECK-NEXT: #dbg_value(i64 [[A]], [[META89:![0-9]+]], !DIExpression(DW_OP_constu, 256, DW_OP_and, DW_OP_stack_value), [[META90:![0-9]+]])
+; CHECK-NEXT: ret void, !dbg [[DBG91:![0-9]+]]
+;
%1 = and i64 %A, 256
ret void
}
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: [[META1:![0-9]+]], producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
+; CHECK: [[META1]] = !DIFile(filename: "<stdin>", directory: {{.*}})
+; CHECK: [[DBG5]] = distinct !DISubprogram(name: "test_sext_zext", linkageName: "test_sext_zext", scope: null, file: [[META1]], line: 1, type: [[META6:![0-9]+]], scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META8:![0-9]+]])
+; CHECK: [[META6]] = !DISubroutineType(types: [[META7:![0-9]+]])
+; CHECK: [[META7]] = !{}
+; CHECK: [[META8]] = !{[[META9]], [[META11]]}
+; CHECK: [[META9]] = !DILocalVariable(name: "1", scope: [[DBG5]], file: [[META1]], line: 1, type: [[META10:![0-9]+]])
+; CHECK: [[META10]] = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
+; CHECK: [[META11]] = !DILocalVariable(name: "2", scope: [[DBG5]], file: [[META1]], line: 2, type: [[META12:![0-9]+]])
+; CHECK: [[META12]] = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)
+; CHECK: [[DBG13]] = !DILocation(line: 2, column: 1, scope: [[DBG5]])
+; CHECK: [[META14]] = !DILocation(line: 1, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG15]] = !DILocation(line: 3, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG16]] = distinct !DISubprogram(name: "test_used_sext_zext", linkageName: "test_used_sext_zext", scope: null, file: [[META1]], line: 4, type: [[META6]], scopeLine: 4, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META17:![0-9]+]])
+; CHECK: [[META17]] = !{[[META18]], [[META19]]}
+; CHECK: [[META18]] = !DILocalVariable(name: "3", scope: [[DBG16]], file: [[META1]], line: 4, type: [[META10]])
+; CHECK: [[META19]] = !DILocalVariable(name: "4", scope: [[DBG16]], file: [[META1]], line: 5, type: [[META12]])
+; CHECK: [[DBG20]] = !DILocation(line: 4, column: 1, scope: [[DBG16]])
+; CHECK: [[DBG21]] = !DILocation(line: 5, column: 1, scope: [[DBG16]])
+; CHECK: [[DBG22]] = !DILocation(line: 6, column: 1, scope: [[DBG16]])
+; CHECK: [[DBG23]] = !DILocation(line: 7, column: 1, scope: [[DBG16]])
+; CHECK: [[DBG24]] = distinct !DISubprogram(name: "test_cast_select", linkageName: "test_cast_select", scope: null, file: [[META1]], line: 8, type: [[META6]], scopeLine: 8, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META25:![0-9]+]])
+; CHECK: [[META25]] = !{[[META26]], [[META28]]}
+; CHECK: [[META26]] = !DILocalVariable(name: "5", scope: [[DBG24]], file: [[META1]], line: 8, type: [[META27:![0-9]+]])
+; CHECK: [[META27]] = !DIBasicType(name: "ty16", size: 16, encoding: DW_ATE_unsigned)
+; CHECK: [[META28]] = !DILocalVariable(name: "6", scope: [[DBG24]], file: [[META1]], line: 9, type: [[META10]])
+; CHECK: [[DBG29]] = !DILocation(line: 9, column: 1, scope: [[DBG24]])
+; CHECK: [[META30]] = !DILocation(line: 8, column: 1, scope: [[DBG24]])
+; CHECK: [[DBG31]] = !DILocation(line: 10, column: 1, scope: [[DBG24]])
+; CHECK: [[DBG32]] = distinct !DISubprogram(name: "test_or", linkageName: "test_or", scope: null, file: [[META1]], line: 11, type: [[META6]], scopeLine: 11, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META33:![0-9]+]])
+; CHECK: [[META33]] = !{[[META34]]}
+; CHECK: [[META34]] = !DILocalVariable(name: "7", scope: [[DBG32]], file: [[META1]], line: 11, type: [[META12]])
+; CHECK: [[META35]] = !DILocation(line: 11, column: 1, scope: [[DBG32]])
+; CHECK: [[DBG36]] = !DILocation(line: 12, column: 1, scope: [[DBG32]])
+; CHECK: [[DBG37]] = distinct !DISubprogram(name: "test_xor", linkageName: "test_xor", scope: null, file: [[META1]], line: 13, type: [[META6]], scopeLine: 13, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META38:![0-9]+]])
+; CHECK: [[META38]] = !{[[META39]]}
+; CHECK: [[META39]] = !DILocalVariable(name: "8", scope: [[DBG37]], file: [[META1]], line: 13, type: [[META10]])
+; CHECK: [[META40]] = !DILocation(line: 13, column: 1, scope: [[DBG37]])
+; CHECK: [[DBG41]] = !DILocation(line: 14, column: 1, scope: [[DBG37]])
+; CHECK: [[DBG42]] = distinct !DISubprogram(name: "test_sub_neg", linkageName: "test_sub_neg", scope: null, file: [[META1]], line: 15, type: [[META6]], scopeLine: 15, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META43:![0-9]+]])
+; CHECK: [[META43]] = !{[[META44]]}
+; CHECK: [[META44]] = !DILocalVariable(name: "9", scope: [[DBG42]], file: [[META1]], line: 15, type: [[META12]])
+; CHECK: [[META45]] = !DILocation(line: 15, column: 1, scope: [[DBG42]])
+; CHECK: [[DBG46]] = !DILocation(line: 16, column: 1, scope: [[DBG42]])
+; CHECK: [[DBG47]] = distinct !DISubprogram(name: "test_sub_pos", linkageName: "test_sub_pos", scope: null, file: [[META1]], line: 17, type: [[META6]], scopeLine: 17, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META48:![0-9]+]])
+; CHECK: [[META48]] = !{[[META49]]}
+; CHECK: [[META49]] = !DILocalVariable(name: "10", scope: [[DBG47]], file: [[META1]], line: 17, type: [[META12]])
+; CHECK: [[META50]] = !DILocation(line: 17, column: 1, scope: [[DBG47]])
+; CHECK: [[DBG51]] = !DILocation(line: 18, column: 1, scope: [[DBG47]])
+; CHECK: [[DBG52]] = distinct !DISubprogram(name: "test_shl", linkageName: "test_shl", scope: null, file: [[META1]], line: 19, type: [[META6]], scopeLine: 19, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META53:![0-9]+]])
+; CHECK: [[META53]] = !{[[META54]]}
+; CHECK: [[META54]] = !DILocalVariable(name: "11", scope: [[DBG52]], file: [[META1]], line: 19, type: [[META12]])
+; CHECK: [[META55]] = !DILocation(line: 19, column: 1, scope: [[DBG52]])
+; CHECK: [[DBG56]] = !DILocation(line: 20, column: 1, scope: [[DBG52]])
+; CHECK: [[DBG57]] = distinct !DISubprogram(name: "test_lshr", linkageName: "test_lshr", scope: null, file: [[META1]], line: 21, type: [[META6]], scopeLine: 21, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META58:![0-9]+]])
+; CHECK: [[META58]] = !{[[META59]]}
+; CHECK: [[META59]] = !DILocalVariable(name: "12", scope: [[DBG57]], file: [[META1]], line: 21, type: [[META12]])
+; CHECK: [[META60]] = !DILocation(line: 21, column: 1, scope: [[DBG57]])
+; CHECK: [[DBG61]] = !DILocation(line: 22, column: 1, scope: [[DBG57]])
+; CHECK: [[DBG62]] = distinct !DISubprogram(name: "test_ashr", linkageName: "test_ashr", scope: null, file: [[META1]], line: 23, type: [[META6]], scopeLine: 23, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META63:![0-9]+]])
+; CHECK: [[META63]] = !{[[META64]]}
+; CHECK: [[META64]] = !DILocalVariable(name: "13", scope: [[DBG62]], file: [[META1]], line: 23, type: [[META12]])
+; CHECK: [[META65]] = !DILocation(line: 23, column: 1, scope: [[DBG62]])
+; CHECK: [[DBG66]] = !DILocation(line: 24, column: 1, scope: [[DBG62]])
+; CHECK: [[DBG67]] = distinct !DISubprogram(name: "test_mul", linkageName: "test_mul", scope: null, file: [[META1]], line: 25, type: [[META6]], scopeLine: 25, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META68:![0-9]+]])
+; CHECK: [[META68]] = !{[[META69]]}
+; CHECK: [[META69]] = !DILocalVariable(name: "14", scope: [[DBG67]], file: [[META1]], line: 25, type: [[META12]])
+; CHECK: [[META70]] = !DILocation(line: 25, column: 1, scope: [[DBG67]])
+; CHECK: [[DBG71]] = !DILocation(line: 26, column: 1, scope: [[DBG67]])
+; CHECK: [[DBG72]] = distinct !DISubprogram(name: "test_sdiv", linkageName: "test_sdiv", scope: null, file: [[META1]], line: 27, type: [[META6]], scopeLine: 27, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META73:![0-9]+]])
+; CHECK: [[META73]] = !{[[META74]]}
+; CHECK: [[META74]] = !DILocalVariable(name: "15", scope: [[DBG72]], file: [[META1]], line: 27, type: [[META12]])
+; CHECK: [[META75]] = !DILocation(line: 27, column: 1, scope: [[DBG72]])
+; CHECK: [[DBG76]] = !DILocation(line: 28, column: 1, scope: [[DBG72]])
+; CHECK: [[DBG77]] = distinct !DISubprogram(name: "test_srem", linkageName: "test_srem", scope: null, file: [[META1]], line: 29, type: [[META6]], scopeLine: 29, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META78:![0-9]+]])
+; CHECK: [[META78]] = !{[[META79]]}
+; CHECK: [[META79]] = !DILocalVariable(name: "16", scope: [[DBG77]], file: [[META1]], line: 29, type: [[META12]])
+; CHECK: [[META80]] = !DILocation(line: 29, column: 1, scope: [[DBG77]])
+; CHECK: [[DBG81]] = !DILocation(line: 30, column: 1, scope: [[DBG77]])
+; CHECK: [[DBG82]] = distinct !DISubprogram(name: "test_ptrtoint", linkageName: "test_ptrtoint", scope: null, file: [[META1]], line: 31, type: [[META6]], scopeLine: 31, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META83:![0-9]+]])
+; CHECK: [[META83]] = !{[[META84]]}
+; CHECK: [[META84]] = !DILocalVariable(name: "17", scope: [[DBG82]], file: [[META1]], line: 31, type: [[META12]])
+; CHECK: [[META85]] = !DILocation(line: 31, column: 1, scope: [[DBG82]])
+; CHECK: [[DBG86]] = !DILocation(line: 32, column: 1, scope: [[DBG82]])
+; CHECK: [[DBG87]] = distinct !DISubprogram(name: "test_and", linkageName: "test_and", scope: null, file: [[META1]], line: 33, type: [[META6]], scopeLine: 33, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META88:![0-9]+]])
+; CHECK: [[META88]] = !{[[META89]]}
+; CHECK: [[META89]] = !DILocalVariable(name: "18", scope: [[DBG87]], file: [[META1]], line: 33, type: [[META12]])
+; CHECK: [[META90]] = !DILocation(line: 33, column: 1, scope: [[DBG87]])
+; CHECK: [[DBG91]] = !DILocation(line: 34, column: 1, scope: [[DBG87]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/debuginfo.ll b/llvm/test/Transforms/InstCombine/debuginfo.ll
index 73e925236d0a7..30c31c9bcbae5 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -instcombine-lower-dbg-declare=0 -S \
; RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=NOLOWER
; RUN: opt < %s -passes=instcombine -instcombine-lower-dbg-declare=1 -S | FileCheck %s
@@ -18,6 +19,16 @@ declare i64 @llvm.objectsize.i64.p0(ptr, i1) nounwind readnone
declare ptr @passthru_callee(ptr, i32, i64, i64)
define ptr @passthru(ptr %a, i32 %b, i64 %c) !dbg !1 {
+; NOLOWER-LABEL: define ptr @passthru(
+; NOLOWER-SAME: ptr [[A:%.*]], i32 [[B:%.*]], i64 [[C:%.*]]) !dbg [[DBG4:![0-9]+]] {
+; NOLOWER-NEXT: [[ENTRY:.*:]]
+; NOLOWER-NEXT: #dbg_value(ptr [[A]], [[META10:![0-9]+]], !DIExpression(), [[META15:![0-9]+]])
+; NOLOWER-NEXT: #dbg_value(i32 [[B]], [[META11:![0-9]+]], !DIExpression(), [[META15]])
+; NOLOWER-NEXT: #dbg_value(i64 [[C]], [[META13:![0-9]+]], !DIExpression(), [[META15]])
+; NOLOWER-NEXT: [[TMP0:%.*]] = call i64 @llvm.objectsize.i64.p0(ptr [[A]], i1 false, i1 false, i1 false), !dbg [[DBG16:![0-9]+]]
+; NOLOWER-NEXT: [[CALL:%.*]] = call ptr @passthru_callee(ptr [[A]], i32 [[B]], i64 [[C]], i64 [[TMP0]]), !dbg [[DBG16]]
+; NOLOWER-NEXT: ret ptr [[CALL]], !dbg [[DBG16]]
+;
entry:
%a.addr = alloca ptr, align 8
%b.addr = alloca i32, align 4
@@ -37,23 +48,20 @@ entry:
ret ptr %call, !dbg !21
}
-; CHECK-LABEL: define ptr @passthru(ptr %a, i32 %b, i64 %c)
-; CHECK-NOT: alloca
-; CHECK-NOT: store
-; CHECK-NOT: #dbg_declare
-; CHECK: #dbg_value(ptr %a, {{.*}})
-; CHECK-NOT: store
-; CHECK: #dbg_value(i32 %b, {{.*}})
-; CHECK-NOT: store
-; CHECK: #dbg_value(i64 %c, {{.*}})
-; CHECK-NOT: store
-; CHECK: call ptr @passthru_callee(ptr %a, i32 %b, i64 %c, i64 %{{.*}})
declare void @tworegs_callee(i64, i64)
; Lowering dbg.declare in instcombine doesn't handle this case very well.
define void @tworegs(i64 %o.coerce0, i64 %o.coerce1) !dbg !31 {
+; CHECK-LABEL: define void @tworegs(
+; CHECK-SAME: i64 [[O_COERCE0:%.*]], i64 [[O_COERCE1:%.*]]) !dbg [[DBG19:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(i64 undef, [[META21:![0-9]+]], !DIExpression(), [[META26:![0-9]+]])
+; CHECK-NEXT: #dbg_value(i64 undef, [[META21]], !DIExpression(), [[META26]])
+; CHECK-NEXT: call void @tworegs_callee(i64 [[O_COERCE0]], i64 [[O_COERCE1]]), !dbg [[DBG27:![0-9]+]]
+; CHECK-NEXT: ret void, !dbg [[DBG27]]
+;
entry:
%o = alloca %struct.TwoRegs, align 8
%0 = getelementptr inbounds { i64, i64 }, ptr %o, i32 0, i32 0
@@ -69,17 +77,12 @@ entry:
ret void, !dbg !33
}
-; NOLOWER-LABEL: define void @tworegs(i64 %o.coerce0, i64 %o.coerce1)
-; NOLOWER-NOT: alloca
-; NOLOWER-NOT: store
-; NOLOWER-NOT: #dbg_declare
; Here we want to find: call void @llvm.dbg.value(metadata i64 %o.coerce0, metadata [[VARIABLE_O]], metadata !DIExpression(DW_OP_LLVM_fragment, 0, 64))
; NOLOWER: #dbg_value(i64 undef, {{.*}})
; NOLOWER-NOT: store
; Here we want to find: call void @llvm.dbg.value(metadata i64 %o.coerce1, metadata [[VARIABLE_O]], metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64))
; NOLOWER: #dbg_value(i64 undef, {{.*}})
; NOLOWER-NOT: store
-; NOLOWER: call void @tworegs_callee(i64 %o.coerce0, i64 %o.coerce1)
!llvm.dbg.cu = !{!3}
@@ -119,3 +122,21 @@ entry:
!39 = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: !36, file: !28, line: 1, baseType: !12, size: 64)
!40 = !DISubroutineType(types: !41)
!41 = !{!36}
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}}", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]], retainedTypes: [[META2]])
+; CHECK: [[META1]] = !DIFile(filename: "bits.c", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[META6:![0-9]+]] = !DISubroutineType(types: [[META7:![0-9]+]])
+; CHECK: [[META7]] = !{[[META8:![0-9]+]]}
+; CHECK: [[META8]] = !DIDerivedType(tag: DW_TAG_pointer_type, scope: [[META0]], baseType: null, size: 64, align: 64)
+; CHECK: [[META14:![0-9]+]] = !DIBasicType(name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
+; CHECK: [[DBG19]] = distinct !DISubprogram(name: "tworegs", scope: [[META1]], file: [[META1]], line: 4, type: [[META6]], scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META20:![0-9]+]])
+; CHECK: [[META20]] = !{[[META21]]}
+; CHECK: [[META21]] = !DILocalVariable(name: "o", arg: 1, scope: [[DBG19]], file: [[META1]], line: 4, type: [[META22:![0-9]+]])
+; CHECK: [[META22]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "TwoRegs", file: [[META1]], line: 1, size: 128, elements: [[META23:![0-9]+]])
+; CHECK: [[META23]] = !{[[META24:![0-9]+]], [[META25:![0-9]+]]}
+; CHECK: [[META24]] = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: [[META22]], file: [[META1]], line: 1, baseType: [[META14]], size: 64)
+; CHECK: [[META25]] = !DIDerivedType(tag: DW_TAG_member, name: "y", scope: [[META22]], file: [[META1]], line: 1, baseType: [[META14]], size: 64)
+; CHECK: [[META26]] = !DILocation(line: 0, scope: [[DBG19]])
+; CHECK: [[DBG27]] = !DILocation(line: 5, column: 3, scope: [[DBG19]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/debuginfo_add.ll b/llvm/test/Transforms/InstCombine/debuginfo_add.ll
index 98ac6662547b9..84e5b50ecaa54 100644
--- a/llvm/test/Transforms/InstCombine/debuginfo_add.ll
+++ b/llvm/test/Transforms/InstCombine/debuginfo_add.ll
@@ -1,10 +1,11 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine %s -o - -S | FileCheck %s
; RUN: opt -passes=instcombine %s -o - -S --try-experimental-debuginfo-iterators | FileCheck %s
; typedef struct v *v_t;
; struct v {
; unsigned long long p;
; };
-;
+;
; void f(v_t object, unsigned long long *start) {
; unsigned head_size;
; unsigned long long orig_start;
@@ -22,6 +23,35 @@ target triple = "thumbv7s-apple-ios5.0.0"
; Function Attrs: nounwind ssp
define void @f(ptr %object, ptr nocapture readonly %start, i1 %c1) local_unnamed_addr #0 !dbg !11 {
+; CHECK-LABEL: define void @f(
+; CHECK-SAME: ptr [[OBJECT:%.*]], ptr nocapture readonly [[START:%.*]], i1 [[C1:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] !dbg [[DBG11:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr [[OBJECT]], [[META21:![0-9]+]], !DIExpression(), [[META27:![0-9]+]])
+; CHECK-NEXT: #dbg_value(ptr [[START]], [[META22:![0-9]+]], !DIExpression(), [[META28:![0-9]+]])
+; CHECK-NEXT: #dbg_value(i64 poison, [[META25:![0-9]+]], !DIExpression(), [[META29:![0-9]+]])
+; CHECK-NEXT: #dbg_value(i64 poison, [[META26:![0-9]+]], !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value), [[META30:![0-9]+]])
+; CHECK-NEXT: #dbg_value(i32 undef, [[META23:![0-9]+]], !DIExpression(), [[META31:![0-9]+]])
+; CHECK-NEXT: br i1 [[C1]], label %[[FOR_END:.*]], label %[[FOR_BODY_LR_PH:.*]], !dbg [[META31]]
+; CHECK: [[FOR_BODY_LR_PH]]:
+; CHECK-NEXT: [[TMP0:%.*]] = load i64, ptr [[START]], align 4, !dbg [[DBG33:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i64 [[TMP0]], [[META25]], !DIExpression(), [[META29]])
+; CHECK-NEXT: #dbg_value(i64 [[TMP0]], [[META26]], !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value), [[META30]])
+; CHECK-NEXT: #dbg_value(i64 [[TMP0]], [[META26]], !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value), [[META30]])
+; CHECK-NEXT: br label %[[FOR_BODY:.*]], !dbg [[META31]]
+; CHECK: [[FOR_BODY]]:
+; CHECK-NEXT: [[OFFSET_010_IN:%.*]] = phi i64 [ [[TMP0]], %[[FOR_BODY_LR_PH]] ], [ [[OFFSET_010:%.*]], %[[FOR_BODY]] ]
+; CHECK-NEXT: [[HEAD_SIZE_09:%.*]] = phi i32 [ poison, %[[FOR_BODY_LR_PH]] ], [ [[SUB2:%.*]], %[[FOR_BODY]] ]
+; CHECK-NEXT: [[OFFSET_010]] = add i64 [[OFFSET_010_IN]], -4096
+; CHECK-NEXT: #dbg_value(i32 [[HEAD_SIZE_09]], [[META23]], !DIExpression(), [[META30]])
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 @use(i64 [[OFFSET_010]], ptr [[OBJECT]]) #[[ATTR1:[0-9]+]], !dbg [[DBG34:![0-9]+]]
+; CHECK-NEXT: [[SUB2]] = add i32 [[HEAD_SIZE_09]], -4096, !dbg [[DBG37:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i64 [[OFFSET_010]], [[META26]], !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value), [[META29]])
+; CHECK-NEXT: #dbg_value(i32 [[SUB2]], [[META23]], !DIExpression(), [[META30]])
+; CHECK-NEXT: [[TOBOOL:%.*]] = icmp eq i32 [[SUB2]], 0, !dbg [[META31]]
+; CHECK-NEXT: br i1 [[TOBOOL]], label %[[FOR_END]], label %[[FOR_BODY]], !dbg [[META31]], !llvm.loop [[LOOP38:![0-9]+]]
+; CHECK: [[FOR_END]]:
+; CHECK-NEXT: ret void, !dbg [[DBG40:![0-9]+]]
+;
entry:
tail call void @llvm.dbg.value(metadata ptr %object, metadata !21, metadata !DIExpression()), !dbg !27
tail call void @llvm.dbg.value(metadata ptr %start, metadata !22, metadata !DIExpression()), !dbg !28
@@ -35,14 +65,9 @@ entry:
for.body.lr.ph: ; preds = %entry
; The 'load' and the 'add' are sunken to this basic block. So let's verify that the related dbg.values are sunken as well.
; The add is later eliminated, so we verify that the dbg.value is salvaged by using DW_OP_minus.
- ; CHECK-LABEL: for.body.lr.ph:
- ; CHECK-NEXT: %0 = load
- ; CHECK-NEXT: #dbg_value(i64 %0, !25, !DIExpression(), !
- ; CHECK-NEXT: #dbg_value(i64 %0, !26, !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value), !
br label %for.body, !dbg !32
for.body: ; preds = %for.body.lr.ph, %for.body
- ; CHECK-LABEL: for.body:
%offset.010 = phi i64 [ %offset.08, %for.body.lr.ph ], [ %offset.0, %for.body ]
%head_size.09 = phi i32 [ poison, %for.body.lr.ph ], [ %sub2, %for.body ]
tail call void @llvm.dbg.value(metadata i32 %head_size.09, metadata !23, metadata !DIExpression()), !dbg !31
@@ -50,7 +75,6 @@ for.body: ; preds = %for.body.lr.ph, %fo
%sub2 = add i32 %head_size.09, -4096, !dbg !37
%offset.0 = add i64 %offset.010, -4096
tail call void @llvm.dbg.value(metadata i64 %offset.0, metadata !26, metadata !DIExpression()), !dbg !30
- ; CHECK: #dbg_value(i64 %offset.010, !26, !DIExpression(DW_OP_constu, 4096, DW_OP_minus, DW_OP_stack_value), !
tail call void @llvm.dbg.value(metadata i32 %sub2, metadata !23, metadata !DIExpression()), !dbg !31
%tobool = icmp eq i32 %sub2, 0, !dbg !32
br i1 %tobool, label %for.end, label %for.body, !dbg !32, !llvm.loop !38
@@ -113,3 +137,40 @@ attributes #3 = { nobuiltin }
!38 = distinct !{!38, !32, !39}
!39 = !DILocation(line: 14, column: 3, scope: !33)
!40 = !DILocation(line: 15, column: 1, scope: !11)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "{{.*}}clang version {{.*}} (llvm/trunk 317437)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]], retainedTypes: [[META3:![0-9]+]])
+; CHECK: [[META1]] = !DIFile(filename: "test.i", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[META3]] = !{[[META4:![0-9]+]]}
+; CHECK: [[META4]] = !DIBasicType(name: "long long unsigned int", size: 64, encoding: DW_ATE_unsigned)
+; CHECK: [[DBG11]] = distinct !DISubprogram(name: "f", scope: [[META1]], file: [[META1]], line: 6, type: [[META12:![0-9]+]], scopeLine: 6, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META20:![0-9]+]])
+; CHECK: [[META12]] = !DISubroutineType(types: [[META13:![0-9]+]])
+; CHECK: [[META13]] = !{null, [[META14:![0-9]+]], [[META19:![0-9]+]]}
+; CHECK: [[META14]] = !DIDerivedType(tag: DW_TAG_typedef, name: "v_t", file: [[META1]], line: 1, baseType: [[META15:![0-9]+]])
+; CHECK: [[META15]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META16:![0-9]+]], size: 32)
+; CHECK: [[META16]] = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "v", file: [[META1]], line: 2, size: 64, elements: [[META17:![0-9]+]])
+; CHECK: [[META17]] = !{[[META18:![0-9]+]]}
+; CHECK: [[META18]] = !DIDerivedType(tag: DW_TAG_member, name: "p", scope: [[META16]], file: [[META1]], line: 3, baseType: [[META4]], size: 64)
+; CHECK: [[META19]] = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: [[META4]], size: 32)
+; CHECK: [[META20]] = !{[[META21]], [[META22]], [[META23]], [[META25]], [[META26]]}
+; CHECK: [[META21]] = !DILocalVariable(name: "object", arg: 1, scope: [[DBG11]], file: [[META1]], line: 6, type: [[META14]])
+; CHECK: [[META22]] = !DILocalVariable(name: "start", arg: 2, scope: [[DBG11]], file: [[META1]], line: 6, type: [[META19]])
+; CHECK: [[META23]] = !DILocalVariable(name: "head_size", scope: [[DBG11]], file: [[META1]], line: 7, type: [[META24:![0-9]+]])
+; CHECK: [[META24]] = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
+; CHECK: [[META25]] = !DILocalVariable(name: "orig_start", scope: [[DBG11]], file: [[META1]], line: 8, type: [[META4]])
+; CHECK: [[META26]] = !DILocalVariable(name: "offset", scope: [[DBG11]], file: [[META1]], line: 9, type: [[META4]])
+; CHECK: [[META27]] = !DILocation(line: 6, column: 20, scope: [[DBG11]])
+; CHECK: [[META28]] = !DILocation(line: 6, column: 48, scope: [[DBG11]])
+; CHECK: [[META29]] = !DILocation(line: 7, column: 12, scope: [[DBG11]])
+; CHECK: [[META30]] = !DILocation(line: 10, column: 16, scope: [[DBG11]])
+; CHECK: [[META31]] = !DILocation(line: 11, column: 5, scope: [[META32:![0-9]+]])
+; CHECK: [[META32]] = distinct !DILexicalBlock(scope: [[DBG11]], file: [[META1]], line: 11, column: 5)
+; CHECK: [[DBG33]] = !DILocation(line: 8, column: 22, scope: [[DBG11]])
+; CHECK: [[DBG34]] = !DILocation(line: 13, column: 7, scope: [[META35:![0-9]+]])
+; CHECK: [[META35]] = distinct !DILexicalBlock(scope: [[META36:![0-9]+]], file: [[META1]], line: 12, column: 75)
+; CHECK: [[META36]] = distinct !DILexicalBlock(scope: [[META32]], file: [[META1]], line: 11, column: 5)
+; CHECK: [[DBG37]] = !DILocation(line: 12, column: 61, scope: [[META36]])
+; CHECK: [[LOOP38]] = distinct !{[[LOOP38]], [[META31]], [[META39:![0-9]+]]}
+; CHECK: [[META39]] = !DILocation(line: 14, column: 3, scope: [[META32]])
+; CHECK: [[DBG40]] = !DILocation(line: 15, column: 1, scope: [[DBG11]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/default-alignment.ll b/llvm/test/Transforms/InstCombine/default-alignment.ll
index c4a6124c29fb5..b1179fc89a368 100644
--- a/llvm/test/Transforms/InstCombine/default-alignment.ll
+++ b/llvm/test/Transforms/InstCombine/default-alignment.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=verify,instcombine < %s
%Foo = type <{ i8, x86_fp80 }>
diff --git a/llvm/test/Transforms/InstCombine/demorgan.ll b/llvm/test/Transforms/InstCombine/demorgan.ll
index c9196b6d49aff..11052d38f9bc7 100644
--- a/llvm/test/Transforms/InstCombine/demorgan.ll
+++ b/llvm/test/Transforms/InstCombine/demorgan.ll
@@ -119,8 +119,8 @@ define i32 @test3(i32 %A, i32 %B) {
define i32 @test4(i32 %A) {
; CHECK-LABEL: @test4(
-; CHECK-NEXT: [[NOTC1:%.*]] = or i32 [[A:%.*]], -6
-; CHECK-NEXT: ret i32 [[NOTC1]]
+; CHECK-NEXT: [[NOTC:%.*]] = or i32 [[A:%.*]], -6
+; CHECK-NEXT: ret i32 [[NOTC]]
;
%nota = xor i32 %A, -1
%c = and i32 %nota, 5
diff --git a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
index 80b25711122f5..80c2ea35c1ba0 100644
--- a/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
+++ b/llvm/test/Transforms/InstCombine/deref-alloc-fns.ll
@@ -96,19 +96,19 @@ define noalias ptr @aligned_alloc_dynamic_args(i64 %align, i64 %size) {
}
define noalias ptr @memalign_constant_size() {
-; GNU-LABEL: @memalign_constant_size(
-; GNU-NEXT: [[CALL:%.*]] = tail call noalias align 32 dereferenceable_or_null(512) ptr @memalign(i64 32, i64 512)
-; GNU-NEXT: ret ptr [[CALL]]
+; CHECK-LABEL: @memalign_constant_size(
+; CHECK-NEXT: [[CALL:%.*]] = tail call noalias align 32 dereferenceable_or_null(512) ptr @memalign(i64 32, i64 512)
+; CHECK-NEXT: ret ptr [[CALL]]
;
%call = tail call noalias ptr @memalign(i64 32, i64 512)
ret ptr %call
}
define noalias ptr @memalign_unknown_size_nonzero(i1 %c) {
-; GNU-LABEL: @memalign_unknown_size_nonzero(
-; GNU-NEXT: [[SIZE:%.*]] = select i1 [[C:%.*]], i64 64, i64 128
-; GNU-NEXT: [[CALL:%.*]] = tail call noalias align 32 ptr @memalign(i64 32, i64 [[SIZE]])
-; GNU-NEXT: ret ptr [[CALL]]
+; CHECK-LABEL: @memalign_unknown_size_nonzero(
+; CHECK-NEXT: [[SIZE:%.*]] = select i1 [[C:%.*]], i64 64, i64 128
+; CHECK-NEXT: [[CALL:%.*]] = tail call noalias align 32 ptr @memalign(i64 32, i64 [[SIZE]])
+; CHECK-NEXT: ret ptr [[CALL]]
;
%size = select i1 %c, i64 64, i64 128
%call = tail call noalias ptr @memalign(i64 32, i64 %size)
@@ -116,10 +116,10 @@ define noalias ptr @memalign_unknown_size_nonzero(i1 %c) {
}
define noalias ptr @memalign_unknown_size_possibly_zero(i1 %c) {
-; GNU-LABEL: @memalign_unknown_size_possibly_zero(
-; GNU-NEXT: [[SIZE:%.*]] = select i1 [[C:%.*]], i64 64, i64 0
-; GNU-NEXT: [[CALL:%.*]] = tail call noalias align 32 ptr @memalign(i64 32, i64 [[SIZE]])
-; GNU-NEXT: ret ptr [[CALL]]
+; CHECK-LABEL: @memalign_unknown_size_possibly_zero(
+; CHECK-NEXT: [[SIZE:%.*]] = select i1 [[C:%.*]], i64 64, i64 0
+; CHECK-NEXT: [[CALL:%.*]] = tail call noalias align 32 ptr @memalign(i64 32, i64 [[SIZE]])
+; CHECK-NEXT: ret ptr [[CALL]]
;
%size = select i1 %c, i64 64, i64 0
%call = tail call noalias ptr @memalign(i64 32, i64 %size)
@@ -127,9 +127,9 @@ define noalias ptr @memalign_unknown_size_possibly_zero(i1 %c) {
}
define noalias ptr @memalign_unknown_align(i64 %align) {
-; GNU-LABEL: @memalign_unknown_align(
-; GNU-NEXT: [[CALL:%.*]] = tail call noalias dereferenceable_or_null(128) ptr @memalign(i64 [[ALIGN:%.*]], i64 128)
-; GNU-NEXT: ret ptr [[CALL]]
+; CHECK-LABEL: @memalign_unknown_align(
+; CHECK-NEXT: [[CALL:%.*]] = tail call noalias dereferenceable_or_null(128) ptr @memalign(i64 [[ALIGN:%.*]], i64 128)
+; CHECK-NEXT: ret ptr [[CALL]]
;
%call = tail call noalias ptr @memalign(i64 %align, i64 128)
ret ptr %call
@@ -374,3 +374,5 @@ define ptr @my_calloc_constant_size() {
%call = call ptr @my_calloc(i64 32, i64 4)
ret ptr %call
}
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; GNU: {{.*}}
diff --git a/llvm/test/Transforms/InstCombine/disable-builtin.ll b/llvm/test/Transforms/InstCombine/disable-builtin.ll
index c743caf960b99..2fc9b0107e917 100644
--- a/llvm/test/Transforms/InstCombine/disable-builtin.ll
+++ b/llvm/test/Transforms/InstCombine/disable-builtin.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that -disable-builtin works correctly.
;
; RUN: opt < %s -passes=instcombine -disable-builtin strcat -S | FileCheck %s
@@ -12,9 +13,12 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
declare ptr @strcat(ptr, ptr)
define ptr @test_strcat(ptr %x) {
-; CHECK-LABEL: @test_strcat(
+; CHECK-LABEL: define ptr @test_strcat(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strcat(ptr [[X]], ptr nonnull @empty)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strcat(ptr %x, ptr @empty)
ret ptr %ret
-; CHECK: call ptr @strcat
}
diff --git a/llvm/test/Transforms/InstCombine/disable-simplify-libcalls.ll b/llvm/test/Transforms/InstCombine/disable-simplify-libcalls.ll
index 12229f3284612..311b6f6c72d87 100644
--- a/llvm/test/Transforms/InstCombine/disable-simplify-libcalls.ll
+++ b/llvm/test/Transforms/InstCombine/disable-simplify-libcalls.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that -disable-simplify-libcalls is wired up correctly.
;
; RUN: opt < %s -passes=instcombine -disable-simplify-libcalls -S | FileCheck %s
@@ -51,260 +52,364 @@ declare i32 @printf(ptr)
declare i32 @sprintf(ptr, ptr)
define double @t1(double %x) {
-; CHECK-LABEL: @t1(
+; CHECK-LABEL: define double @t1(
+; CHECK-SAME: double [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call double @ceil(double [[X]])
+; CHECK-NEXT: ret double [[RET]]
+;
%ret = call double @ceil(double %x)
ret double %ret
-; CHECK: call double @ceil
}
define double @t2(double %x, double %y) {
-; CHECK-LABEL: @t2(
+; CHECK-LABEL: define double @t2(
+; CHECK-SAME: double [[X:%.*]], double [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call double @copysign(double [[X]], double [[Y]])
+; CHECK-NEXT: ret double [[RET]]
+;
%ret = call double @copysign(double %x, double %y)
ret double %ret
-; CHECK: call double @copysign
}
define double @t3(double %x) {
-; CHECK-LABEL: @t3(
+; CHECK-LABEL: define double @t3(
+; CHECK-SAME: double [[X:%.*]]) {
+; CHECK-NEXT: [[CALL:%.*]] = call double @cos(double [[X]])
+; CHECK-NEXT: ret double [[CALL]]
+;
%call = call double @cos(double %x)
ret double %call
-; CHECK: call double @cos
}
define double @t4(double %x) {
-; CHECK-LABEL: @t4(
+; CHECK-LABEL: define double @t4(
+; CHECK-SAME: double [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call double @fabs(double [[X]])
+; CHECK-NEXT: ret double [[RET]]
+;
%ret = call double @fabs(double %x)
ret double %ret
-; CHECK: call double @fabs
}
define double @t5(double %x) {
-; CHECK-LABEL: @t5(
+; CHECK-LABEL: define double @t5(
+; CHECK-SAME: double [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call double @floor(double [[X]])
+; CHECK-NEXT: ret double [[RET]]
+;
%ret = call double @floor(double %x)
ret double %ret
-; CHECK: call double @floor
}
define ptr @t6(ptr %x) {
-; CHECK-LABEL: @t6(
+; CHECK-LABEL: define ptr @t6(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strcat(ptr [[X]], ptr nonnull @empty)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strcat(ptr %x, ptr @empty)
ret ptr %ret
-; CHECK: call ptr @strcat
}
define ptr @t7(ptr %x) {
-; CHECK-LABEL: @t7(
+; CHECK-LABEL: define ptr @t7(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strncat(ptr [[X]], ptr nonnull @empty, i32 1)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strncat(ptr %x, ptr @empty, i32 1)
ret ptr %ret
-; CHECK: call ptr @strncat
}
define ptr @t8() {
-; CHECK-LABEL: @t8(
+; CHECK-LABEL: define ptr @t8() {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strchr(ptr nonnull @.str1, i32 119)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strchr(ptr @.str1, i32 119)
ret ptr %ret
-; CHECK: call ptr @strchr
}
define ptr @t9() {
-; CHECK-LABEL: @t9(
+; CHECK-LABEL: define ptr @t9() {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strrchr(ptr nonnull @.str1, i32 119)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strrchr(ptr @.str1, i32 119)
ret ptr %ret
-; CHECK: call ptr @strrchr
}
define i32 @t10() {
-; CHECK-LABEL: @t10(
+; CHECK-LABEL: define i32 @t10() {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @strcmp(ptr nonnull @.str2, ptr nonnull @.str3)
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @strcmp(ptr @.str2, ptr @.str3)
ret i32 %ret
-; CHECK: call i32 @strcmp
}
define i32 @t11() {
-; CHECK-LABEL: @t11(
+; CHECK-LABEL: define i32 @t11() {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @strncmp(ptr nonnull @.str2, ptr nonnull @.str3, i64 3)
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @strncmp(ptr @.str2, ptr @.str3, i64 3)
ret i32 %ret
-; CHECK: call i32 @strncmp
}
define ptr @t12(ptr %x) {
-; CHECK-LABEL: @t12(
+; CHECK-LABEL: define ptr @t12(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strcpy(ptr [[X]], ptr nonnull @.str2)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strcpy(ptr %x, ptr @.str2)
ret ptr %ret
-; CHECK: call ptr @strcpy
}
define ptr @t13(ptr %x) {
-; CHECK-LABEL: @t13(
+; CHECK-LABEL: define ptr @t13(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @stpcpy(ptr [[X]], ptr nonnull @.str2)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @stpcpy(ptr %x, ptr @.str2)
ret ptr %ret
-; CHECK: call ptr @stpcpy
}
define ptr @t14(ptr %x) {
-; CHECK-LABEL: @t14(
+; CHECK-LABEL: define ptr @t14(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strncpy(ptr [[X]], ptr nonnull @.str2, i64 3)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strncpy(ptr %x, ptr @.str2, i64 3)
ret ptr %ret
-; CHECK: call ptr @strncpy
}
define i64 @t15() {
-; CHECK-LABEL: @t15(
+; CHECK-LABEL: define i64 @t15() {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strlen(ptr nonnull @.str2)
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strlen(ptr @.str2)
ret i64 %ret
-; CHECK: call i64 @strlen
}
define ptr @t16(ptr %x) {
-; CHECK-LABEL: @t16(
+; CHECK-LABEL: define ptr @t16(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @strpbrk(ptr [[X]], ptr nonnull @.str)
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @strpbrk(ptr %x, ptr @.str)
ret ptr %ret
-; CHECK: call ptr @strpbrk
}
define i64 @t17(ptr %x) {
-; CHECK-LABEL: @t17(
+; CHECK-LABEL: define i64 @t17(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strspn(ptr [[X]], ptr nonnull @.str)
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strspn(ptr %x, ptr @.str)
ret i64 %ret
-; CHECK: call i64 @strspn
}
define double @t18(ptr %y) {
-; CHECK-LABEL: @t18(
+; CHECK-LABEL: define double @t18(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call double @strtod(ptr nonnull @.str4, ptr [[Y]])
+; CHECK-NEXT: ret double [[RET]]
+;
%ret = call double @strtod(ptr @.str4, ptr %y)
ret double %ret
-; CHECK: call double @strtod
}
define float @t19(ptr %y) {
-; CHECK-LABEL: @t19(
+; CHECK-LABEL: define float @t19(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call float @strtof(ptr nonnull @.str4, ptr [[Y]])
+; CHECK-NEXT: ret float [[RET]]
+;
%ret = call float @strtof(ptr @.str4, ptr %y)
ret float %ret
-; CHECK: call float @strtof
}
define x86_fp80 @t20(ptr %y) {
-; CHECK-LABEL: @t20(
+; CHECK-LABEL: define x86_fp80 @t20(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call x86_fp80 @strtold(ptr nonnull @.str4, ptr [[Y]])
+; CHECK-NEXT: ret x86_fp80 [[RET]]
+;
%ret = call x86_fp80 @strtold(ptr @.str4, ptr %y)
ret x86_fp80 %ret
-; CHECK: call x86_fp80 @strtold
}
define i64 @t21(ptr %y) {
-; CHECK-LABEL: @t21(
+; CHECK-LABEL: define i64 @t21(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strtol(ptr nonnull @.str5, ptr [[Y]], i32 10)
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strtol(ptr @.str5, ptr %y, i32 10)
ret i64 %ret
-; CHECK: call i64 @strtol
}
define i64 @t22(ptr %y) {
-; CHECK-LABEL: @t22(
+; CHECK-LABEL: define i64 @t22(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strtoll(ptr nonnull @.str5, ptr [[Y]], i32 10)
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strtoll(ptr @.str5, ptr %y, i32 10)
ret i64 %ret
-; CHECK: call i64 @strtoll
}
define i64 @t23(ptr %y) {
-; CHECK-LABEL: @t23(
+; CHECK-LABEL: define i64 @t23(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strtoul(ptr nonnull @.str5, ptr [[Y]], i32 10)
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strtoul(ptr @.str5, ptr %y, i32 10)
ret i64 %ret
-; CHECK: call i64 @strtoul
}
define i64 @t24(ptr %y) {
-; CHECK-LABEL: @t24(
+; CHECK-LABEL: define i64 @t24(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strtoull(ptr nonnull @.str5, ptr [[Y]], i32 10)
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strtoull(ptr @.str5, ptr %y, i32 10)
ret i64 %ret
-; CHECK: call i64 @strtoull
}
define i64 @t25(ptr %y) {
-; CHECK-LABEL: @t25(
+; CHECK-LABEL: define i64 @t25(
+; CHECK-SAME: ptr [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strcspn(ptr nonnull @empty, ptr [[Y]])
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strcspn(ptr @empty, ptr %y)
ret i64 %ret
-; CHECK: call i64 @strcspn
}
define i32 @t26(i32 %y) {
-; CHECK-LABEL: @t26(
+; CHECK-LABEL: define i32 @t26(
+; CHECK-SAME: i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @abs(i32 [[Y]])
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @abs(i32 %y)
ret i32 %ret
-; CHECK: call i32 @abs
}
define i32 @t27(i32 %y) {
-; CHECK-LABEL: @t27(
+; CHECK-LABEL: define i32 @t27(
+; CHECK-SAME: i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @ffs(i32 [[Y]])
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @ffs(i32 %y)
ret i32 %ret
-; CHECK: call i32 @ffs
}
define i32 @t28(i64 %y) {
-; CHECK-LABEL: @t28(
+; CHECK-LABEL: define i32 @t28(
+; CHECK-SAME: i64 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @ffsl(i64 [[Y]])
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @ffsl(i64 %y)
ret i32 %ret
-; CHECK: call i32 @ffsl
}
define i32 @t29(i64 %y) {
-; CHECK-LABEL: @t29(
+; CHECK-LABEL: define i32 @t29(
+; CHECK-SAME: i64 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @ffsll(i64 [[Y]])
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @ffsll(i64 %y)
ret i32 %ret
-; CHECK: call i32 @ffsll
}
define void @t30() {
-; CHECK-LABEL: @t30(
+; CHECK-LABEL: define void @t30() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @fprintf(ptr null, ptr nonnull @.str1)
+; CHECK-NEXT: ret void
+;
call i32 @fprintf(ptr null, ptr @.str1)
ret void
-; CHECK: call i32 @fprintf
}
define i32 @t31(i32 %y) {
-; CHECK-LABEL: @t31(
+; CHECK-LABEL: define i32 @t31(
+; CHECK-SAME: i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @isascii(i32 [[Y]])
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @isascii(i32 %y)
ret i32 %ret
-; CHECK: call i32 @isascii
}
define i32 @t32(i32 %y) {
-; CHECK-LABEL: @t32(
+; CHECK-LABEL: define i32 @t32(
+; CHECK-SAME: i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @isdigit(i32 [[Y]])
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @isdigit(i32 %y)
ret i32 %ret
-; CHECK: call i32 @isdigit
}
define i32 @t33(i32 %y) {
-; CHECK-LABEL: @t33(
+; CHECK-LABEL: define i32 @t33(
+; CHECK-SAME: i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i32 @toascii(i32 [[Y]])
+; CHECK-NEXT: ret i32 [[RET]]
+;
%ret = call i32 @toascii(i32 %y)
ret i32 %ret
-; CHECK: call i32 @toascii
}
define i64 @t34(i64 %y) {
-; CHECK-LABEL: @t34(
+; CHECK-LABEL: define i64 @t34(
+; CHECK-SAME: i64 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @labs(i64 [[Y]])
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @labs(i64 %y)
ret i64 %ret
-; CHECK: call i64 @labs
}
define i64 @t35(i64 %y) {
-; CHECK-LABEL: @t35(
+; CHECK-LABEL: define i64 @t35(
+; CHECK-SAME: i64 [[Y:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @llabs(i64 [[Y]])
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @llabs(i64 %y)
ret i64 %ret
-; CHECK: call i64 @llabs
}
define void @t36() {
-; CHECK-LABEL: @t36(
+; CHECK-LABEL: define void @t36() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @printf(ptr nonnull @empty)
+; CHECK-NEXT: ret void
+;
call i32 @printf(ptr @empty)
ret void
-; CHECK: call i32 @printf
}
define void @t37(ptr %x) {
-; CHECK-LABEL: @t37(
+; CHECK-LABEL: define void @t37(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @sprintf(ptr [[X]], ptr nonnull @.str1)
+; CHECK-NEXT: ret void
+;
call i32 @sprintf(ptr %x, ptr @.str1)
ret void
-; CHECK: call i32 @sprintf
}
diff --git a/llvm/test/Transforms/InstCombine/distribute.ll b/llvm/test/Transforms/InstCombine/distribute.ll
index b659828eeb28b..732e1ef546024 100644
--- a/llvm/test/Transforms/InstCombine/distribute.ll
+++ b/llvm/test/Transforms/InstCombine/distribute.ll
@@ -38,7 +38,10 @@ define i32 @factorize3(i32 %x, i32 %a, i32 %b) {
define i32 @factorize4(i32 %x, i32 %y) {
; CHECK-LABEL: @factorize4(
-; CHECK-NEXT: [[S:%.*]] = mul i32 [[Y:%.*]], [[X:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[ML:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[MR:%.*]] = mul i32 [[X]], [[Y]]
+; CHECK-NEXT: [[S:%.*]] = sub i32 [[ML]], [[MR]]
; CHECK-NEXT: ret i32 [[S]]
;
; ((Y << 1) * X) - (X * Y) -> (X * (Y * 2 - Y)) -> (X * Y)
@@ -51,7 +54,10 @@ define i32 @factorize4(i32 %x, i32 %y) {
define i32 @factorize5(i32 %x, i32 %y) {
; CHECK-LABEL: @factorize5(
-; CHECK-NEXT: [[S:%.*]] = mul i32 [[Y:%.*]], [[X:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X:%.*]], [[Y:%.*]]
+; CHECK-NEXT: [[ML:%.*]] = shl i32 [[TMP1]], 1
+; CHECK-NEXT: [[MR:%.*]] = mul i32 [[X]], [[Y]]
+; CHECK-NEXT: [[S:%.*]] = sub i32 [[ML]], [[MR]]
; CHECK-NEXT: ret i32 [[S]]
;
; ((Y * 2) * X) - (X * Y) -> (X * Y)
diff --git a/llvm/test/Transforms/InstCombine/div-shift-crash.ll b/llvm/test/Transforms/InstCombine/div-shift-crash.ll
index 9be3264a37270..e718bc96cecfd 100644
--- a/llvm/test/Transforms/InstCombine/div-shift-crash.ll
+++ b/llvm/test/Transforms/InstCombine/div-shift-crash.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine < %s
target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
target triple = "powerpc64-unknown-linux-gnu"
diff --git a/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll b/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll
index 85c9a01e5faba..cfab9bdb6b7aa 100644
--- a/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll
+++ b/llvm/test/Transforms/InstCombine/double-float-shrink-1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S -mtriple x86_64-unknown-linux-gnu | FileCheck %s --check-prefixes=CHECK,LINUX,ISC99
; RUN: opt < %s -passes=instcombine -S -mtriple x86_64-pc-win32 | FileCheck %s --check-prefixes=CHECK,ISC99
; RUN: opt < %s -passes=instcombine -S -mtriple x86_64-pc-windows-msvc16 | FileCheck %s --check-prefixes=CHECK,MS64,ISC89
@@ -11,11 +12,22 @@
; PR17850: http://llvm.org/bugs/show_bug.cgi?id=17850
define float @acos_test1(float %f) {
-; CHECK-LABEL: @acos_test1(
-; LINUX-NEXT: [[ACOSF:%.*]] = call fast float @acosf(float [[F:%.*]])
+; LINUX-LABEL: define float @acos_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[ACOSF:%.*]] = call fast float @acosf(float [[F]])
; LINUX-NEXT: ret float [[ACOSF]]
-; MS32: [[ACOSF:%.*]] = call fast double @acos(double [[F:%.*]])
-; MS64-NEXT: [[ACOSF:%.*]] = call fast float @acosf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @acos_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[ACOSF:%.*]] = call fast float @acosf(float [[F]])
+; MS64-NEXT: ret float [[ACOSF]]
+;
+; MS32-LABEL: define float @acos_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @acos(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @acos(double %conv)
@@ -24,8 +36,9 @@ define float @acos_test1(float %f) {
}
define double @acos_test2(float %f) {
-; CHECK-LABEL: @acos_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @acos_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @acos(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -35,10 +48,29 @@ define double @acos_test2(float %f) {
}
define float @acosh_test1(float %f) {
-; CHECK-LABEL: @acosh_test1(
-; ISC99-NEXT: [[ACOSHF:%.*]] = call fast float @acoshf(float [[F:%.*]])
+; LINUX-LABEL: define float @acosh_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[ACOSHF:%.*]] = call fast float @acoshf(float [[F]])
+; LINUX-NEXT: ret float [[ACOSHF]]
+;
+; ISC99-LABEL: define float @acosh_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[ACOSHF:%.*]] = call fast float @acoshf(float [[F]])
; ISC99-NEXT: ret float [[ACOSHF]]
-; ISC89: [[ACOSHF:%.*]] = call fast double @acosh(double [[F:%.*]])
+;
+; MS64-LABEL: define float @acosh_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS64-NEXT: [[CALL:%.*]] = call fast double @acosh(double [[CONV]])
+; MS64-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS64-NEXT: ret float [[CONV1]]
+;
+; MS32-LABEL: define float @acosh_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @acosh(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @acosh(double %conv)
@@ -47,8 +79,9 @@ define float @acosh_test1(float %f) {
}
define double @acosh_test2(float %f) {
-; CHECK-LABEL: @acosh_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @acosh_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @acosh(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -58,11 +91,22 @@ define double @acosh_test2(float %f) {
}
define float @asin_test1(float %f) {
-; CHECK-LABEL: @asin_test1(
-; LINUX-NEXT: [[ASINF:%.*]] = call fast float @asinf(float [[F:%.*]])
+; LINUX-LABEL: define float @asin_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[ASINF:%.*]] = call fast float @asinf(float [[F]])
; LINUX-NEXT: ret float [[ASINF]]
-; MS32: [[ASINF:%.*]] = call fast double @asin(double [[F:%.*]])
-; MS64-NEXT: [[ASINF:%.*]] = call fast float @asinf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @asin_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[ASINF:%.*]] = call fast float @asinf(float [[F]])
+; MS64-NEXT: ret float [[ASINF]]
+;
+; MS32-LABEL: define float @asin_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @asin(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @asin(double %conv)
@@ -71,8 +115,9 @@ define float @asin_test1(float %f) {
}
define double @asin_test2(float %f) {
-; CHECK-LABEL: @asin_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @asin_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @asin(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -82,10 +127,29 @@ define double @asin_test2(float %f) {
}
define float @asinh_test1(float %f) {
-; CHECK-LABEL: @asinh_test1(
-; ISC99-NEXT: [[ASINHF:%.*]] = call fast float @asinhf(float [[F:%.*]])
-; ISC99-NEXT: ret float [[ASINHF]]
-; ISC89: [[ASINHF:%.*]] = call fast double @asinh(double [[F:%.*]])
+; LINUX-LABEL: define float @asinh_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[ASINHF:%.*]] = call fast float @asinhf(float [[F]])
+; LINUX-NEXT: ret float [[ASINHF]]
+;
+; ISC99-LABEL: define float @asinh_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[ASINHF:%.*]] = call fast float @asinhf(float [[F]])
+; ISC99-NEXT: ret float [[ASINHF]]
+;
+; MS64-LABEL: define float @asinh_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS64-NEXT: [[CALL:%.*]] = call fast double @asinh(double [[CONV]])
+; MS64-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS64-NEXT: ret float [[CONV1]]
+;
+; MS32-LABEL: define float @asinh_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @asinh(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @asinh(double %conv)
@@ -94,8 +158,9 @@ define float @asinh_test1(float %f) {
}
define double @asinh_test2(float %f) {
-; CHECK-LABEL: @asinh_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @asinh_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @asinh(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -105,11 +170,22 @@ define double @asinh_test2(float %f) {
}
define float @atan_test1(float %f) {
-; CHECK-LABEL: @atan_test1(
-; LINUX-NEXT: [[ATANF:%.*]] = call fast float @atanf(float [[F:%.*]])
+; LINUX-LABEL: define float @atan_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[ATANF:%.*]] = call fast float @atanf(float [[F]])
; LINUX-NEXT: ret float [[ATANF]]
-; MS32: [[ATANF:%.*]] = call fast double @atan(double [[F:%.*]])
-; MS64-NEXT: [[ATANF:%.*]] = call fast float @atanf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @atan_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[ATANF:%.*]] = call fast float @atanf(float [[F]])
+; MS64-NEXT: ret float [[ATANF]]
+;
+; MS32-LABEL: define float @atan_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @atan(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @atan(double %conv)
@@ -118,8 +194,9 @@ define float @atan_test1(float %f) {
}
define double @atan_test2(float %f) {
-; CHECK-LABEL: @atan_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @atan_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @atan(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -129,10 +206,29 @@ define double @atan_test2(float %f) {
}
define float @atanh_test1(float %f) {
-; CHECK-LABEL: @atanh_test1(
-; ISC99-NEXT: [[ATANHF:%.*]] = call fast float @atanhf(float [[F:%.*]])
+; LINUX-LABEL: define float @atanh_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[ATANHF:%.*]] = call fast float @atanhf(float [[F]])
+; LINUX-NEXT: ret float [[ATANHF]]
+;
+; ISC99-LABEL: define float @atanh_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[ATANHF:%.*]] = call fast float @atanhf(float [[F]])
; ISC99-NEXT: ret float [[ATANHF]]
-; ISC89: [[ATANHF:%.*]] = call fast double @atanh(double [[F:%.*]])
+;
+; MS64-LABEL: define float @atanh_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS64-NEXT: [[CALL:%.*]] = call fast double @atanh(double [[CONV]])
+; MS64-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS64-NEXT: ret float [[CONV1]]
+;
+; MS32-LABEL: define float @atanh_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @atanh(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @atanh(double %conv)
@@ -141,8 +237,9 @@ define float @atanh_test1(float %f) {
}
define double @atanh_test2(float %f) {
-; CHECK-LABEL: @atanh_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @atanh_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @atanh(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -152,10 +249,29 @@ define double @atanh_test2(float %f) {
}
define float @cbrt_test1(float %f) {
-; CHECK-LABEL: @cbrt_test1(
-; ISC99-NEXT: [[CBRTF:%.*]] = call fast float @cbrtf(float [[F:%.*]])
+; LINUX-LABEL: define float @cbrt_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[CBRTF:%.*]] = call fast float @cbrtf(float [[F]])
+; LINUX-NEXT: ret float [[CBRTF]]
+;
+; ISC99-LABEL: define float @cbrt_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[CBRTF:%.*]] = call fast float @cbrtf(float [[F]])
; ISC99-NEXT: ret float [[CBRTF]]
-; ISC89: [[CBRTF:%.*]] = call fast double @cbrt(double [[F:%.*]])
+;
+; MS64-LABEL: define float @cbrt_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS64-NEXT: [[CALL:%.*]] = call fast double @cbrt(double [[CONV]])
+; MS64-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS64-NEXT: ret float [[CONV1]]
+;
+; MS32-LABEL: define float @cbrt_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @cbrt(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @cbrt(double %conv)
@@ -164,8 +280,9 @@ define float @cbrt_test1(float %f) {
}
define double @cbrt_test2(float %f) {
-; CHECK-LABEL: @cbrt_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @cbrt_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @cbrt(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -175,11 +292,22 @@ define double @cbrt_test2(float %f) {
}
define float @exp_test1(float %f) {
-; CHECK-LABEL: @exp_test1(
-; LINUX-NEXT: [[EXPF:%.*]] = call fast float @expf(float [[F:%.*]])
+; LINUX-LABEL: define float @exp_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[EXPF:%.*]] = call fast float @expf(float [[F]])
; LINUX-NEXT: ret float [[EXPF]]
-; MS32: [[EXPF:%.*]] = call fast double @exp(double [[F:%.*]])
-; MS64-NEXT: [[EXPF:%.*]] = call fast float @expf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @exp_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[EXPF:%.*]] = call fast float @expf(float [[F]])
+; MS64-NEXT: ret float [[EXPF]]
+;
+; MS32-LABEL: define float @exp_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @exp(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @exp(double %conv)
@@ -188,8 +316,9 @@ define float @exp_test1(float %f) {
}
define double @exp_test2(float %f) {
-; CHECK-LABEL: @exp_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @exp_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @exp(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -199,10 +328,29 @@ define double @exp_test2(float %f) {
}
define float @expm1_test1(float %f) {
-; CHECK-LABEL: @expm1_test1(
-; ISC99-NEXT: [[EXPM1F:%.*]] = call fast float @expm1f(float [[F:%.*]])
+; LINUX-LABEL: define float @expm1_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[EXPM1F:%.*]] = call fast float @expm1f(float [[F]])
+; LINUX-NEXT: ret float [[EXPM1F]]
+;
+; ISC99-LABEL: define float @expm1_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[EXPM1F:%.*]] = call fast float @expm1f(float [[F]])
; ISC99-NEXT: ret float [[EXPM1F]]
-; ISC89: [[EXPM1F:%.*]] = call fast double @expm1(double [[F:%.*]])
+;
+; MS64-LABEL: define float @expm1_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS64-NEXT: [[CALL:%.*]] = call fast double @expm1(double [[CONV]])
+; MS64-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS64-NEXT: ret float [[CONV1]]
+;
+; MS32-LABEL: define float @expm1_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @expm1(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @expm1(double %conv)
@@ -211,8 +359,9 @@ define float @expm1_test1(float %f) {
}
define double @expm1_test2(float %f) {
-; CHECK-LABEL: @expm1_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @expm1_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @expm1(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -224,8 +373,9 @@ define double @expm1_test2(float %f) {
; exp10f() doesn't exist for this triple, so it doesn't shrink.
define float @exp10_test1(float %f) {
-; CHECK-LABEL: @exp10_test1(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define float @exp10_test1(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @exp10(double [[CONV]])
; CHECK-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
; CHECK-NEXT: ret float [[CONV1]]
@@ -237,8 +387,9 @@ define float @exp10_test1(float %f) {
}
define double @exp10_test2(float %f) {
-; CHECK-LABEL: @exp10_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @exp10_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @exp10(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -248,11 +399,22 @@ define double @exp10_test2(float %f) {
}
define float @log_test1(float %f) {
-; CHECK-LABEL: @log_test1(
-; LINUX-NEXT: [[LOGF:%.*]] = call fast float @logf(float [[F:%.*]])
+; LINUX-LABEL: define float @log_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[LOGF:%.*]] = call fast float @logf(float [[F]])
; LINUX-NEXT: ret float [[LOGF]]
-; MS32: [[LOGF:%.*]] = call fast double @log(double [[F:%.*]])
-; MS64-NEXT: [[LOGF:%.*]] = call fast float @logf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @log_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[LOGF:%.*]] = call fast float @logf(float [[F]])
+; MS64-NEXT: ret float [[LOGF]]
+;
+; MS32-LABEL: define float @log_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @log(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @log(double %conv)
@@ -261,8 +423,9 @@ define float @log_test1(float %f) {
}
define double @log_test2(float %f) {
-; CHECK-LABEL: @log_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @log_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @log(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -272,11 +435,22 @@ define double @log_test2(float %f) {
}
define float @log10_test1(float %f) {
-; CHECK-LABEL: @log10_test1(
-; LINUX-NEXT: [[LOG10F:%.*]] = call fast float @log10f(float [[F:%.*]])
+; LINUX-LABEL: define float @log10_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[LOG10F:%.*]] = call fast float @log10f(float [[F]])
; LINUX-NEXT: ret float [[LOG10F]]
-; MS32: [[LOG10F:%.*]] = call fast double @log10(double [[F:%.*]])
-; MS64-NEXT: [[LOG10F:%.*]] = call fast float @log10f(float [[F:%.*]])
+;
+; MS64-LABEL: define float @log10_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[LOG10F:%.*]] = call fast float @log10f(float [[F]])
+; MS64-NEXT: ret float [[LOG10F]]
+;
+; MS32-LABEL: define float @log10_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @log10(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @log10(double %conv)
@@ -285,8 +459,9 @@ define float @log10_test1(float %f) {
}
define double @log10_test2(float %f) {
-; CHECK-LABEL: @log10_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @log10_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @log10(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -296,10 +471,29 @@ define double @log10_test2(float %f) {
}
define float @log1p_test1(float %f) {
-; CHECK-LABEL: @log1p_test1(
-; ISC99-NEXT: [[LOG1PF:%.*]] = call fast float @log1pf(float [[F:%.*]])
+; LINUX-LABEL: define float @log1p_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[LOG1PF:%.*]] = call fast float @log1pf(float [[F]])
+; LINUX-NEXT: ret float [[LOG1PF]]
+;
+; ISC99-LABEL: define float @log1p_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[LOG1PF:%.*]] = call fast float @log1pf(float [[F]])
; ISC99-NEXT: ret float [[LOG1PF]]
-; ISC89: [[LOG1PF:%.*]] = call fast double @log1p(double [[F:%.*]])
+;
+; MS64-LABEL: define float @log1p_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS64-NEXT: [[CALL:%.*]] = call fast double @log1p(double [[CONV]])
+; MS64-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS64-NEXT: ret float [[CONV1]]
+;
+; MS32-LABEL: define float @log1p_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @log1p(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @log1p(double %conv)
@@ -308,8 +502,9 @@ define float @log1p_test1(float %f) {
}
define double @log1p_test2(float %f) {
-; CHECK-LABEL: @log1p_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @log1p_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @log1p(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -319,10 +514,29 @@ define double @log1p_test2(float %f) {
}
define float @log2_test1(float %f) {
-; CHECK-LABEL: @log2_test1(
-; ISC99-NEXT: [[LOG2F:%.*]] = call fast float @log2f(float [[F:%.*]])
+; LINUX-LABEL: define float @log2_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[LOG2F:%.*]] = call fast float @log2f(float [[F]])
+; LINUX-NEXT: ret float [[LOG2F]]
+;
+; ISC99-LABEL: define float @log2_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[LOG2F:%.*]] = call fast float @log2f(float [[F]])
; ISC99-NEXT: ret float [[LOG2F]]
-; ISC89: [[LOG2F:%.*]] = call fast double @log2(double [[F:%.*]])
+;
+; MS64-LABEL: define float @log2_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS64-NEXT: [[CALL:%.*]] = call fast double @log2(double [[CONV]])
+; MS64-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS64-NEXT: ret float [[CONV1]]
+;
+; MS32-LABEL: define float @log2_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @log2(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @log2(double %conv)
@@ -331,8 +545,9 @@ define float @log2_test1(float %f) {
}
define double @log2_test2(float %f) {
-; CHECK-LABEL: @log2_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @log2_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @log2(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -342,11 +557,27 @@ define double @log2_test2(float %f) {
}
define float @logb_test1(float %f) {
-; CHECK-LABEL: @logb_test1(
-; LINUX-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F:%.*]])
+; LINUX-LABEL: define float @logb_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F]])
; LINUX-NEXT: ret float [[LOGBF]]
-; MS32: [[POWF:%.*]] = call fast double @logb(double [[F:%.*]])
-; MS64-NEXT: [[LOGBF:%.*]] = call fast float @_logbf(float [[F:%.*]])
+;
+; ISC99-LABEL: define float @logb_test1(
+; ISC99-SAME: float [[F:%.*]]) {
+; ISC99-NEXT: [[LOGBF:%.*]] = call fast float @logbf(float [[F]])
+; ISC99-NEXT: ret float [[LOGBF]]
+;
+; MS64-LABEL: define float @logb_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[LOGBF:%.*]] = call fast float @_logbf(float [[F]])
+; MS64-NEXT: ret float [[LOGBF]]
+;
+; MS32-LABEL: define float @logb_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @logb(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @logb(double %conv)
@@ -355,8 +586,9 @@ define float @logb_test1(float %f) {
}
define double @logb_test2(float %f) {
-; CHECK-LABEL: @logb_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @logb_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @logb(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -366,11 +598,23 @@ define double @logb_test2(float %f) {
}
define float @pow_test1(float %f, float %g) {
-; CHECK-LABEL: @pow_test1(
-; LINUX-NEXT: [[POWF:%.*]] = call fast float @powf(float %f, float %g)
+; LINUX-LABEL: define float @pow_test1(
+; LINUX-SAME: float [[F:%.*]], float [[G:%.*]]) {
+; LINUX-NEXT: [[POWF:%.*]] = call fast float @powf(float [[F]], float [[G]])
; LINUX-NEXT: ret float [[POWF]]
-; MS32: [[POWF:%.*]] = call fast double @pow(double %df, double %dg)
-; MS64-NEXT: [[POWF:%.*]] = call fast float @powf(float %f, float %g)
+;
+; MS64-LABEL: define float @pow_test1(
+; MS64-SAME: float [[F:%.*]], float [[G:%.*]]) {
+; MS64-NEXT: [[POWF:%.*]] = call fast float @powf(float [[F]], float [[G]])
+; MS64-NEXT: ret float [[POWF]]
+;
+; MS32-LABEL: define float @pow_test1(
+; MS32-SAME: float [[F:%.*]], float [[G:%.*]]) {
+; MS32-NEXT: [[DF:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[DG:%.*]] = fpext float [[G]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @pow(double [[DF]], double [[DG]])
+; MS32-NEXT: [[FR:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[FR]]
;
%df = fpext float %f to double
%dg = fpext float %g to double
@@ -380,9 +624,12 @@ define float @pow_test1(float %f, float %g) {
}
define double @pow_test2(float %f, float %g) {
-; CHECK-LABEL: @pow_test2(
-; CHECK: [[POW:%.*]] = call fast double @pow(double %df, double %dg)
-; CHECK-NEXT: ret double [[POW]]
+; CHECK-LABEL: define double @pow_test2(
+; CHECK-SAME: float [[F:%.*]], float [[G:%.*]]) {
+; CHECK-NEXT: [[DF:%.*]] = fpext float [[F]] to double
+; CHECK-NEXT: [[DG:%.*]] = fpext float [[G]] to double
+; CHECK-NEXT: [[CALL:%.*]] = call fast double @pow(double [[DF]], double [[DG]])
+; CHECK-NEXT: ret double [[CALL]]
;
%df = fpext float %f to double
%dg = fpext float %g to double
@@ -391,11 +638,22 @@ define double @pow_test2(float %f, float %g) {
}
define float @sin_test1(float %f) {
-; CHECK-LABEL: @sin_test1(
-; LINUX-NEXT: [[SINF:%.*]] = call fast float @sinf(float [[F:%.*]])
+; LINUX-LABEL: define float @sin_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[SINF:%.*]] = call fast float @sinf(float [[F]])
; LINUX-NEXT: ret float [[SINF]]
-; MS32: [[SINF:%.*]] = call fast double @sin(double [[F:%.*]])
-; MS64-NEXT: [[SINF:%.*]] = call fast float @sinf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @sin_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[SINF:%.*]] = call fast float @sinf(float [[F]])
+; MS64-NEXT: ret float [[SINF]]
+;
+; MS32-LABEL: define float @sin_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @sin(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @sin(double %conv)
@@ -404,8 +662,9 @@ define float @sin_test1(float %f) {
}
define double @sin_test2(float %f) {
-; CHECK-LABEL: @sin_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @sin_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @sin(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -415,11 +674,22 @@ define double @sin_test2(float %f) {
}
define float @sqrt_test1(float %f) {
-; CHECK-LABEL: @sqrt_test1(
-; LINUX-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[F:%.*]])
+; LINUX-LABEL: define float @sqrt_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[F]])
; LINUX-NEXT: ret float [[SQRTF]]
-; MS32: [[SQRTF:%.*]] = call double @sqrt(double [[F:%.*]])
-; MS64-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @sqrt_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[SQRTF:%.*]] = call float @sqrtf(float [[F]])
+; MS64-NEXT: ret float [[SQRTF]]
+;
+; MS32-LABEL: define float @sqrt_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call double @sqrt(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call double @sqrt(double %conv)
@@ -428,8 +698,9 @@ define float @sqrt_test1(float %f) {
}
define double @sqrt_test2(float %f) {
-; CHECK-LABEL: @sqrt_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @sqrt_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call double @sqrt(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -439,11 +710,22 @@ define double @sqrt_test2(float %f) {
}
define float @sqrt_int_test1(float %f) {
-; CHECK-LABEL: @sqrt_int_test1(
-; LINUX-NEXT: [[TMP1:%.*]] = call float @llvm.sqrt.f32(float [[F:%.*]])
+; LINUX-LABEL: define float @sqrt_int_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[TMP1:%.*]] = call float @llvm.sqrt.f32(float [[F]])
; LINUX-NEXT: ret float [[TMP1]]
-; MS32: [[TMP1:%.*]] = call double @llvm.sqrt.f64(double [[F:%.*]])
-; MS64-NEXT: [[TMP1:%.*]] = call float @llvm.sqrt.f32(float [[F:%.*]])
+;
+; MS64-LABEL: define float @sqrt_int_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[TMP1:%.*]] = call float @llvm.sqrt.f32(float [[F]])
+; MS64-NEXT: ret float [[TMP1]]
+;
+; MS32-LABEL: define float @sqrt_int_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call double @llvm.sqrt.f64(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call double @llvm.sqrt.f64(double %conv)
@@ -452,8 +734,9 @@ define float @sqrt_int_test1(float %f) {
}
define double @sqrt_int_test2(float %f) {
-; CHECK-LABEL: @sqrt_int_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @sqrt_int_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call double @llvm.sqrt.f64(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -463,11 +746,22 @@ define double @sqrt_int_test2(float %f) {
}
define float @tan_test1(float %f) {
-; CHECK-LABEL: @tan_test1(
-; LINUX-NEXT: [[TANF:%.*]] = call fast float @tanf(float [[F:%.*]])
+; LINUX-LABEL: define float @tan_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[TANF:%.*]] = call fast float @tanf(float [[F]])
; LINUX-NEXT: ret float [[TANF]]
-; MS32: [[TANF:%.*]] = call fast double @tan(double [[F:%.*]])
-; MS64-NEXT: [[TANF:%.*]] = call fast float @tanf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @tan_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[TANF:%.*]] = call fast float @tanf(float [[F]])
+; MS64-NEXT: ret float [[TANF]]
+;
+; MS32-LABEL: define float @tan_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @tan(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @tan(double %conv)
@@ -476,8 +770,9 @@ define float @tan_test1(float %f) {
}
define double @tan_test2(float %f) {
-; CHECK-LABEL: @tan_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @tan_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @tan(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -486,11 +781,22 @@ define double @tan_test2(float %f) {
ret double %call
}
define float @tanh_test1(float %f) {
-; CHECK-LABEL: @tanh_test1(
-; LINUX-NEXT: [[TANHF:%.*]] = call fast float @tanhf(float [[F:%.*]])
+; LINUX-LABEL: define float @tanh_test1(
+; LINUX-SAME: float [[F:%.*]]) {
+; LINUX-NEXT: [[TANHF:%.*]] = call fast float @tanhf(float [[F]])
; LINUX-NEXT: ret float [[TANHF]]
-; MS32: [[TANHF:%.*]] = call fast double @tanh(double [[F:%.*]])
-; MS64-NEXT: [[TANHF:%.*]] = call fast float @tanhf(float [[F:%.*]])
+;
+; MS64-LABEL: define float @tanh_test1(
+; MS64-SAME: float [[F:%.*]]) {
+; MS64-NEXT: [[TANHF:%.*]] = call fast float @tanhf(float [[F]])
+; MS64-NEXT: ret float [[TANHF]]
+;
+; MS32-LABEL: define float @tanh_test1(
+; MS32-SAME: float [[F:%.*]]) {
+; MS32-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
+; MS32-NEXT: [[CALL:%.*]] = call fast double @tanh(double [[CONV]])
+; MS32-NEXT: [[CONV1:%.*]] = fptrunc double [[CALL]] to float
+; MS32-NEXT: ret float [[CONV1]]
;
%conv = fpext float %f to double
%call = call fast double @tanh(double %conv)
@@ -499,8 +805,9 @@ define float @tanh_test1(float %f) {
}
define double @tanh_test2(float %f) {
-; CHECK-LABEL: @tanh_test2(
-; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F:%.*]] to double
+; CHECK-LABEL: define double @tanh_test2(
+; CHECK-SAME: float [[F:%.*]]) {
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[F]] to double
; CHECK-NEXT: [[CALL:%.*]] = call fast double @tanh(double [[CONV]])
; CHECK-NEXT: ret double [[CALL]]
;
@@ -512,10 +819,31 @@ define double @tanh_test2(float %f) {
; 'arcp' on an fmax() is meaningless. This test just proves that
; flags are propagated for shrunken *binary* double FP calls.
define float @max1(float %a, float %b) {
-; CHECK-LABEL: @max1(
-; ISC99-NEXT: [[FMAXF:%.*]] = call nsz arcp float @llvm.maxnum.f32(float [[A:%.*]], float [[B:%.*]])
+; LINUX-LABEL: define float @max1(
+; LINUX-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; LINUX-NEXT: [[FMAXF:%.*]] = call nsz arcp float @llvm.maxnum.f32(float [[A]], float [[B]])
+; LINUX-NEXT: ret float [[FMAXF]]
+;
+; ISC99-LABEL: define float @max1(
+; ISC99-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; ISC99-NEXT: [[FMAXF:%.*]] = call nsz arcp float @llvm.maxnum.f32(float [[A]], float [[B]])
; ISC99-NEXT: ret float [[FMAXF]]
-; ISC89: [[FMAXF:%.*]] = call arcp double @fmax(double [[A:%.*]], double [[B:%.*]])
+;
+; MS64-LABEL: define float @max1(
+; MS64-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; MS64-NEXT: [[C:%.*]] = fpext float [[A]] to double
+; MS64-NEXT: [[D:%.*]] = fpext float [[B]] to double
+; MS64-NEXT: [[E:%.*]] = call arcp double @fmax(double [[C]], double [[D]])
+; MS64-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; MS64-NEXT: ret float [[F]]
+;
+; MS32-LABEL: define float @max1(
+; MS32-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; MS32-NEXT: [[C:%.*]] = fpext float [[A]] to double
+; MS32-NEXT: [[D:%.*]] = fpext float [[B]] to double
+; MS32-NEXT: [[E:%.*]] = call arcp double @fmax(double [[C]], double [[D]])
+; MS32-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
+; MS32-NEXT: ret float [[F]]
;
%c = fpext float %a to double
%d = fpext float %b to double
@@ -528,16 +856,33 @@ define float @max1(float %a, float %b) {
; correspond to 'C' types, so this is not required to be "fminl".
define float @fake_fmin(float %a, float %b) {
-; CHECK-LABEL: @fake_fmin(
-; ISC99-NEXT: [[MIN:%.*]] = call nsz float @llvm.minnum.f32(float %a, float %b)
-; ISC99-NEXT: ret float [[MIN]]
-
-; ISC89-NEXT: [[C:%.*]] = fpext float [[A:%.*]] to fp128
-; ISC89-NEXT: [[D:%.*]] = fpext float [[B:%.*]] to fp128
-; ISC89-NEXT: [[E:%.*]] = call fp128 @fmin(fp128 [[C]], fp128 [[D]])
-; ISC89-NEXT: [[F:%.*]] = fptrunc fp128 [[E]] to float
-; ISC89-NEXT: ret float [[F]]
+; LINUX-LABEL: define float @fake_fmin(
+; LINUX-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; LINUX-NEXT: [[E1:%.*]] = call nsz float @llvm.minnum.f32(float [[A]], float [[B]])
+; LINUX-NEXT: ret float [[E1]]
+;
+; ISC99-LABEL: define float @fake_fmin(
+; ISC99-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; ISC99-NEXT: [[E1:%.*]] = call nsz float @llvm.minnum.f32(float [[A]], float [[B]])
+; ISC99-NEXT: ret float [[E1]]
+;
+; MS64-LABEL: define float @fake_fmin(
+; MS64-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; MS64-NEXT: [[C:%.*]] = fpext float [[A]] to fp128
+; MS64-NEXT: [[D:%.*]] = fpext float [[B]] to fp128
+; MS64-NEXT: [[E:%.*]] = call fp128 @fmin(fp128 [[C]], fp128 [[D]])
+; MS64-NEXT: [[F:%.*]] = fptrunc fp128 [[E]] to float
+; MS64-NEXT: ret float [[F]]
+;
+; MS32-LABEL: define float @fake_fmin(
+; MS32-SAME: float [[A:%.*]], float [[B:%.*]]) {
+; MS32-NEXT: [[C:%.*]] = fpext float [[A]] to fp128
+; MS32-NEXT: [[D:%.*]] = fpext float [[B]] to fp128
+; MS32-NEXT: [[E:%.*]] = call fp128 @fmin(fp128 [[C]], fp128 [[D]])
+; MS32-NEXT: [[F:%.*]] = fptrunc fp128 [[E]] to float
+; MS32-NEXT: ret float [[F]]
;
+
%c = fpext float %a to fp128
%d = fpext float %b to fp128
%e = call fp128 @fmin(fp128 %c, fp128 %d)
@@ -575,3 +920,5 @@ declare double @acosh(double)
declare double @asin(double)
declare double @asinh(double)
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; ISC89: {{.*}}
diff --git a/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll b/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
index 482f6978003e3..b9621c3a950f9 100644
--- a/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
+++ b/llvm/test/Transforms/InstCombine/double-float-shrink-2.ll
@@ -45,6 +45,13 @@ define float @test_shrink_libcall_floor(float %C) {
; CHECK-LABEL: @test_shrink_libcall_floor(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.floor.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_floor(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META9:![0-9]+]], !DIExpression(), [[META14:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.floor.f32(float [[C:%.*]]), !dbg [[DBG15:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META11:![0-9]+]], !DIExpression(), [[DBG15]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META12:![0-9]+]], !DIExpression(), [[META16:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG17:![0-9]+]]
;
%D = fpext float %C to double
; --> floorf
@@ -57,6 +64,13 @@ define float @test_shrink_libcall_ceil(float %C) {
; CHECK-LABEL: @test_shrink_libcall_ceil(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.ceil.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_ceil(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META20:![0-9]+]], !DIExpression(), [[META23:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.ceil.f32(float [[C:%.*]]), !dbg [[DBG24:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META21:![0-9]+]], !DIExpression(), [[DBG24]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META22:![0-9]+]], !DIExpression(), [[META25:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG26:![0-9]+]]
;
%D = fpext float %C to double
; --> ceilf
@@ -69,6 +83,13 @@ define float @test_shrink_libcall_round(float %C) {
; CHECK-LABEL: @test_shrink_libcall_round(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.round.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_round(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META29:![0-9]+]], !DIExpression(), [[META32:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.round.f32(float [[C:%.*]]), !dbg [[DBG33:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META30:![0-9]+]], !DIExpression(), [[DBG33]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META31:![0-9]+]], !DIExpression(), [[META34:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG35:![0-9]+]]
;
%D = fpext float %C to double
; --> roundf
@@ -81,6 +102,13 @@ define float @test_shrink_libcall_roundeven(float %C) {
; CHECK-LABEL: @test_shrink_libcall_roundeven(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.roundeven.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_roundeven(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META38:![0-9]+]], !DIExpression(), [[META41:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.roundeven.f32(float [[C:%.*]]), !dbg [[DBG42:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META39:![0-9]+]], !DIExpression(), [[DBG42]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META40:![0-9]+]], !DIExpression(), [[META43:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG44:![0-9]+]]
;
%D = fpext float %C to double
; --> roundeven
@@ -93,6 +121,13 @@ define float @test_shrink_libcall_nearbyint(float %C) {
; CHECK-LABEL: @test_shrink_libcall_nearbyint(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.nearbyint.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_nearbyint(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META47:![0-9]+]], !DIExpression(), [[META50:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.nearbyint.f32(float [[C:%.*]]), !dbg [[DBG51:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META48:![0-9]+]], !DIExpression(), [[DBG51]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META49:![0-9]+]], !DIExpression(), [[META52:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG53:![0-9]+]]
;
%D = fpext float %C to double
; --> nearbyintf
@@ -105,6 +140,13 @@ define float @test_shrink_libcall_trunc(float %C) {
; CHECK-LABEL: @test_shrink_libcall_trunc(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.trunc.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_trunc(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META56:![0-9]+]], !DIExpression(), [[META59:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.trunc.f32(float [[C:%.*]]), !dbg [[DBG60:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META57:![0-9]+]], !DIExpression(), [[DBG60]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META58:![0-9]+]], !DIExpression(), [[META61:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG62:![0-9]+]]
;
%D = fpext float %C to double
; --> truncf
@@ -119,6 +161,13 @@ define float @test_shrink_libcall_fabs(float %C) {
; CHECK-LABEL: @test_shrink_libcall_fabs(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_fabs(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META65:![0-9]+]], !DIExpression(), [[META68:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[C:%.*]]), !dbg [[DBG69:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META66:![0-9]+]], !DIExpression(), [[DBG69]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META67:![0-9]+]], !DIExpression(), [[META70:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG71:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @fabs(double %D)
@@ -131,6 +180,13 @@ define float @test_shrink_libcall_fabs_fast(float %C) {
; CHECK-LABEL: @test_shrink_libcall_fabs_fast(
; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.fabs.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_libcall_fabs_fast(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META74:![0-9]+]], !DIExpression(), [[META77:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call fast float @llvm.fabs.f32(float [[C:%.*]]), !dbg [[DBG78:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META75:![0-9]+]], !DIExpression(), [[DBG78]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META76:![0-9]+]], !DIExpression(), [[META79:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG80:![0-9]+]]
;
%D = fpext float %C to double
%E = call fast double @fabs(double %D)
@@ -142,6 +198,13 @@ define float @test_shrink_intrin_ceil(float %C) {
; CHECK-LABEL: @test_shrink_intrin_ceil(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.ceil.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_ceil(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META83:![0-9]+]], !DIExpression(), [[META86:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.ceil.f32(float [[C:%.*]]), !dbg [[DBG87:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META84:![0-9]+]], !DIExpression(), [[DBG87]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META85:![0-9]+]], !DIExpression(), [[META88:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG89:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @llvm.ceil.f64(double %D)
@@ -153,6 +216,13 @@ define float @test_shrink_intrin_fabs(float %C) {
; CHECK-LABEL: @test_shrink_intrin_fabs(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_fabs(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META92:![0-9]+]], !DIExpression(), [[META95:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.fabs.f32(float [[C:%.*]]), !dbg [[DBG96:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META93:![0-9]+]], !DIExpression(), [[DBG96]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META94:![0-9]+]], !DIExpression(), [[META97:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG98:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @llvm.fabs.f64(double %D)
@@ -164,6 +234,13 @@ define float @test_shrink_intrin_floor(float %C) {
; CHECK-LABEL: @test_shrink_intrin_floor(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.floor.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_floor(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META101:![0-9]+]], !DIExpression(), [[META104:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.floor.f32(float [[C:%.*]]), !dbg [[DBG105:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META102:![0-9]+]], !DIExpression(), [[DBG105]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META103:![0-9]+]], !DIExpression(), [[META106:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG107:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @llvm.floor.f64(double %D)
@@ -175,6 +252,13 @@ define float @test_shrink_intrin_nearbyint(float %C) {
; CHECK-LABEL: @test_shrink_intrin_nearbyint(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.nearbyint.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_nearbyint(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META110:![0-9]+]], !DIExpression(), [[META113:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.nearbyint.f32(float [[C:%.*]]), !dbg [[DBG114:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META111:![0-9]+]], !DIExpression(), [[DBG114]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META112:![0-9]+]], !DIExpression(), [[META115:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG116:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @llvm.nearbyint.f64(double %D)
@@ -186,6 +270,13 @@ define half @test_shrink_intrin_rint(half %C) {
; CHECK-LABEL: @test_shrink_intrin_rint(
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.rint.f16(half [[C:%.*]])
; CHECK-NEXT: ret half [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_rint(
+; DBG-VALID-NEXT: #dbg_value(float poison, [[META119:![0-9]+]], !DIExpression(), [[META123:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call half @llvm.rint.f16(half [[C:%.*]]), !dbg [[DBG124:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float poison, [[META120:![0-9]+]], !DIExpression(), [[DBG124]])
+; DBG-VALID-NEXT: #dbg_value(half [[TMP1]], [[META121:![0-9]+]], !DIExpression(), [[META125:![0-9]+]])
+; DBG-VALID-NEXT: ret half [[TMP1]], !dbg [[DBG126:![0-9]+]]
;
%D = fpext half %C to float
%E = call float @llvm.rint.f32(float %D)
@@ -197,6 +288,13 @@ define float @test_shrink_intrin_round(float %C) {
; CHECK-LABEL: @test_shrink_intrin_round(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.round.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_round(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META129:![0-9]+]], !DIExpression(), [[META132:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.round.f32(float [[C:%.*]]), !dbg [[DBG133:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META130:![0-9]+]], !DIExpression(), [[DBG133]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META131:![0-9]+]], !DIExpression(), [[META134:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG135:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @llvm.round.f64(double %D)
@@ -208,6 +306,13 @@ define float @test_shrink_intrin_roundeven(float %C) {
; CHECK-LABEL: @test_shrink_intrin_roundeven(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.roundeven.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_roundeven(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META138:![0-9]+]], !DIExpression(), [[META141:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.roundeven.f32(float [[C:%.*]]), !dbg [[DBG142:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META139:![0-9]+]], !DIExpression(), [[DBG142]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META140:![0-9]+]], !DIExpression(), [[META143:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG144:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @llvm.roundeven.f64(double %D)
@@ -219,6 +324,13 @@ define float @test_shrink_intrin_trunc(float %C) {
; CHECK-LABEL: @test_shrink_intrin_trunc(
; CHECK-NEXT: [[TMP1:%.*]] = call float @llvm.trunc.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_trunc(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META147:![0-9]+]], !DIExpression(), [[META150:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call float @llvm.trunc.f32(float [[C:%.*]]), !dbg [[DBG151:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META148:![0-9]+]], !DIExpression(), [[DBG151]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META149:![0-9]+]], !DIExpression(), [[META152:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG153:![0-9]+]]
;
%D = fpext float %C to double
%E = call double @llvm.trunc.f64(double %D)
@@ -236,6 +348,16 @@ define <2 x float> @test_shrink_intrin_ceil_multi_use(<2 x float> %C) {
; CHECK-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[D]])
; CHECK-NEXT: ret <2 x float> [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_ceil_multi_use(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext <2 x float> [[C:%.*]] to <2 x double>, !dbg [[DBG160:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[D]], [[META156:![0-9]+]], !DIExpression(), [[DBG160]])
+; DBG-VALID-NEXT: [[E:%.*]] = call <2 x double> @llvm.ceil.v2f64(<2 x double> [[D]]), !dbg [[DBG161:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META158:![0-9]+]], !DIExpression(), [[DBG161]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>, !dbg [[DBG162:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[F]], [[META159:![0-9]+]], !DIExpression(), [[DBG162]])
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[D]]), !dbg [[DBG163:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x float> [[F]], !dbg [[DBG164:![0-9]+]]
;
%D = fpext <2 x float> %C to <2 x double>
%E = call <2 x double> @llvm.ceil.v2f64(<2 x double> %D)
@@ -250,6 +372,15 @@ define <2 x float> @test_shrink_intrin_fabs_multi_use(<2 x float> %C) {
; CHECK-NEXT: [[E:%.*]] = fpext <2 x float> [[TMP1]] to <2 x double>
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[E]])
; CHECK-NEXT: ret <2 x float> [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_fabs_multi_use(
+; DBG-VALID-NEXT: #dbg_value(<2 x double> poison, [[META167:![0-9]+]], !DIExpression(), [[META170:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call <2 x float> @llvm.fabs.v2f32(<2 x float> [[C:%.*]]), !dbg [[DBG171:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = fpext <2 x float> [[TMP1]] to <2 x double>, !dbg [[DBG171]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META168:![0-9]+]], !DIExpression(), [[DBG171]])
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[TMP1]], [[META169:![0-9]+]], !DIExpression(), [[META172:![0-9]+]])
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[E]]), !dbg [[DBG173:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x float> [[TMP1]], !dbg [[DBG174:![0-9]+]]
;
%D = fpext <2 x float> %C to <2 x double>
%E = call <2 x double> @llvm.fabs.v2f64(<2 x double> %D)
@@ -266,6 +397,17 @@ define <2 x float> @test_shrink_intrin_floor_multi_use(<2 x float> %C) {
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[D]])
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[E]])
; CHECK-NEXT: ret <2 x float> [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_floor_multi_use(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext <2 x float> [[C:%.*]] to <2 x double>, !dbg [[DBG180:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[D]], [[META177:![0-9]+]], !DIExpression(), [[DBG180]])
+; DBG-VALID-NEXT: [[E:%.*]] = call <2 x double> @llvm.floor.v2f64(<2 x double> [[D]]), !dbg [[DBG181:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META178:![0-9]+]], !DIExpression(), [[DBG181]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>, !dbg [[DBG182:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[F]], [[META179:![0-9]+]], !DIExpression(), [[DBG182]])
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[D]]), !dbg [[DBG183:![0-9]+]]
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[E]]), !dbg [[DBG184:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x float> [[F]], !dbg [[DBG185:![0-9]+]]
;
%D = fpext <2 x float> %C to <2 x double>
%E = call <2 x double> @llvm.floor.v2f64(<2 x double> %D)
@@ -282,6 +424,16 @@ define <2 x float> @test_shrink_intrin_nearbyint_multi_use(<2 x float> %C) {
; CHECK-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[D]])
; CHECK-NEXT: ret <2 x float> [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_nearbyint_multi_use(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext <2 x float> [[C:%.*]] to <2 x double>, !dbg [[DBG191:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[D]], [[META188:![0-9]+]], !DIExpression(), [[DBG191]])
+; DBG-VALID-NEXT: [[E:%.*]] = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> [[D]]), !dbg [[DBG192:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META189:![0-9]+]], !DIExpression(), [[DBG192]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>, !dbg [[DBG193:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[F]], [[META190:![0-9]+]], !DIExpression(), [[DBG193]])
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[D]]), !dbg [[DBG194:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x float> [[F]], !dbg [[DBG195:![0-9]+]]
;
%D = fpext <2 x float> %C to <2 x double>
%E = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %D)
@@ -296,6 +448,15 @@ define <2 x half> @test_shrink_intrin_rint_multi_use(<2 x half> %C) {
; CHECK-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x float>
; CHECK-NEXT: call void @use_v2f32(<2 x float> [[E]])
; CHECK-NEXT: ret <2 x half> [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_rint_multi_use(
+; DBG-VALID-NEXT: #dbg_value(<2 x float> poison, [[META198:![0-9]+]], !DIExpression(), [[META201:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.rint.v2f16(<2 x half> [[C:%.*]]), !dbg [[DBG202:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x float>, !dbg [[DBG202]]
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[E]], [[META199:![0-9]+]], !DIExpression(), [[DBG202]])
+; DBG-VALID-NEXT: #dbg_value(<2 x half> [[TMP1]], [[META200:![0-9]+]], !DIExpression(), [[META203:![0-9]+]])
+; DBG-VALID-NEXT: call void @use_v2f32(<2 x float> [[E]]), !dbg [[DBG204:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x half> [[TMP1]], !dbg [[DBG205:![0-9]+]]
;
%D = fpext <2 x half> %C to <2 x float>
%E = call <2 x float> @llvm.rint.v2f32(<2 x float> %D)
@@ -312,6 +473,17 @@ define <2 x float> @test_shrink_intrin_round_multi_use(<2 x float> %C) {
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[D]])
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[E]])
; CHECK-NEXT: ret <2 x float> [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_round_multi_use(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext <2 x float> [[C:%.*]] to <2 x double>, !dbg [[DBG211:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[D]], [[META208:![0-9]+]], !DIExpression(), [[DBG211]])
+; DBG-VALID-NEXT: [[E:%.*]] = call <2 x double> @llvm.round.v2f64(<2 x double> [[D]]), !dbg [[DBG212:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META209:![0-9]+]], !DIExpression(), [[DBG212]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>, !dbg [[DBG213:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[F]], [[META210:![0-9]+]], !DIExpression(), [[DBG213]])
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[D]]), !dbg [[DBG214:![0-9]+]]
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[E]]), !dbg [[DBG215:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x float> [[F]], !dbg [[DBG216:![0-9]+]]
;
%D = fpext <2 x float> %C to <2 x double>
%E = call <2 x double> @llvm.round.v2f64(<2 x double> %D)
@@ -329,6 +501,17 @@ define <2 x float> @test_shrink_intrin_roundeven_multi_use(<2 x float> %C) {
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[D]])
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[E]])
; CHECK-NEXT: ret <2 x float> [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_roundeven_multi_use(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext <2 x float> [[C:%.*]] to <2 x double>, !dbg [[DBG222:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[D]], [[META219:![0-9]+]], !DIExpression(), [[DBG222]])
+; DBG-VALID-NEXT: [[E:%.*]] = call <2 x double> @llvm.roundeven.v2f64(<2 x double> [[D]]), !dbg [[DBG223:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META220:![0-9]+]], !DIExpression(), [[DBG223]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>, !dbg [[DBG224:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[F]], [[META221:![0-9]+]], !DIExpression(), [[DBG224]])
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[D]]), !dbg [[DBG225:![0-9]+]]
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[E]]), !dbg [[DBG226:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x float> [[F]], !dbg [[DBG227:![0-9]+]]
;
%D = fpext <2 x float> %C to <2 x double>
%E = call <2 x double> @llvm.roundeven.v2f64(<2 x double> %D)
@@ -345,6 +528,16 @@ define <2 x float> @test_shrink_intrin_trunc_multi_use(<2 x float> %C) {
; CHECK-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>
; CHECK-NEXT: call void @use_v2f64(<2 x double> [[D]])
; CHECK-NEXT: ret <2 x float> [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_trunc_multi_use(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext <2 x float> [[C:%.*]] to <2 x double>, !dbg [[DBG233:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[D]], [[META230:![0-9]+]], !DIExpression(), [[DBG233]])
+; DBG-VALID-NEXT: [[E:%.*]] = call <2 x double> @llvm.trunc.v2f64(<2 x double> [[D]]), !dbg [[DBG234:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META231:![0-9]+]], !DIExpression(), [[DBG234]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc <2 x double> [[E]] to <2 x float>, !dbg [[DBG235:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(<2 x float> [[F]], [[META232:![0-9]+]], !DIExpression(), [[DBG235]])
+; DBG-VALID-NEXT: call void @use_v2f64(<2 x double> [[D]]), !dbg [[DBG236:![0-9]+]]
+; DBG-VALID-NEXT: ret <2 x float> [[F]], !dbg [[DBG237:![0-9]+]]
;
%D = fpext <2 x float> %C to <2 x double>
%E = call <2 x double> @llvm.trunc.v2f64(<2 x double> %D)
@@ -358,6 +551,13 @@ define float @test_shrink_intrin_fabs_fast(float %C) {
; CHECK-LABEL: @test_shrink_intrin_fabs_fast(
; CHECK-NEXT: [[TMP1:%.*]] = call fast float @llvm.fabs.f32(float [[C:%.*]])
; CHECK-NEXT: ret float [[TMP1]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_fabs_fast(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META240:![0-9]+]], !DIExpression(), [[META243:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call fast float @llvm.fabs.f32(float [[C:%.*]]), !dbg [[DBG244:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META241:![0-9]+]], !DIExpression(), [[DBG244]])
+; DBG-VALID-NEXT: #dbg_value(float [[TMP1]], [[META242:![0-9]+]], !DIExpression(), [[META245:![0-9]+]])
+; DBG-VALID-NEXT: ret float [[TMP1]], !dbg [[DBG246:![0-9]+]]
;
%D = fpext float %C to double
%E = call fast double @llvm.fabs.f64(double %D)
@@ -370,6 +570,13 @@ define float @test_no_shrink_intrin_floor(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.floor.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_floor(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.floor.f64(double [[D:%.*]]), !dbg [[DBG251:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META249:![0-9]+]], !DIExpression(), [[DBG251]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG252:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META250:![0-9]+]], !DIExpression(), [[DBG252]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG253:![0-9]+]]
;
%E = call double @llvm.floor.f64(double %D)
%F = fptrunc double %E to float
@@ -381,6 +588,13 @@ define float @test_no_shrink_intrin_ceil(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.ceil.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_ceil(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.ceil.f64(double [[D:%.*]]), !dbg [[DBG258:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META256:![0-9]+]], !DIExpression(), [[DBG258]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG259:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META257:![0-9]+]], !DIExpression(), [[DBG259]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG260:![0-9]+]]
;
%E = call double @llvm.ceil.f64(double %D)
%F = fptrunc double %E to float
@@ -392,6 +606,13 @@ define float @test_no_shrink_intrin_round(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.round.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_round(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.round.f64(double [[D:%.*]]), !dbg [[DBG265:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META263:![0-9]+]], !DIExpression(), [[DBG265]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG266:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META264:![0-9]+]], !DIExpression(), [[DBG266]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG267:![0-9]+]]
;
%E = call double @llvm.round.f64(double %D)
%F = fptrunc double %E to float
@@ -403,6 +624,13 @@ define float @test_no_shrink_intrin_roundeven(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.roundeven.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_roundeven(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.roundeven.f64(double [[D:%.*]]), !dbg [[DBG272:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META270:![0-9]+]], !DIExpression(), [[DBG272]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG273:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META271:![0-9]+]], !DIExpression(), [[DBG273]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG274:![0-9]+]]
;
%E = call double @llvm.roundeven.f64(double %D)
%F = fptrunc double %E to float
@@ -414,6 +642,13 @@ define float @test_no_shrink_intrin_nearbyint(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.nearbyint.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_nearbyint(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.nearbyint.f64(double [[D:%.*]]), !dbg [[DBG279:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META277:![0-9]+]], !DIExpression(), [[DBG279]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG280:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META278:![0-9]+]], !DIExpression(), [[DBG280]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG281:![0-9]+]]
;
%E = call double @llvm.nearbyint.f64(double %D)
%F = fptrunc double %E to float
@@ -425,6 +660,13 @@ define float @test_no_shrink_intrin_trunc(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.trunc.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_trunc(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.trunc.f64(double [[D:%.*]]), !dbg [[DBG286:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META284:![0-9]+]], !DIExpression(), [[DBG286]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG287:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META285:![0-9]+]], !DIExpression(), [[DBG287]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG288:![0-9]+]]
;
%E = call double @llvm.trunc.f64(double %D)
%F = fptrunc double %E to float
@@ -436,6 +678,13 @@ define float @test_shrink_intrin_fabs_double_src(double %D) {
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to float
; CHECK-NEXT: [[F:%.*]] = call float @llvm.fabs.f32(float [[TMP1]])
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_fabs_double_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META291:![0-9]+]], !DIExpression(), [[META293:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to float, !dbg [[DBG294:![0-9]+]]
+; DBG-VALID-NEXT: [[F:%.*]] = call float @llvm.fabs.f32(float [[TMP1]]), !dbg [[DBG294]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META292:![0-9]+]], !DIExpression(), [[DBG294]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG295:![0-9]+]]
;
%E = call double @llvm.fabs.f64(double %D)
%F = fptrunc double %E to float
@@ -448,6 +697,13 @@ define float @test_shrink_intrin_fabs_fast_double_src(double %D) {
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to float
; CHECK-NEXT: [[F:%.*]] = call fast float @llvm.fabs.f32(float [[TMP1]])
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_fabs_fast_double_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META298:![0-9]+]], !DIExpression(), [[META300:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to float, !dbg [[DBG301:![0-9]+]]
+; DBG-VALID-NEXT: [[F:%.*]] = call fast float @llvm.fabs.f32(float [[TMP1]]), !dbg [[DBG301]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META299:![0-9]+]], !DIExpression(), [[DBG301]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG302:![0-9]+]]
;
%E = call fast double @llvm.fabs.f64(double %D)
%F = fptrunc double %E to float
@@ -457,6 +713,11 @@ define float @test_shrink_intrin_fabs_fast_double_src(double %D) {
define float @test_shrink_float_convertible_constant_intrin_floor() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_floor(
; CHECK-NEXT: ret float 2.000000e+00
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_floor(
+; DBG-VALID-NEXT: #dbg_value(double 2.000000e+00, [[META305:![0-9]+]], !DIExpression(), [[META307:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 2.000000e+00, [[META306:![0-9]+]], !DIExpression(), [[META308:![0-9]+]])
+; DBG-VALID-NEXT: ret float 2.000000e+00, !dbg [[DBG309:![0-9]+]]
;
%E = call double @llvm.floor.f64(double 2.1)
%F = fptrunc double %E to float
@@ -466,6 +727,11 @@ define float @test_shrink_float_convertible_constant_intrin_floor() {
define float @test_shrink_float_convertible_constant_intrin_ceil() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_ceil(
; CHECK-NEXT: ret float 3.000000e+00
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_ceil(
+; DBG-VALID-NEXT: #dbg_value(double 3.000000e+00, [[META312:![0-9]+]], !DIExpression(), [[META314:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 3.000000e+00, [[META313:![0-9]+]], !DIExpression(), [[META315:![0-9]+]])
+; DBG-VALID-NEXT: ret float 3.000000e+00, !dbg [[DBG316:![0-9]+]]
;
%E = call double @llvm.ceil.f64(double 2.1)
%F = fptrunc double %E to float
@@ -475,6 +741,11 @@ define float @test_shrink_float_convertible_constant_intrin_ceil() {
define float @test_shrink_float_convertible_constant_intrin_round() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_round(
; CHECK-NEXT: ret float 2.000000e+00
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_round(
+; DBG-VALID-NEXT: #dbg_value(double 2.000000e+00, [[META319:![0-9]+]], !DIExpression(), [[META321:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 2.000000e+00, [[META320:![0-9]+]], !DIExpression(), [[META322:![0-9]+]])
+; DBG-VALID-NEXT: ret float 2.000000e+00, !dbg [[DBG323:![0-9]+]]
;
%E = call double @llvm.round.f64(double 2.1)
%F = fptrunc double %E to float
@@ -484,6 +755,11 @@ define float @test_shrink_float_convertible_constant_intrin_round() {
define float @test_shrink_float_convertible_constant_intrin_roundeven() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_roundeven(
; CHECK-NEXT: ret float 2.000000e+00
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_roundeven(
+; DBG-VALID-NEXT: #dbg_value(double 2.000000e+00, [[META326:![0-9]+]], !DIExpression(), [[META328:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 2.000000e+00, [[META327:![0-9]+]], !DIExpression(), [[META329:![0-9]+]])
+; DBG-VALID-NEXT: ret float 2.000000e+00, !dbg [[DBG330:![0-9]+]]
;
%E = call double @llvm.roundeven.f64(double 2.1)
%F = fptrunc double %E to float
@@ -493,6 +769,11 @@ define float @test_shrink_float_convertible_constant_intrin_roundeven() {
define float @test_shrink_float_convertible_constant_intrin_nearbyint() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_nearbyint(
; CHECK-NEXT: ret float 2.000000e+00
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_nearbyint(
+; DBG-VALID-NEXT: #dbg_value(double 2.000000e+00, [[META333:![0-9]+]], !DIExpression(), [[META335:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 2.000000e+00, [[META334:![0-9]+]], !DIExpression(), [[META336:![0-9]+]])
+; DBG-VALID-NEXT: ret float 2.000000e+00, !dbg [[DBG337:![0-9]+]]
;
%E = call double @llvm.nearbyint.f64(double 2.1)
%F = fptrunc double %E to float
@@ -502,6 +783,11 @@ define float @test_shrink_float_convertible_constant_intrin_nearbyint() {
define float @test_shrink_float_convertible_constant_intrin_trunc() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_trunc(
; CHECK-NEXT: ret float 2.000000e+00
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_trunc(
+; DBG-VALID-NEXT: #dbg_value(double 2.000000e+00, [[META340:![0-9]+]], !DIExpression(), [[META342:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 2.000000e+00, [[META341:![0-9]+]], !DIExpression(), [[META343:![0-9]+]])
+; DBG-VALID-NEXT: ret float 2.000000e+00, !dbg [[DBG344:![0-9]+]]
;
%E = call double @llvm.trunc.f64(double 2.1)
%F = fptrunc double %E to float
@@ -511,6 +797,11 @@ define float @test_shrink_float_convertible_constant_intrin_trunc() {
define float @test_shrink_float_convertible_constant_intrin_fabs() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_fabs(
; CHECK-NEXT: ret float 0x4000CCCCC0000000
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_fabs(
+; DBG-VALID-NEXT: #dbg_value(double 2.100000e+00, [[META347:![0-9]+]], !DIExpression(), [[META349:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 0x4000CCCCC0000000, [[META348:![0-9]+]], !DIExpression(), [[META350:![0-9]+]])
+; DBG-VALID-NEXT: ret float 0x4000CCCCC0000000, !dbg [[DBG351:![0-9]+]]
;
%E = call double @llvm.fabs.f64(double 2.1)
%F = fptrunc double %E to float
@@ -521,6 +812,11 @@ define float @test_shrink_float_convertible_constant_intrin_fabs() {
define float @test_shrink_float_convertible_constant_intrin_fabs_fast() {
; CHECK-LABEL: @test_shrink_float_convertible_constant_intrin_fabs_fast(
; CHECK-NEXT: ret float 0x4000CCCCC0000000
+;
+; DBG-VALID-LABEL: @test_shrink_float_convertible_constant_intrin_fabs_fast(
+; DBG-VALID-NEXT: #dbg_value(double 2.100000e+00, [[META354:![0-9]+]], !DIExpression(), [[META356:![0-9]+]])
+; DBG-VALID-NEXT: #dbg_value(float 0x4000CCCCC0000000, [[META355:![0-9]+]], !DIExpression(), [[META357:![0-9]+]])
+; DBG-VALID-NEXT: ret float 0x4000CCCCC0000000, !dbg [[DBG358:![0-9]+]]
;
%E = call fast double @llvm.fabs.f64(double 2.1)
%F = fptrunc double %E to float
@@ -532,6 +828,13 @@ define half @test_no_shrink_mismatched_type_intrin_floor(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.floor.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to half
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_mismatched_type_intrin_floor(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.floor.f64(double [[D:%.*]]), !dbg [[DBG363:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META361:![0-9]+]], !DIExpression(), [[DBG363]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to half, !dbg [[DBG364:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META362:![0-9]+]], !DIExpression(), [[DBG364]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG365:![0-9]+]]
;
%E = call double @llvm.floor.f64(double %D)
%F = fptrunc double %E to half
@@ -543,6 +846,13 @@ define half @test_no_shrink_mismatched_type_intrin_ceil(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.ceil.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to half
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_mismatched_type_intrin_ceil(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.ceil.f64(double [[D:%.*]]), !dbg [[DBG370:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META368:![0-9]+]], !DIExpression(), [[DBG370]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to half, !dbg [[DBG371:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META369:![0-9]+]], !DIExpression(), [[DBG371]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG372:![0-9]+]]
;
%E = call double @llvm.ceil.f64(double %D)
%F = fptrunc double %E to half
@@ -554,6 +864,13 @@ define half @test_no_shrink_mismatched_type_intrin_round(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.round.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to half
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_mismatched_type_intrin_round(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.round.f64(double [[D:%.*]]), !dbg [[DBG377:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META375:![0-9]+]], !DIExpression(), [[DBG377]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to half, !dbg [[DBG378:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META376:![0-9]+]], !DIExpression(), [[DBG378]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG379:![0-9]+]]
;
%E = call double @llvm.round.f64(double %D)
%F = fptrunc double %E to half
@@ -565,6 +882,13 @@ define half @test_no_shrink_mismatched_type_intrin_roundeven(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.roundeven.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to half
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_mismatched_type_intrin_roundeven(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.roundeven.f64(double [[D:%.*]]), !dbg [[DBG384:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META382:![0-9]+]], !DIExpression(), [[DBG384]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to half, !dbg [[DBG385:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META383:![0-9]+]], !DIExpression(), [[DBG385]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG386:![0-9]+]]
;
%E = call double @llvm.roundeven.f64(double %D)
%F = fptrunc double %E to half
@@ -576,6 +900,13 @@ define half @test_no_shrink_mismatched_type_intrin_nearbyint(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.nearbyint.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to half
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_mismatched_type_intrin_nearbyint(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.nearbyint.f64(double [[D:%.*]]), !dbg [[DBG391:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META389:![0-9]+]], !DIExpression(), [[DBG391]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to half, !dbg [[DBG392:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META390:![0-9]+]], !DIExpression(), [[DBG392]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG393:![0-9]+]]
;
%E = call double @llvm.nearbyint.f64(double %D)
%F = fptrunc double %E to half
@@ -587,6 +918,13 @@ define half @test_no_shrink_mismatched_type_intrin_trunc(double %D) {
; CHECK-NEXT: [[E:%.*]] = call double @llvm.trunc.f64(double [[D:%.*]])
; CHECK-NEXT: [[F:%.*]] = fptrunc double [[E]] to half
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_mismatched_type_intrin_trunc(
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.trunc.f64(double [[D:%.*]]), !dbg [[DBG398:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META396:![0-9]+]], !DIExpression(), [[DBG398]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to half, !dbg [[DBG399:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META397:![0-9]+]], !DIExpression(), [[DBG399]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG400:![0-9]+]]
;
%E = call double @llvm.trunc.f64(double %D)
%F = fptrunc double %E to half
@@ -598,6 +936,13 @@ define half @test_shrink_mismatched_type_intrin_fabs_double_src(double %D) {
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to half
; CHECK-NEXT: [[F:%.*]] = call half @llvm.fabs.f16(half [[TMP1]])
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_mismatched_type_intrin_fabs_double_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META403:![0-9]+]], !DIExpression(), [[META405:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to half, !dbg [[DBG406:![0-9]+]]
+; DBG-VALID-NEXT: [[F:%.*]] = call half @llvm.fabs.f16(half [[TMP1]]), !dbg [[DBG406]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META404:![0-9]+]], !DIExpression(), [[DBG406]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG407:![0-9]+]]
;
%E = call double @llvm.fabs.f64(double %D)
%F = fptrunc double %E to half
@@ -610,6 +955,13 @@ define half @test_mismatched_type_intrin_fabs_fast_double_src(double %D) {
; CHECK-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to half
; CHECK-NEXT: [[F:%.*]] = call fast half @llvm.fabs.f16(half [[TMP1]])
; CHECK-NEXT: ret half [[F]]
+;
+; DBG-VALID-LABEL: @test_mismatched_type_intrin_fabs_fast_double_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META410:![0-9]+]], !DIExpression(), [[META412:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = fptrunc double [[D:%.*]] to half, !dbg [[DBG413:![0-9]+]]
+; DBG-VALID-NEXT: [[F:%.*]] = call fast half @llvm.fabs.f16(half [[TMP1]]), !dbg [[DBG413]]
+; DBG-VALID-NEXT: #dbg_value(half [[F]], [[META411:![0-9]+]], !DIExpression(), [[DBG413]])
+; DBG-VALID-NEXT: ret half [[F]], !dbg [[DBG414:![0-9]+]]
;
%E = call fast double @llvm.fabs.f64(double %D)
%F = fptrunc double %E to half
@@ -621,6 +973,13 @@ define <2 x double> @test_shrink_intrin_floor_fp16_vec(<2 x half> %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call arcp <2 x half> @llvm.floor.v2f16(<2 x half> [[C:%.*]])
; CHECK-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>
; CHECK-NEXT: ret <2 x double> [[E]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_floor_fp16_vec(
+; DBG-VALID-NEXT: #dbg_value(<2 x double> poison, [[META417:![0-9]+]], !DIExpression(), [[META419:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call arcp <2 x half> @llvm.floor.v2f16(<2 x half> [[C:%.*]]), !dbg [[DBG420:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>, !dbg [[DBG420]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META418:![0-9]+]], !DIExpression(), [[DBG420]])
+; DBG-VALID-NEXT: ret <2 x double> [[E]], !dbg [[DBG421:![0-9]+]]
;
%D = fpext <2 x half> %C to <2 x double>
%E = call arcp <2 x double> @llvm.floor.v2f64(<2 x double> %D)
@@ -632,6 +991,14 @@ define float @test_shrink_intrin_ceil_fp16_src(half %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.ceil.f16(half [[C:%.*]])
; CHECK-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_ceil_fp16_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META424:![0-9]+]], !DIExpression(), [[META427:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call half @llvm.ceil.f16(half [[C:%.*]]), !dbg [[DBG428:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META425:![0-9]+]], !DIExpression(), [[DBG428]])
+; DBG-VALID-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float, !dbg [[DBG429:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META426:![0-9]+]], !DIExpression(), [[DBG429]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG430:![0-9]+]]
;
%D = fpext half %C to double
%E = call double @llvm.ceil.f64(double %D)
@@ -644,6 +1011,13 @@ define <2 x double> @test_shrink_intrin_round_fp16_vec(<2 x half> %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.round.v2f16(<2 x half> [[C:%.*]])
; CHECK-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>
; CHECK-NEXT: ret <2 x double> [[E]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_round_fp16_vec(
+; DBG-VALID-NEXT: #dbg_value(<2 x double> poison, [[META433:![0-9]+]], !DIExpression(), [[META435:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.round.v2f16(<2 x half> [[C:%.*]]), !dbg [[DBG436:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>, !dbg [[DBG436]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META434:![0-9]+]], !DIExpression(), [[DBG436]])
+; DBG-VALID-NEXT: ret <2 x double> [[E]], !dbg [[DBG437:![0-9]+]]
;
%D = fpext <2 x half> %C to <2 x double>
%E = call <2 x double> @llvm.round.v2f64(<2 x double> %D)
@@ -655,6 +1029,13 @@ define <2 x double> @test_shrink_intrin_roundeven_fp16_vec(<2 x half> %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.roundeven.v2f16(<2 x half> [[C:%.*]])
; CHECK-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>
; CHECK-NEXT: ret <2 x double> [[E]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_roundeven_fp16_vec(
+; DBG-VALID-NEXT: #dbg_value(<2 x double> poison, [[META440:![0-9]+]], !DIExpression(), [[META442:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.roundeven.v2f16(<2 x half> [[C:%.*]]), !dbg [[DBG443:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>, !dbg [[DBG443]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META441:![0-9]+]], !DIExpression(), [[DBG443]])
+; DBG-VALID-NEXT: ret <2 x double> [[E]], !dbg [[DBG444:![0-9]+]]
;
%D = fpext <2 x half> %C to <2 x double>
%E = call <2 x double> @llvm.roundeven.v2f64(<2 x double> %D)
@@ -666,6 +1047,14 @@ define float @test_shrink_intrin_nearbyint_fp16_src(half %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.nearbyint.f16(half [[C:%.*]])
; CHECK-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_nearbyint_fp16_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META447:![0-9]+]], !DIExpression(), [[META450:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call half @llvm.nearbyint.f16(half [[C:%.*]]), !dbg [[DBG451:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META448:![0-9]+]], !DIExpression(), [[DBG451]])
+; DBG-VALID-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float, !dbg [[DBG452:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META449:![0-9]+]], !DIExpression(), [[DBG452]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG453:![0-9]+]]
;
%D = fpext half %C to double
%E = call double @llvm.nearbyint.f64(double %D)
@@ -678,6 +1067,13 @@ define <2 x double> @test_shrink_intrin_trunc_fp16_src(<2 x half> %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.trunc.v2f16(<2 x half> [[C:%.*]])
; CHECK-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>
; CHECK-NEXT: ret <2 x double> [[E]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_trunc_fp16_src(
+; DBG-VALID-NEXT: #dbg_value(<2 x double> poison, [[META456:![0-9]+]], !DIExpression(), [[META458:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call <2 x half> @llvm.trunc.v2f16(<2 x half> [[C:%.*]]), !dbg [[DBG459:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = fpext <2 x half> [[TMP1]] to <2 x double>, !dbg [[DBG459]]
+; DBG-VALID-NEXT: #dbg_value(<2 x double> [[E]], [[META457:![0-9]+]], !DIExpression(), [[DBG459]])
+; DBG-VALID-NEXT: ret <2 x double> [[E]], !dbg [[DBG460:![0-9]+]]
;
%D = fpext <2 x half> %C to <2 x double>
%E = call <2 x double> @llvm.trunc.v2f64(<2 x double> %D)
@@ -689,6 +1085,14 @@ define float @test_shrink_intrin_fabs_fp16_src(half %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[C:%.*]])
; CHECK-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_fabs_fp16_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META463:![0-9]+]], !DIExpression(), [[META466:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call half @llvm.fabs.f16(half [[C:%.*]]), !dbg [[DBG467:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META464:![0-9]+]], !DIExpression(), [[DBG467]])
+; DBG-VALID-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float, !dbg [[DBG468:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META465:![0-9]+]], !DIExpression(), [[DBG468]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG469:![0-9]+]]
;
%D = fpext half %C to double
%E = call double @llvm.fabs.f64(double %D)
@@ -702,6 +1106,14 @@ define float @test_shrink_intrin_fabs_fast_fp16_src(half %C) {
; CHECK-NEXT: [[TMP1:%.*]] = call fast half @llvm.fabs.f16(half [[C:%.*]])
; CHECK-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float
; CHECK-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_shrink_intrin_fabs_fast_fp16_src(
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META472:![0-9]+]], !DIExpression(), [[META475:![0-9]+]])
+; DBG-VALID-NEXT: [[TMP1:%.*]] = call fast half @llvm.fabs.f16(half [[C:%.*]]), !dbg [[DBG476:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double poison, [[META473:![0-9]+]], !DIExpression(), [[DBG476]])
+; DBG-VALID-NEXT: [[F:%.*]] = fpext half [[TMP1]] to float, !dbg [[DBG477:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META474:![0-9]+]], !DIExpression(), [[DBG477]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG478:![0-9]+]]
;
%D = fpext half %C to double
%E = call fast double @llvm.fabs.f64(double %D)
@@ -723,6 +1135,16 @@ define float @test_no_shrink_intrin_floor_multi_use_fpext(half %C) {
; DOUBLE-8BYTE-ALIGN-NEXT: [[E:%.*]] = call double @llvm.floor.f64(double [[D]])
; DOUBLE-8BYTE-ALIGN-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; DOUBLE-8BYTE-ALIGN-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_floor_multi_use_fpext(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext half [[C:%.*]] to double, !dbg [[DBG484:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[D]], [[META481:![0-9]+]], !DIExpression(), [[DBG484]])
+; DBG-VALID-NEXT: store volatile double [[D]], ptr undef, align 8, !dbg [[DBG485:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.floor.f64(double [[D]]), !dbg [[DBG486:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META482:![0-9]+]], !DIExpression(), [[DBG486]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG487:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META483:![0-9]+]], !DIExpression(), [[DBG487]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG488:![0-9]+]]
;
%D = fpext half %C to double
store volatile double %D, ptr undef
@@ -745,6 +1167,16 @@ define float @test_no_shrink_intrin_fabs_multi_use_fpext(half %C) {
; DOUBLE-8BYTE-ALIGN-NEXT: [[E:%.*]] = call double @llvm.fabs.f64(double [[D]])
; DOUBLE-8BYTE-ALIGN-NEXT: [[F:%.*]] = fptrunc double [[E]] to float
; DOUBLE-8BYTE-ALIGN-NEXT: ret float [[F]]
+;
+; DBG-VALID-LABEL: @test_no_shrink_intrin_fabs_multi_use_fpext(
+; DBG-VALID-NEXT: [[D:%.*]] = fpext half [[C:%.*]] to double, !dbg [[DBG494:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[D]], [[META491:![0-9]+]], !DIExpression(), [[DBG494]])
+; DBG-VALID-NEXT: store volatile double [[D]], ptr undef, align 8, !dbg [[DBG495:![0-9]+]]
+; DBG-VALID-NEXT: [[E:%.*]] = call double @llvm.fabs.f64(double [[D]]), !dbg [[DBG496:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(double [[E]], [[META492:![0-9]+]], !DIExpression(), [[DBG496]])
+; DBG-VALID-NEXT: [[F:%.*]] = fptrunc double [[E]] to float, !dbg [[DBG497:![0-9]+]]
+; DBG-VALID-NEXT: #dbg_value(float [[F]], [[META493:![0-9]+]], !DIExpression(), [[DBG497]])
+; DBG-VALID-NEXT: ret float [[F]], !dbg [[DBG498:![0-9]+]]
;
%D = fpext half %C to double
store volatile double %D, ptr undef
diff --git a/llvm/test/Transforms/InstCombine/early_constfold_changes_IR.ll b/llvm/test/Transforms/InstCombine/early_constfold_changes_IR.ll
index 64fe1ef8e16d2..5a09c52f37b80 100644
--- a/llvm/test/Transforms/InstCombine/early_constfold_changes_IR.ll
+++ b/llvm/test/Transforms/InstCombine/early_constfold_changes_IR.ll
@@ -1,10 +1,12 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This run line verifies that we get the expected constant fold.
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
define i32 @foo(i32 %arg) #0 {
-; CHECK-LABEL: @foo(
-; CHECK-NEXT: entry:
-; CHECK-NEXT: [[AND:%.*]] = and i32 [[ARG:%.*]], 7
+; CHECK-LABEL: define i32 @foo(
+; CHECK-SAME: i32 [[ARG:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[AND:%.*]] = and i32 [[ARG]], 7
; CHECK-NEXT: ret i32 [[AND]]
;
entry:
diff --git a/llvm/test/Transforms/InstCombine/early_dce_clobbers_callgraph.ll b/llvm/test/Transforms/InstCombine/early_dce_clobbers_callgraph.ll
index ac24e6a63223a..7150411c35cca 100644
--- a/llvm/test/Transforms/InstCombine/early_dce_clobbers_callgraph.ll
+++ b/llvm/test/Transforms/InstCombine/early_dce_clobbers_callgraph.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=inline,instcombine -S | FileCheck %s
; This test case exposed a bug in instcombine where the early
@@ -12,8 +13,8 @@
; count in the CallGraph).
define void @foo() {
-; CHECK-LABEL: @foo(
-; CHECK-NEXT: entry:
+; CHECK-LABEL: define void @foo() {
+; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: ret void
;
entry:
@@ -22,7 +23,6 @@ entry:
}
define internal i32 @bar() {
-; CHECK-NOT: bar
entry:
ret i32 42
}
diff --git a/llvm/test/Transforms/InstCombine/enforce-known-alignment.ll b/llvm/test/Transforms/InstCombine/enforce-known-alignment.ll
index d9fd302b0722e..5160d793d52c6 100644
--- a/llvm/test/Transforms/InstCombine/enforce-known-alignment.ll
+++ b/llvm/test/Transforms/InstCombine/enforce-known-alignment.ll
@@ -1,28 +1,37 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S %s | FileCheck %s
target datalayout = "e-p:32:32:32-p1:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9.6"
define void @foo(i32) {
-; CHECK-LABEL: @foo(
-; CHECK: alloca
-; CHECK: align 16
- %2 = alloca [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], align 16 ; <ptr> [#uses=1]
- %3 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], ptr %2, i32 0, i32 0 ; <ptr> [#uses=1]
- %4 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>, ptr %3, i32 0, i32 0 ; <ptr> [#uses=1]
- %5 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }, ptr %4, i32 0, i32 0 ; <ptr> [#uses=1]
- %6 = getelementptr { [8 x i16] }, ptr %5, i32 0, i32 0 ; <ptr> [#uses=1]
- %7 = getelementptr [8 x i16], ptr %6, i32 0, i32 0 ; <ptr> [#uses=1]
- store i16 0, ptr %7, align 16
- call void @bar(ptr %7)
- ret void
+; CHECK-LABEL: define void @foo(
+; CHECK-SAME: i32 [[TMP0:%.*]]) {
+; CHECK-NEXT: [[TMP2:%.*]] = alloca [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], align 16
+; CHECK-NEXT: store i16 0, ptr [[TMP2]], align 16
+; CHECK-NEXT: call void @bar(ptr nonnull [[TMP2]])
+; CHECK-NEXT: ret void
+;
+ %2 = alloca [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], align 16 ; <ptr> [#uses=1]
+ %3 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], ptr %2, i32 0, i32 0 ; <ptr> [#uses=1]
+ %4 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>, ptr %3, i32 0, i32 0 ; <ptr> [#uses=1]
+ %5 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }, ptr %4, i32 0, i32 0 ; <ptr> [#uses=1]
+ %6 = getelementptr { [8 x i16] }, ptr %5, i32 0, i32 0 ; <ptr> [#uses=1]
+ %7 = getelementptr [8 x i16], ptr %6, i32 0, i32 0 ; <ptr> [#uses=1]
+ store i16 0, ptr %7, align 16
+ call void @bar(ptr %7)
+ ret void
}
declare void @bar(ptr)
define void @foo_as1(i32 %a, ptr addrspace(1) %b) {
-; CHECK-LABEL: @foo_as1(
-; CHECK: align 16
+; CHECK-LABEL: define void @foo_as1(
+; CHECK-SAME: i32 [[A:%.*]], ptr addrspace(1) [[B:%.*]]) {
+; CHECK-NEXT: store i16 0, ptr addrspace(1) [[B]], align 16
+; CHECK-NEXT: call void @bar_as1(ptr addrspace(1) [[B]])
+; CHECK-NEXT: ret void
+;
%1 = getelementptr [3 x <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>], ptr addrspace(1) %b, i32 0, i32 0 ; <ptr> [#uses=1]
%2 = getelementptr <{ { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } } }>, ptr addrspace(1) %1, i32 0, i32 0 ; <ptr> [#uses=1]
%3 = getelementptr { { [2 x { { i32 } }], [2 x i8], { i16 }, [2 x i8], i8, i8 } }, ptr addrspace(1) %2, i32 0, i32 0 ; <ptr> [#uses=1]
diff --git a/llvm/test/Transforms/InstCombine/erase-dbg-values-at-dead-alloc-site.ll b/llvm/test/Transforms/InstCombine/erase-dbg-values-at-dead-alloc-site.ll
index 27c6c5c305f94..785a2afd7e977 100644
--- a/llvm/test/Transforms/InstCombine/erase-dbg-values-at-dead-alloc-site.ll
+++ b/llvm/test/Transforms/InstCombine/erase-dbg-values-at-dead-alloc-site.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=instcombine %s | FileCheck %s -check-prefix=RUN-ONCE
; RUN: opt -S -passes=instcombine %s --try-experimental-debuginfo-iterators | FileCheck %s -check-prefix=RUN-ONCE
@@ -11,11 +12,13 @@
; Check that the DW_OP_deref dbg.value is deleted, just like a dbg.declare would
; be.
;
-; RUN-ONCE-LABEL: @t1(
-; RUN-ONCE-NEXT: #dbg_value(i32 %0, [[t1_arg0:![0-9]+]], !DIExpression(),
-; RUN-ONCE-NEXT: #dbg_value(ptr poison, [[t1_fake_ptr:![0-9]+]], !DIExpression(),
-; RUN-ONCE-NEXT: ret void
define void @t1(i32) !dbg !9 {
+; RUN-ONCE-LABEL: define void @t1(
+; RUN-ONCE-SAME: i32 [[TMP0:%.*]]) !dbg [[DBG9:![0-9]+]] {
+; RUN-ONCE-NEXT: #dbg_value(i32 [[TMP0]], [[META14:![0-9]+]], !DIExpression(), [[META15:![0-9]+]])
+; RUN-ONCE-NEXT: #dbg_value(ptr poison, [[META16:![0-9]+]], !DIExpression(), [[META15]])
+; RUN-ONCE-NEXT: ret void
+;
%2 = alloca i32, align 4
store i32 %0, ptr %2, align 4
call void @llvm.dbg.value(metadata i32 %0, metadata !14, metadata !DIExpression()), !dbg !15
@@ -51,8 +54,6 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata)
!llvm.dbg.cu = !{!5}
!llvm.ident = !{!8}
-; RUN-ONCE: [[t1_arg0]] = !DILocalVariable(name: "a"
-; RUN-ONCE: [[t1_fake_ptr]] = !DILocalVariable(name: "fake_ptr"
!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 10, i32 14]}
!1 = !{i32 2, !"Dwarf Version", i32 4}
@@ -75,3 +76,16 @@ declare void @llvm.dbg.declare(metadata, metadata, metadata)
!18 = !DILocalVariable(name: "x", arg: 1, scope: !17, file: !10, line: 1, type: !13)
!19 = !DILocation(line: 1, column: 1, scope: !17)
!20 = !DILocalVariable(name: "fake_ptr", scope: !9, file: !10, line: 1, type: !13)
+;.
+; RUN-ONCE: [[META5:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META6:![0-9]+]], isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META7:![0-9]+]], nameTableKind: GNU)
+; RUN-ONCE: [[META6]] = !DIFile(filename: "-", directory: {{.*}})
+; RUN-ONCE: [[META7]] = !{}
+; RUN-ONCE: [[DBG9]] = distinct !DISubprogram(name: "t1", scope: [[META10:![0-9]+]], file: [[META10]], line: 1, type: [[META11:![0-9]+]], scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: [[META5]], retainedNodes: [[META7]])
+; RUN-ONCE: [[META10]] = !DIFile(filename: "<stdin>", directory: {{.*}})
+; RUN-ONCE: [[META11]] = !DISubroutineType(types: [[META12:![0-9]+]])
+; RUN-ONCE: [[META12]] = !{null, [[META13:![0-9]+]]}
+; RUN-ONCE: [[META13]] = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+; RUN-ONCE: [[META14]] = !DILocalVariable(name: "a", arg: 1, scope: [[DBG9]], file: [[META10]], line: 1, type: [[META13]])
+; RUN-ONCE: [[META15]] = !DILocation(line: 1, column: 13, scope: [[DBG9]])
+; RUN-ONCE: [[META16]] = !DILocalVariable(name: "fake_ptr", scope: [[DBG9]], file: [[META10]], line: 1, type: [[META13]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/err-rep-cold.ll b/llvm/test/Transforms/InstCombine/err-rep-cold.ll
index 26df928e5c72a..2db02df7b506a 100644
--- a/llvm/test/Transforms/InstCombine/err-rep-cold.ll
+++ b/llvm/test/Transforms/InstCombine/err-rep-cold.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test the static branch probability heuristics for error-reporting functions.
; RUN: opt < %s -passes=instcombine -S | FileCheck -enable-var-scope %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
@@ -12,7 +13,19 @@ target triple = "x86_64-unknown-linux-gnu"
@.str1 = private unnamed_addr constant [9 x i8] c"an error\00", align 1
define i32 @test1(i32 %a) #0 {
-; CHECK-LABEL: @test1
+; CHECK-LABEL: define i32 @test1(
+; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 8
+; CHECK-NEXT: br i1 [[CMP]], label %[[IF_THEN:.*]], label %[[RETURN:.*]]
+; CHECK: [[IF_THEN]]:
+; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr @stderr, align 8
+; CHECK-NEXT: [[CALL:%.*]] = tail call i32 (ptr, ptr, ...) @fprintf(ptr [[TMP0]], ptr nonnull @.str, i32 [[A]]) #[[ATTR2:[0-9]+]]
+; CHECK-NEXT: br label %[[RETURN]]
+; CHECK: [[RETURN]]:
+; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 1, %[[IF_THEN]] ], [ 0, %[[ENTRY]] ]
+; CHECK-NEXT: ret i32 [[RETVAL_0]]
+;
entry:
%cmp = icmp sgt i32 %a, 8
br i1 %cmp, label %if.then, label %return
@@ -22,7 +35,6 @@ if.then: ; preds = %entry
%call = tail call i32 (ptr, ptr, ...) @fprintf(ptr %0, ptr @.str, i32 %a) #1
br label %return
-; CHECK: %call = tail call i32 (ptr, ptr, ...) @fprintf(ptr %0, ptr nonnull @.str, i32 %a) #[[$AT1:[0-9]+]]
return: ; preds = %entry, %if.then
%retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ]
@@ -32,7 +44,19 @@ return: ; preds = %entry, %if.then
declare i32 @fprintf(ptr nocapture, ptr nocapture readonly, ...) #1
define i32 @test2(i32 %a) #0 {
-; CHECK-LABEL: @test2
+; CHECK-LABEL: define i32 @test2(
+; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 8
+; CHECK-NEXT: br i1 [[CMP]], label %[[IF_THEN:.*]], label %[[RETURN:.*]]
+; CHECK: [[IF_THEN]]:
+; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr @stderr, align 8
+; CHECK-NEXT: [[TMP1:%.*]] = tail call i64 @fwrite(ptr nonnull @.str1, i64 8, i64 1, ptr [[TMP0]]) #[[ATTR3:[0-9]+]]
+; CHECK-NEXT: br label %[[RETURN]]
+; CHECK: [[RETURN]]:
+; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 1, %[[IF_THEN]] ], [ 0, %[[ENTRY]] ]
+; CHECK-NEXT: ret i32 [[RETVAL_0]]
+;
entry:
%cmp = icmp sgt i32 %a, 8
br i1 %cmp, label %if.then, label %return
@@ -42,7 +66,6 @@ if.then: ; preds = %entry
%1 = tail call i64 @fwrite(ptr @.str1, i64 8, i64 1, ptr %0)
br label %return
-; CHECK: tail call i64 @fwrite(ptr nonnull @.str1, i64 8, i64 1, ptr %0) #[[$AT2:[0-9]+]]
return: ; preds = %entry, %if.then
%retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ]
@@ -52,7 +75,19 @@ return: ; preds = %entry, %if.then
declare i64 @fwrite(ptr nocapture, i64, i64, ptr nocapture) #1
define i32 @test3(i32 %a) #0 {
-; CHECK-LABEL: @test3
+; CHECK-LABEL: define i32 @test3(
+; CHECK-SAME: i32 [[A:%.*]]) #[[ATTR0]] {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[A]], 8
+; CHECK-NEXT: br i1 [[CMP]], label %[[IF_THEN:.*]], label %[[RETURN:.*]]
+; CHECK: [[IF_THEN]]:
+; CHECK-NEXT: [[TMP0:%.*]] = load ptr, ptr @stdout, align 8
+; CHECK-NEXT: [[TMP1:%.*]] = tail call i64 @fwrite(ptr nonnull @.str1, i64 8, i64 1, ptr [[TMP0]])
+; CHECK-NEXT: br label %[[RETURN]]
+; CHECK: [[RETURN]]:
+; CHECK-NEXT: [[RETVAL_0:%.*]] = phi i32 [ 1, %[[IF_THEN]] ], [ 0, %[[ENTRY]] ]
+; CHECK-NEXT: ret i32 [[RETVAL_0]]
+;
entry:
%cmp = icmp sgt i32 %a, 8
br i1 %cmp, label %if.then, label %return
@@ -62,7 +97,6 @@ if.then: ; preds = %entry
%1 = tail call i64 @fwrite(ptr @.str1, i64 8, i64 1, ptr %0)
br label %return
-; CHECK-NOT: tail call i64 @fwrite(ptr @.str1, i64 8, i64 1, ptr %0) #[[$AT2]]
return: ; preds = %entry, %if.then
%retval.0 = phi i32 [ 1, %if.then ], [ 0, %entry ]
@@ -72,6 +106,4 @@ return: ; preds = %entry, %if.then
attributes #0 = { nounwind uwtable }
attributes #1 = { nounwind }
-; CHECK: attributes #[[$AT1]] = { cold nounwind }
-; CHECK: attributes #[[$AT2]] = { cold }
diff --git a/llvm/test/Transforms/InstCombine/extractelement.ll b/llvm/test/Transforms/InstCombine/extractelement.ll
index 28a4702559c46..97ca9069a5f77 100644
--- a/llvm/test/Transforms/InstCombine/extractelement.ll
+++ b/llvm/test/Transforms/InstCombine/extractelement.ll
@@ -800,11 +800,8 @@ define i32 @extelt_vecselect_const_operand_vector(<3 x i1> %c) {
define i32 @extelt_select_const_operand_extractelt_use(i1 %c) {
; ANY-LABEL: @extelt_select_const_operand_extractelt_use(
-; ANY-NEXT: [[E:%.*]] = select i1 [[C:%.*]], i32 4, i32 7
-; ANY-NEXT: [[M:%.*]] = shl nuw nsw i32 [[E]], 1
-; ANY-NEXT: [[M_2:%.*]] = shl nuw nsw i32 [[E]], 2
-; ANY-NEXT: [[R:%.*]] = mul nuw nsw i32 [[M]], [[M_2]]
-; ANY-NEXT: ret i32 [[R]]
+; ANY-NEXT: [[TMP1:%.*]] = select i1 [[C:%.*]], i32 128, i32 392
+; ANY-NEXT: ret i32 [[TMP1]]
;
%s = select i1 %c, <3 x i32> <i32 2, i32 3, i32 4>, <3 x i32> <i32 5, i32 6, i32 7>
%e = extractelement <3 x i32> %s, i32 2
diff --git a/llvm/test/Transforms/InstCombine/extractinsert-tbaa.ll b/llvm/test/Transforms/InstCombine/extractinsert-tbaa.ll
index 62c2955235abb..2302390804dc4 100644
--- a/llvm/test/Transforms/InstCombine/extractinsert-tbaa.ll
+++ b/llvm/test/Transforms/InstCombine/extractinsert-tbaa.ll
@@ -1,45 +1,65 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=instcombine %s -o - | FileCheck %s
%Complex = type { double, double }
; Check that instcombine preserves TBAA when narrowing loads
define double @teststructextract(ptr %val) {
-; CHECK: load double, {{.*}}, !tbaa
-; CHECK-NOT: load %Complex
- %loaded = load %Complex, ptr %val, !tbaa !1
- %real = extractvalue %Complex %loaded, 0
- ret double %real
+; CHECK-LABEL: define double @teststructextract(
+; CHECK-SAME: ptr [[VAL:%.*]]) {
+; CHECK-NEXT: [[LOADED_UNPACK:%.*]] = load double, ptr [[VAL]], align 8, !tbaa [[TBAA0:![0-9]+]]
+; CHECK-NEXT: ret double [[LOADED_UNPACK]]
+;
+ %loaded = load %Complex, ptr %val, !tbaa !1
+ %real = extractvalue %Complex %loaded, 0
+ ret double %real
}
define double @testarrayextract(ptr %val) {
-; CHECK: load double, {{.*}}, !tbaa
-; CHECK-NOT: load [2 x double]
- %loaded = load [2 x double], ptr %val, !tbaa !1
- %real = extractvalue [2 x double] %loaded, 0
- ret double %real
+; CHECK-LABEL: define double @testarrayextract(
+; CHECK-SAME: ptr [[VAL:%.*]]) {
+; CHECK-NEXT: [[LOADED_UNPACK:%.*]] = load double, ptr [[VAL]], align 8, !tbaa [[TBAA0]]
+; CHECK-NEXT: ret double [[LOADED_UNPACK]]
+;
+ %loaded = load [2 x double], ptr %val, !tbaa !1
+ %real = extractvalue [2 x double] %loaded, 0
+ ret double %real
}
; Check that inscombine preserves TBAA when breaking up stores
define void @teststructinsert(ptr %loc, double %a, double %b) {
-; CHECK: store double %a, {{.*}}, !tbaa
-; CHECK: store double %b, {{.*}}, !tbaa
-; CHECK-NOT: store %Complex
- %inserted = insertvalue %Complex undef, double %a, 0
- %inserted2 = insertvalue %Complex %inserted, double %b, 1
- store %Complex %inserted2, ptr %loc, !tbaa !1
- ret void
+; CHECK-LABEL: define void @teststructinsert(
+; CHECK-SAME: ptr [[LOC:%.*]], double [[A:%.*]], double [[B:%.*]]) {
+; CHECK-NEXT: store double [[A]], ptr [[LOC]], align 8, !tbaa [[TBAA0]]
+; CHECK-NEXT: [[LOC_REPACK1:%.*]] = getelementptr inbounds i8, ptr [[LOC]], i64 8
+; CHECK-NEXT: store double [[B]], ptr [[LOC_REPACK1]], align 8, !tbaa [[TBAA0]]
+; CHECK-NEXT: ret void
+;
+ %inserted = insertvalue %Complex undef, double %a, 0
+ %inserted2 = insertvalue %Complex %inserted, double %b, 1
+ store %Complex %inserted2, ptr %loc, !tbaa !1
+ ret void
}
define void @testarrayinsert(ptr %loc, double %a, double %b) {
-; CHECK: store double %a, {{.*}}, !tbaa
-; CHECK: store double %b, {{.*}}, !tbaa
-; CHECK-NOT: store [2 x double]
- %inserted = insertvalue [2 x double] undef, double %a, 0
- %inserted2 = insertvalue [2 x double] %inserted, double %b, 1
- store [2 x double] %inserted2, ptr %loc, !tbaa !1
- ret void
+; CHECK-LABEL: define void @testarrayinsert(
+; CHECK-SAME: ptr [[LOC:%.*]], double [[A:%.*]], double [[B:%.*]]) {
+; CHECK-NEXT: store double [[A]], ptr [[LOC]], align 8, !tbaa [[TBAA0]]
+; CHECK-NEXT: [[LOC_REPACK1:%.*]] = getelementptr inbounds i8, ptr [[LOC]], i64 8
+; CHECK-NEXT: store double [[B]], ptr [[LOC_REPACK1]], align 8, !tbaa [[TBAA0]]
+; CHECK-NEXT: ret void
+;
+ %inserted = insertvalue [2 x double] undef, double %a, 0
+ %inserted2 = insertvalue [2 x double] %inserted, double %b, 1
+ store [2 x double] %inserted2, ptr %loc, !tbaa !1
+ ret void
}
!0 = !{!"tbaa_root"}
!1 = !{!2, !2, i64 0}
!2 = !{!"Complex", !0, i64 0}
+;.
+; CHECK: [[TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0}
+; CHECK: [[META1]] = !{!"Complex", [[META2:![0-9]+]], i64 0}
+; CHECK: [[META2]] = !{!"tbaa_root"}
+;.
diff --git a/llvm/test/Transforms/InstCombine/gc.relocate-verify.ll b/llvm/test/Transforms/InstCombine/gc.relocate-verify.ll
index 5c689796e4db8..f7ab318d494a5 100644
--- a/llvm/test/Transforms/InstCombine/gc.relocate-verify.ll
+++ b/llvm/test/Transforms/InstCombine/gc.relocate-verify.ll
@@ -1,17 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=verify -S < %s | FileCheck %s
target triple = "x86_64-unknown-linux-gnu"
define i32 @check_verify_undef_token() gc "statepoint-example" {
-
+; CHECK-LABEL: define i32 @check_verify_undef_token() gc "statepoint-example" {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: ret i32 0
+; CHECK: [[UNREACH:.*:]]
+; CHECK-NEXT: [[TOKEN_CALL:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token undef, i32 0, i32 0)
+; CHECK-NEXT: ret i32 1
+;
entry:
- ; CHECK: ret i32 0
- ret i32 0
+ ret i32 0
unreach:
- ; CHECK: token undef
- %token_call = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token undef, i32 0, i32 0)
- ret i32 1
+ %token_call = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token undef, i32 0, i32 0)
+ ret i32 1
}
declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
diff --git a/llvm/test/Transforms/InstCombine/gc.relocate.ll b/llvm/test/Transforms/InstCombine/gc.relocate.ll
index 24b7fd0ed2d26..4cb4bc889d4db 100644
--- a/llvm/test/Transforms/InstCombine/gc.relocate.ll
+++ b/llvm/test/Transforms/InstCombine/gc.relocate.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
@@ -11,42 +12,59 @@ declare ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token, i32, i32)
define i32 @explicit_nonnull(ptr addrspace(1) nonnull %dparam) gc "statepoint-example" {
; Checks that a nonnull pointer
-; CHECK-LABEL: @explicit_nonnull
-; CHECK: ret i32 1
+; CHECK-LABEL: define i32 @explicit_nonnull(
+; CHECK-SAME: ptr addrspace(1) nonnull [[DPARAM:%.*]]) gc "statepoint-example" {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[TOK:%.*]] = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
+; CHECK-NEXT: ret i32 1
+;
entry:
- %load = load i32, ptr addrspace(1) %dparam
- %tok = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %dparam)]
- %relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok, i32 0, i32 0)
- %cmp = icmp eq ptr addrspace(1) %relocate, null
- %ret_val = select i1 %cmp, i32 0, i32 1
- ret i32 %ret_val
+ %load = load i32, ptr addrspace(1) %dparam
+ %tok = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %dparam)]
+ %relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok, i32 0, i32 0)
+ %cmp = icmp eq ptr addrspace(1) %relocate, null
+ %ret_val = select i1 %cmp, i32 0, i32 1
+ ret i32 %ret_val
}
define i32 @implicit_nonnull(ptr addrspace(1) %dparam) gc "statepoint-example" {
; Checks that a nonnull pointer
-; CHECK-LABEL: @implicit_nonnull
-; CHECK: ret i32 1
+; CHECK-LABEL: define i32 @implicit_nonnull(
+; CHECK-SAME: ptr addrspace(1) [[DPARAM:%.*]]) gc "statepoint-example" {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[COND:%.*]] = icmp eq ptr addrspace(1) [[DPARAM]], null
+; CHECK-NEXT: br i1 [[COND]], label %[[NO_GC:.*]], label %[[GC:.*]]
+; CHECK: [[GC]]:
+; CHECK-NEXT: [[TOK:%.*]] = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
+; CHECK-NEXT: ret i32 1
+; CHECK: [[NO_GC]]:
+; CHECK-NEXT: unreachable
+;
entry:
- %cond = icmp eq ptr addrspace(1) %dparam, null
- br i1 %cond, label %no_gc, label %gc
+ %cond = icmp eq ptr addrspace(1) %dparam, null
+ br i1 %cond, label %no_gc, label %gc
gc:
- %load = load i32, ptr addrspace(1) %dparam
- %tok = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %dparam)]
- %relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok, i32 0, i32 0)
- %cmp = icmp eq ptr addrspace(1) %relocate, null
- %ret_val = select i1 %cmp, i32 0, i32 1
- ret i32 %ret_val
+ %load = load i32, ptr addrspace(1) %dparam
+ %tok = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %dparam)]
+ %relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok, i32 0, i32 0)
+ %cmp = icmp eq ptr addrspace(1) %relocate, null
+ %ret_val = select i1 %cmp, i32 0, i32 1
+ ret i32 %ret_val
no_gc:
- unreachable
+ unreachable
}
; Make sure we don't crash when processing vectors
define <2 x ptr addrspace(1)> @vector(<2 x ptr addrspace(1)> %obj) gc "statepoint-example" {
+; CHECK-LABEL: define <2 x ptr addrspace(1)> @vector(
+; CHECK-SAME: <2 x ptr addrspace(1)> [[OBJ:%.*]]) gc "statepoint-example" {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(<2 x ptr addrspace(1)> [[OBJ]]) ]
+; CHECK-NEXT: [[OBJ_RELOCATED:%.*]] = call coldcc <2 x ptr addrspace(1)> @llvm.experimental.gc.relocate.v2p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
+; CHECK-NEXT: ret <2 x ptr addrspace(1)> [[OBJ_RELOCATED]]
+;
entry:
-; CHECK-LABEL: @vector
-; CHECK: gc.statepoint
-; CHECK: gc.relocate
%safepoint_token = call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(void ()) @do_safepoint, i32 0, i32 0, i32 0, i32 0) ["gc-live"(<2 x ptr addrspace(1)> %obj)]
%obj.relocated = call coldcc <2 x ptr addrspace(1)> @llvm.experimental.gc.relocate.v2p1(token %safepoint_token, i32 0, i32 0) ; (%obj, %obj)
ret <2 x ptr addrspace(1)> %obj.relocated
@@ -54,8 +72,13 @@ entry:
define ptr addrspace(1) @canonical_base(ptr addrspace(1) %dparam) gc "statepoint-example" {
; Checks that a nonnull pointer
-; CHECK-LABEL: @canonical_base
-; CHECK: (token %tok, i32 0, i32 0) ; (%dparam, %dparam)
+; CHECK-LABEL: define ptr addrspace(1) @canonical_base(
+; CHECK-SAME: ptr addrspace(1) [[DPARAM:%.*]]) gc "statepoint-example" {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[TOK:%.*]] = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) [[DPARAM]]) ]
+; CHECK-NEXT: [[RELOCATE:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[TOK]], i32 0, i32 0)
+; CHECK-NEXT: ret ptr addrspace(1) [[RELOCATE]]
+;
entry:
%tok = tail call token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr elementtype(i1 ()) @return_i1, i32 0, i32 0, i32 0, i32 0) ["gc-live"(ptr addrspace(1) %dparam, ptr addrspace(1) %dparam)]
%relocate = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token %tok, i32 0, i32 1)
diff --git a/llvm/test/Transforms/InstCombine/gep-alias.ll b/llvm/test/Transforms/InstCombine/gep-alias.ll
index 075359be6c406..03291236d5b9b 100644
--- a/llvm/test/Transforms/InstCombine/gep-alias.ll
+++ b/llvm/test/Transforms/InstCombine/gep-alias.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=instcombine -o - %s | FileCheck %s
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
@@ -7,8 +8,14 @@ target triple = "aarch64-unknown-linux-android10000"
@x = alias [3 x i32], inttoptr (i64 add (i64 ptrtoint (ptr @x.hwasan to i64), i64 -8718968878589280256) to ptr)
define i32 @f(i64 %i) {
+; CHECK-LABEL: define i32 @f(
+; CHECK-SAME: i64 [[I:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds [3 x i32], ptr @x, i64 0, i64 [[I]]
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
+; CHECK-NEXT: ret i32 [[TMP0]]
+;
entry:
- ; CHECK: getelementptr inbounds [3 x i32], ptr @x
%arrayidx = getelementptr inbounds [3 x i32], ptr @x, i64 0, i64 %i
%0 = load i32, ptr %arrayidx
ret i32 %0
diff --git a/llvm/test/Transforms/InstCombine/gep-can-replace-gep-idx-with-zero-typesize.ll b/llvm/test/Transforms/InstCombine/gep-can-replace-gep-idx-with-zero-typesize.ll
index 5be2b90bf7a62..da5fb7a67cc17 100644
--- a/llvm/test/Transforms/InstCombine/gep-can-replace-gep-idx-with-zero-typesize.ll
+++ b/llvm/test/Transforms/InstCombine/gep-can-replace-gep-idx-with-zero-typesize.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=instcombine < %s
; This regression test is verifying that the optimization defined by
diff --git a/llvm/test/Transforms/InstCombine/gep-sext.ll b/llvm/test/Transforms/InstCombine/gep-sext.ll
index e1742e1c66178..586aae1231b6a 100644
--- a/llvm/test/Transforms/InstCombine/gep-sext.ll
+++ b/llvm/test/Transforms/InstCombine/gep-sext.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-pc-win32"
@@ -6,9 +7,14 @@ declare void @use(i32) readonly
; We prefer to canonicalize the machine width gep indices early
define void @test(ptr %p, i32 %index) {
-; CHECK-LABEL: @test
-; CHECK-NEXT: %1 = sext i32 %index to i64
-; CHECK-NEXT: %addr = getelementptr i32, ptr %p, i64 %1
+; CHECK-LABEL: define void @test(
+; CHECK-SAME: ptr [[P:%.*]], i32 [[INDEX:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = sext i32 [[INDEX]] to i64
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[P]], i64 [[TMP1]]
+; CHECK-NEXT: [[VAL:%.*]] = load i32, ptr [[ADDR]], align 4
+; CHECK-NEXT: call void @use(i32 [[VAL]])
+; CHECK-NEXT: ret void
+;
%addr = getelementptr i32, ptr %p, i32 %index
%val = load i32, ptr %addr
call void @use(i32 %val)
@@ -16,9 +22,14 @@ define void @test(ptr %p, i32 %index) {
}
; If they've already been canonicalized via zext, that's fine
define void @test2(ptr %p, i32 %index) {
-; CHECK-LABEL: @test2
-; CHECK-NEXT: %i = zext i32 %index to i64
-; CHECK-NEXT: %addr = getelementptr i32, ptr %p, i64 %i
+; CHECK-LABEL: define void @test2(
+; CHECK-SAME: ptr [[P:%.*]], i32 [[INDEX:%.*]]) {
+; CHECK-NEXT: [[I:%.*]] = zext i32 [[INDEX]] to i64
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[P]], i64 [[I]]
+; CHECK-NEXT: [[VAL:%.*]] = load i32, ptr [[ADDR]], align 4
+; CHECK-NEXT: call void @use(i32 [[VAL]])
+; CHECK-NEXT: ret void
+;
%i = zext i32 %index to i64
%addr = getelementptr i32, ptr %p, i64 %i
%val = load i32, ptr %addr
@@ -28,9 +39,17 @@ define void @test2(ptr %p, i32 %index) {
; If we can use a zext, we prefer that. This requires
; knowing that the index is positive.
define void @test3(ptr %p, i32 %index) {
-; CHECK-LABEL: @test3
-; CHECK: zext
-; CHECK-NOT: sext
+; CHECK-LABEL: define void @test3(
+; CHECK-SAME: ptr [[P:%.*]], i32 [[INDEX:%.*]]) {
+; CHECK-NEXT: [[ADDR_BEGIN:%.*]] = getelementptr i8, ptr [[P]], i64 160
+; CHECK-NEXT: [[ADDR_FIXED:%.*]] = getelementptr i8, ptr [[P]], i64 352
+; CHECK-NEXT: [[VAL_FIXED:%.*]] = load i32, ptr [[ADDR_FIXED]], align 4, !range [[RNG0:![0-9]+]]
+; CHECK-NEXT: [[TMP1:%.*]] = zext nneg i32 [[VAL_FIXED]] to i64
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ADDR_BEGIN]], i64 [[TMP1]]
+; CHECK-NEXT: [[VAL:%.*]] = load i32, ptr [[ADDR]], align 4
+; CHECK-NEXT: call void @use(i32 [[VAL]])
+; CHECK-NEXT: ret void
+;
%addr_begin = getelementptr i32, ptr %p, i64 40
%addr_fixed = getelementptr i32, ptr %addr_begin, i64 48
%val_fixed = load i32, ptr %addr_fixed, !range !0
@@ -41,9 +60,17 @@ define void @test3(ptr %p, i32 %index) {
}
; Replace sext with zext where possible
define void @test4(ptr %p, i32 %index) {
-; CHECK-LABEL: @test4
-; CHECK: zext
-; CHECK-NOT: sext
+; CHECK-LABEL: define void @test4(
+; CHECK-SAME: ptr [[P:%.*]], i32 [[INDEX:%.*]]) {
+; CHECK-NEXT: [[ADDR_BEGIN:%.*]] = getelementptr i8, ptr [[P]], i64 160
+; CHECK-NEXT: [[ADDR_FIXED:%.*]] = getelementptr i8, ptr [[P]], i64 352
+; CHECK-NEXT: [[VAL_FIXED:%.*]] = load i32, ptr [[ADDR_FIXED]], align 4, !range [[RNG0]]
+; CHECK-NEXT: [[I:%.*]] = zext nneg i32 [[VAL_FIXED]] to i64
+; CHECK-NEXT: [[ADDR:%.*]] = getelementptr i32, ptr [[ADDR_BEGIN]], i64 [[I]]
+; CHECK-NEXT: [[VAL:%.*]] = load i32, ptr [[ADDR]], align 4
+; CHECK-NEXT: call void @use(i32 [[VAL]])
+; CHECK-NEXT: ret void
+;
%addr_begin = getelementptr i32, ptr %p, i64 40
%addr_fixed = getelementptr i32, ptr %addr_begin, i64 48
%val_fixed = load i32, ptr %addr_fixed, !range !0
@@ -59,3 +86,6 @@ define void @test4(ptr %p, i32 %index) {
+;.
+; CHECK: [[RNG0]] = !{i32 0, i32 2147483647}
+;.
diff --git a/llvm/test/Transforms/InstCombine/gepofconstgepi8.ll b/llvm/test/Transforms/InstCombine/gepofconstgepi8.ll
index 4c8c56a9262e3..8a92f731484df 100644
--- a/llvm/test/Transforms/InstCombine/gepofconstgepi8.ll
+++ b/llvm/test/Transforms/InstCombine/gepofconstgepi8.ll
@@ -282,8 +282,8 @@ define ptr @test_scalable(ptr %base, i64 %a) {
; CHECK-NEXT: [[P1:%.*]] = getelementptr i8, ptr [[BASE]], i64 -4
; CHECK-NEXT: [[INDEX:%.*]] = add i64 [[A]], 1
; CHECK-NEXT: [[TMP0:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[TMP0]], 4
-; CHECK-NEXT: [[P2_IDX:%.*]] = mul i64 [[INDEX]], [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i64 [[INDEX]], [[TMP0]]
+; CHECK-NEXT: [[P2_IDX:%.*]] = shl i64 [[TMP1]], 4
; CHECK-NEXT: [[P2:%.*]] = getelementptr i8, ptr [[P1]], i64 [[P2_IDX]]
; CHECK-NEXT: ret ptr [[P2]]
;
diff --git a/llvm/test/Transforms/InstCombine/gepphigep.ll b/llvm/test/Transforms/InstCombine/gepphigep.ll
index 93266c6754396..af240fd4c8a03 100644
--- a/llvm/test/Transforms/InstCombine/gepphigep.ll
+++ b/llvm/test/Transforms/InstCombine/gepphigep.ll
@@ -86,12 +86,12 @@ define i32 @test3(ptr %dm, i1 %tmp4, i64 %tmp9, i64 %tmp19, i64 %tmp20, i64 %tmp
; CHECK: bb3:
; CHECK-NEXT: [[TMP0:%.*]] = phi i64 [ [[TMP19]], [[BB1]] ], [ [[TMP20]], [[BB2]] ]
; CHECK-NEXT: [[TMP22:%.*]] = invoke i32 @foo1(i32 11)
-; CHECK-NEXT: to label [[BB4:%.*]] unwind label [[BB5:%.*]]
+; CHECK-NEXT: to label [[BB4:%.*]] unwind label [[BB5:%.*]]
; CHECK: bb4:
; CHECK-NEXT: ret i32 0
; CHECK: bb5:
; CHECK-NEXT: [[TMP27:%.*]] = landingpad { ptr, i32 }
-; CHECK-NEXT: catch ptr @_ZTIi
+; CHECK-NEXT: catch ptr @_ZTIi
; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [[STRUCT3]], ptr [[DM]], i64 [[TMP0]], i32 1
; CHECK-NEXT: [[TMP35:%.*]] = getelementptr inbounds [[STRUCT4:%.*]], ptr [[TMP1]], i64 [[TMP21:%.*]], i32 1, i32 1
; CHECK-NEXT: [[TMP25:%.*]] = load i32, ptr [[TMP35]], align 4
diff --git a/llvm/test/Transforms/InstCombine/getelementptr-folding.ll b/llvm/test/Transforms/InstCombine/getelementptr-folding.ll
index 1386192eca808..559e58c04dc96 100644
--- a/llvm/test/Transforms/InstCombine/getelementptr-folding.ll
+++ b/llvm/test/Transforms/InstCombine/getelementptr-folding.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
; We used to fold this by rewriting the indices to 0, 0, 2, 0. This is
@@ -10,4 +11,5 @@ target triple = "x86_64-apple-macosx10.11.0"
@matrix_identity_float3x3 = external global %struct.matrix_float3x3, align 16
@bbb = global ptr getelementptr inbounds (%struct.matrix_float3x3, ptr @matrix_identity_float3x3, i64 0, i32 0, i64 1, i64 3)
-; CHECK: @bbb = global ptr getelementptr inbounds (%struct.matrix_float3x3, ptr @matrix_identity_float3x3, i64 0, i32 0, i64 1, i64 3)
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; CHECK: {{.*}}
diff --git a/llvm/test/Transforms/InstCombine/icmp-and-shift.ll b/llvm/test/Transforms/InstCombine/icmp-and-shift.ll
index 08d23e84c3960..08e5f4a8da9b0 100644
--- a/llvm/test/Transforms/InstCombine/icmp-and-shift.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-and-shift.ll
@@ -523,8 +523,8 @@ define i1 @slt_and_shl_one(i8 %x, i8 %y) {
define i1 @fold_eq_lhs(i8 %x, i8 %y) {
; CHECK-LABEL: @fold_eq_lhs(
-; CHECK-NEXT: [[AND:%.*]] = lshr i8 [[Y:%.*]], [[X:%.*]]
-; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[AND]], 0
+; CHECK-NEXT: [[TMP1:%.*]] = lshr i8 [[Y:%.*]], [[X:%.*]]
+; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[TMP1]], 0
; CHECK-NEXT: ret i1 [[R]]
;
%shl = shl i8 -1, %x
@@ -564,8 +564,8 @@ define i1 @fold_eq_lhs_fail_multiuse_shl(i8 %x, i8 %y) {
define i1 @fold_ne_rhs(i8 %x, i8 %yy) {
; CHECK-LABEL: @fold_ne_rhs(
; CHECK-NEXT: [[Y:%.*]] = xor i8 [[YY:%.*]], 123
-; CHECK-NEXT: [[AND:%.*]] = lshr i8 [[Y]], [[X:%.*]]
-; CHECK-NEXT: [[R:%.*]] = icmp ne i8 [[AND]], 0
+; CHECK-NEXT: [[TMP1:%.*]] = lshr i8 [[Y]], [[X:%.*]]
+; CHECK-NEXT: [[R:%.*]] = icmp ne i8 [[TMP1]], 0
; CHECK-NEXT: ret i1 [[R]]
;
%y = xor i8 %yy, 123
diff --git a/llvm/test/Transforms/InstCombine/icmp-bitcast-glob.ll b/llvm/test/Transforms/InstCombine/icmp-bitcast-glob.ll
index 62c7b8e71fb6a..c127a42f6bcbf 100644
--- a/llvm/test/Transforms/InstCombine/icmp-bitcast-glob.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-bitcast-glob.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
declare i32 @f32(ptr, ptr)
@@ -5,16 +6,19 @@ declare i32 @f32(ptr, ptr)
declare i32 @f64(ptr, ptr)
define i1 @icmp_func() {
-; CHECK-LABEL: @icmp_func(
-; CHECK: ret i1 false
+; CHECK-LABEL: define i1 @icmp_func() {
+; CHECK-NEXT: ret i1 false
+;
%cmp = icmp eq ptr @f32, @f64
ret i1 %cmp
}
define i1 @icmp_fptr(ptr) {
-; CHECK-LABEL: @icmp_fptr(
-; CHECK: %cmp = icmp ne ptr %0, @f32
-; CHECK: ret i1 %cmp
+; CHECK-LABEL: define i1 @icmp_fptr(
+; CHECK-SAME: ptr [[TMP0:%.*]]) {
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne ptr [[TMP0]], @f32
+; CHECK-NEXT: ret i1 [[CMP]]
+;
%cmp = icmp ne ptr @f32, %0
ret i1 %cmp
}
@@ -22,8 +26,9 @@ define i1 @icmp_fptr(ptr) {
@b = external global i32
define i32 @icmp_glob(i32 %x, i32 %y) {
-; CHECK-LABEL: define i32 @icmp_glob(i32 %x, i32 %y)
-; CHECK-NEXT: ret i32 %y
+; CHECK-LABEL: define i32 @icmp_glob(
+; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
+; CHECK-NEXT: ret i32 [[Y]]
;
%cmp = icmp eq ptr @icmp_glob, @b
%sel = select i1 %cmp, i32 %x, i32 %y
diff --git a/llvm/test/Transforms/InstCombine/icmp-fold-into-phi.ll b/llvm/test/Transforms/InstCombine/icmp-fold-into-phi.ll
index 3d7177859e3f5..c4823a7688a4c 100644
--- a/llvm/test/Transforms/InstCombine/icmp-fold-into-phi.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-fold-into-phi.ll
@@ -6,8 +6,8 @@ define i1 @SwitchTest(i32 %x, i32 %y) {
; CHECK-SAME: (i32 [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i32 [[X]], label [[BB1:%.*]] [
-; CHECK-NEXT: i32 0, label [[BB2:%.*]]
-; CHECK-NEXT: i32 1, label [[BB3:%.*]]
+; CHECK-NEXT: i32 0, label [[BB2:%.*]]
+; CHECK-NEXT: i32 1, label [[BB3:%.*]]
; CHECK-NEXT: ]
; CHECK: bb1:
; CHECK-NEXT: [[TMP0:%.*]] = icmp ugt i32 [[Y]], 1
diff --git a/llvm/test/Transforms/InstCombine/icmp-gep.ll b/llvm/test/Transforms/InstCombine/icmp-gep.ll
index ce64ab1c6305a..d179a228d3932 100644
--- a/llvm/test/Transforms/InstCombine/icmp-gep.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-gep.ll
@@ -514,11 +514,11 @@ define i1 @test_scalable_xc(ptr %x) {
define i1 @test_scalable_xy(ptr %foo, i64 %i, i64 %j) {
; CHECK-LABEL: @test_scalable_xy(
; CHECK-NEXT: [[TMP1:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP2:%.*]] = shl i64 [[TMP1]], 4
-; CHECK-NEXT: [[GEP1_IDX:%.*]] = mul nsw i64 [[TMP2]], [[I:%.*]]
+; CHECK-NEXT: [[TMP2:%.*]] = mul i64 [[TMP1]], [[I:%.*]]
+; CHECK-NEXT: [[GEP1_IDX:%.*]] = shl i64 [[TMP2]], 4
; CHECK-NEXT: [[TMP3:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP4:%.*]] = shl i64 [[TMP3]], 2
-; CHECK-NEXT: [[GEP2_IDX:%.*]] = mul nsw i64 [[TMP4]], [[J:%.*]]
+; CHECK-NEXT: [[TMP4:%.*]] = mul i64 [[TMP3]], [[J:%.*]]
+; CHECK-NEXT: [[GEP2_IDX:%.*]] = shl i64 [[TMP4]], 2
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i64 [[GEP2_IDX]], [[GEP1_IDX]]
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -533,11 +533,11 @@ define i1 @test_scalable_xy(ptr %foo, i64 %i, i64 %j) {
define i1 @test_scalable_ij(ptr %foo, i64 %i, i64 %j) {
; CHECK-LABEL: @test_scalable_ij(
; CHECK-NEXT: [[TMP1:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP2:%.*]] = shl i64 [[TMP1]], 4
-; CHECK-NEXT: [[GEP1_IDX:%.*]] = mul nsw i64 [[TMP2]], [[I:%.*]]
+; CHECK-NEXT: [[TMP2:%.*]] = mul i64 [[TMP1]], [[I:%.*]]
+; CHECK-NEXT: [[GEP1_IDX:%.*]] = shl i64 [[TMP2]], 4
; CHECK-NEXT: [[TMP3:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP4:%.*]] = shl i64 [[TMP3]], 2
-; CHECK-NEXT: [[GEP2_IDX:%.*]] = mul nsw i64 [[TMP4]], [[J:%.*]]
+; CHECK-NEXT: [[TMP4:%.*]] = mul i64 [[TMP3]], [[J:%.*]]
+; CHECK-NEXT: [[GEP2_IDX:%.*]] = shl i64 [[TMP4]], 2
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i64 [[GEP1_IDX]], [[GEP2_IDX]]
; CHECK-NEXT: ret i1 [[CMP]]
;
diff --git a/llvm/test/Transforms/InstCombine/icmp-logical.ll b/llvm/test/Transforms/InstCombine/icmp-logical.ll
index 4690ead483a5b..fa7016539fcbd 100644
--- a/llvm/test/Transforms/InstCombine/icmp-logical.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-logical.ll
@@ -1778,9 +1778,9 @@ define i1 @masked_icmps_bmask_notmixed_or(i32 %A) {
define <2 x i1> @masked_icmps_bmask_notmixed_or_vec(<2 x i8> %A) {
; CHECK-LABEL: @masked_icmps_bmask_notmixed_or_vec(
-; CHECK-NEXT: [[TMP1:%.*]] = and <2 x i8> [[A:%.*]], <i8 15, i8 15>
-; CHECK-NEXT: [[RES:%.*]] = icmp eq <2 x i8> [[TMP1]], <i8 3, i8 3>
-; CHECK-NEXT: ret <2 x i1> [[RES]]
+; CHECK-NEXT: [[MASK1:%.*]] = and <2 x i8> [[A:%.*]], <i8 15, i8 15>
+; CHECK-NEXT: [[TST1:%.*]] = icmp eq <2 x i8> [[MASK1]], <i8 3, i8 3>
+; CHECK-NEXT: ret <2 x i1> [[TST1]]
;
%mask1 = and <2 x i8> %A, <i8 15, i8 15> ; 0x0f
%tst1 = icmp eq <2 x i8> %mask1, <i8 3, i8 3> ; 0x03
diff --git a/llvm/test/Transforms/InstCombine/icmp-mul-and.ll b/llvm/test/Transforms/InstCombine/icmp-mul-and.ll
index 7e7f087ca7112..b347ee9be60e7 100644
--- a/llvm/test/Transforms/InstCombine/icmp-mul-and.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-mul-and.ll
@@ -270,8 +270,8 @@ define i1 @pr51551_neg2(i32 %x, i32 %y) {
; CHECK-NEXT: [[TMP1:%.*]] = trunc i32 [[Y:%.*]] to i1
; CHECK-NEXT: [[TMP2:%.*]] = and i32 [[X:%.*]], 7
; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[TMP2]], 0
-; CHECK-NEXT: [[DOTNOT:%.*]] = xor i1 [[TMP1]], true
-; CHECK-NEXT: [[CMP:%.*]] = select i1 [[DOTNOT]], i1 true, i1 [[CMP1]]
+; CHECK-NEXT: [[NOT_:%.*]] = xor i1 [[TMP1]], true
+; CHECK-NEXT: [[CMP:%.*]] = select i1 [[NOT_]], i1 true, i1 [[CMP1]]
; CHECK-NEXT: ret i1 [[CMP]]
;
%t0 = and i32 %y, -7
diff --git a/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll b/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
index aa23a6d27f69b..a69d050e4a64d 100644
--- a/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
@@ -128,12 +128,12 @@ define i1 @PR46561(i1 %a, i1 %x, i1 %y, i8 %z) {
; CHECK-NEXT: br i1 [[A:%.*]], label [[COND_TRUE:%.*]], label [[END:%.*]]
; CHECK: cond.true:
; CHECK-NEXT: [[MULBOOL:%.*]] = and i1 [[X:%.*]], [[Y:%.*]]
-; CHECK-NEXT: [[TMP1:%.*]] = trunc i8 [[Z:%.*]] to i1
-; CHECK-NEXT: [[TMP2:%.*]] = xor i1 [[MULBOOL]], [[TMP1]]
-; CHECK-NEXT: [[TMP3:%.*]] = xor i1 [[TMP2]], true
+; CHECK-NEXT: [[TMP0:%.*]] = trunc i8 [[Z:%.*]] to i1
+; CHECK-NEXT: [[TMP1:%.*]] = xor i1 [[MULBOOL]], [[TMP0]]
+; CHECK-NEXT: [[TMP2:%.*]] = xor i1 [[TMP1]], true
; CHECK-NEXT: br label [[END]]
; CHECK: end:
-; CHECK-NEXT: [[P:%.*]] = phi i1 [ [[TMP3]], [[COND_TRUE]] ], [ false, [[ENTRY:%.*]] ]
+; CHECK-NEXT: [[P:%.*]] = phi i1 [ [[TMP2]], [[COND_TRUE]] ], [ false, [[ENTRY:%.*]] ]
; CHECK-NEXT: ret i1 [[P]]
;
entry:
diff --git a/llvm/test/Transforms/InstCombine/icmp-range.ll b/llvm/test/Transforms/InstCombine/icmp-range.ll
index 9ed2f2a4860c6..7ca06c9fd7d41 100644
--- a/llvm/test/Transforms/InstCombine/icmp-range.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-range.ll
@@ -152,7 +152,7 @@ define i1 @test_two_ranges(ptr nocapture readonly %arg1, ptr nocapture readonly
; Values' ranges overlap each other, so it can not be simplified.
define i1 @test_two_attribute_ranges(i32 range(i32 5, 10) %arg1, i32 range(i32 8, 16) %arg2) {
; CHECK-LABEL: @test_two_attribute_ranges(
-; CHECK-NEXT: [[RVAL:%.*]] = icmp ult i32 [[ARG1:%.*]], [[ARG2:%.*]]
+; CHECK-NEXT: [[RVAL:%.*]] = icmp ult i32 [[ARG2:%.*]], [[ARG1:%.*]]
; CHECK-NEXT: ret i1 [[RVAL]]
;
%rval = icmp ult i32 %arg2, %arg1
@@ -249,7 +249,7 @@ define <2 x i1> @test_two_ranges_vec_true(ptr nocapture readonly %arg1, ptr noca
; Values' ranges overlap each other, so it can not be simplified.
define <2 x i1> @test_two_argument_ranges_vec(<2 x i32> range(i32 5, 10) %arg1, <2 x i32> range(i32 8, 16) %arg2) {
; CHECK-LABEL: @test_two_argument_ranges_vec(
-; CHECK-NEXT: [[RVAL:%.*]] = icmp ult <2 x i32> [[VAL2:%.*]], [[VAL1:%.*]]
+; CHECK-NEXT: [[RVAL:%.*]] = icmp ult <2 x i32> [[ARG2:%.*]], [[ARG1:%.*]]
; CHECK-NEXT: ret <2 x i1> [[RVAL]]
;
%rval = icmp ult <2 x i32> %arg2, %arg1
@@ -281,9 +281,9 @@ declare range(i32 1, 6) i32 @create_range3()
; Values' ranges overlap each other, so it can not be simplified.
define i1 @test_two_return_attribute_ranges_not_simplified() {
; CHECK-LABEL: @test_two_return_attribute_ranges_not_simplified(
-; CHECK-NEXT: [[ARG2:%.*]] = call range(i32 5, 10) i32 @create_range1()
-; CHECK-NEXT: [[ARG1:%.*]] = call i32 @create_range2()
-; CHECK-NEXT: [[RVAL:%.*]] = icmp ult i32 [[ARG1]], [[ARG2]]
+; CHECK-NEXT: [[VAL1:%.*]] = call range(i32 5, 10) i32 @create_range1()
+; CHECK-NEXT: [[VAL2:%.*]] = call i32 @create_range2()
+; CHECK-NEXT: [[RVAL:%.*]] = icmp ult i32 [[VAL2]], [[VAL1]]
; CHECK-NEXT: ret i1 [[RVAL]]
;
%val1 = call range(i32 5, 10) i32 @create_range1()
@@ -296,7 +296,7 @@ define i1 @test_two_return_attribute_ranges_not_simplified() {
define i1 @test_two_return_attribute_ranges_one_in_call() {
; CHECK-LABEL: @test_two_return_attribute_ranges_one_in_call(
; CHECK-NEXT: [[VAL1:%.*]] = call range(i32 1, 6) i32 @create_range1()
-; CHECK-NEXT: [[ARG1:%.*]] = call i32 @create_range2()
+; CHECK-NEXT: [[VAL2:%.*]] = call i32 @create_range2()
; CHECK-NEXT: ret i1 false
;
%val1 = call range(i32 1, 6) i32 @create_range1()
@@ -309,7 +309,7 @@ define i1 @test_two_return_attribute_ranges_one_in_call() {
define i1 @test_two_return_attribute_ranges() {
; CHECK-LABEL: @test_two_return_attribute_ranges(
; CHECK-NEXT: [[VAL1:%.*]] = call i32 @create_range3()
-; CHECK-NEXT: [[ARG1:%.*]] = call i32 @create_range2()
+; CHECK-NEXT: [[VAL2:%.*]] = call i32 @create_range2()
; CHECK-NEXT: ret i1 false
;
%val1 = call i32 @create_range3()
@@ -899,8 +899,8 @@ define i1 @zext_sext_add_icmp_ne_minus1(i1 %a, i1 %b) {
define i1 @zext_sext_add_icmp_sgt_minus1(i1 %a, i1 %b) {
; CHECK-LABEL: @zext_sext_add_icmp_sgt_minus1(
-; CHECK-NEXT: [[TMP1:%.*]] = xor i1 [[B:%.*]], true
-; CHECK-NEXT: [[R:%.*]] = or i1 [[TMP1]], [[A:%.*]]
+; CHECK-NEXT: [[B_NOT:%.*]] = xor i1 [[B:%.*]], true
+; CHECK-NEXT: [[R:%.*]] = or i1 [[B_NOT]], [[A:%.*]]
; CHECK-NEXT: ret i1 [[R]]
;
%zext.a = zext i1 %a to i8
@@ -945,8 +945,8 @@ define i1 @zext_sext_add_icmp_sgt_0(i1 %a, i1 %b) {
define i1 @zext_sext_add_icmp_slt_0(i1 %a, i1 %b) {
; CHECK-LABEL: @zext_sext_add_icmp_slt_0(
; CHECK-NEXT: [[TMP1:%.*]] = xor i1 [[A:%.*]], true
-; CHECK-NEXT: [[R:%.*]] = and i1 [[TMP1]], [[B:%.*]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: [[TMP2:%.*]] = and i1 [[TMP1]], [[B:%.*]]
+; CHECK-NEXT: ret i1 [[TMP2]]
;
%zext.a = zext i1 %a to i8
%sext.b = sext i1 %b to i8
@@ -1005,8 +1005,8 @@ define i1 @zext_sext_add_icmp_slt_1(i1 %a, i1 %b) {
define i1 @zext_sext_add_icmp_ugt_1(i1 %a, i1 %b) {
; CHECK-LABEL: @zext_sext_add_icmp_ugt_1(
; CHECK-NEXT: [[TMP1:%.*]] = xor i1 [[A:%.*]], true
-; CHECK-NEXT: [[R:%.*]] = and i1 [[TMP1]], [[B:%.*]]
-; CHECK-NEXT: ret i1 [[R]]
+; CHECK-NEXT: [[TMP2:%.*]] = and i1 [[TMP1]], [[B:%.*]]
+; CHECK-NEXT: ret i1 [[TMP2]]
;
%zext.a = zext i1 %a to i8
%sext.b = sext i1 %b to i8
diff --git a/llvm/test/Transforms/InstCombine/icmp-select-implies-common-op.ll b/llvm/test/Transforms/InstCombine/icmp-select-implies-common-op.ll
index bacdb54f787d6..778002dee0dae 100644
--- a/llvm/test/Transforms/InstCombine/icmp-select-implies-common-op.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-select-implies-common-op.ll
@@ -4,9 +4,9 @@
define i1 @sgt_3_impliesF_eq_2(i8 %x, i8 %y) {
; CHECK-LABEL: @sgt_3_impliesF_eq_2(
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[X:%.*]], 4
-; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[SEL:%.*]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = select i1 [[CMP]], i1 [[CMP2]], i1 false
-; CHECK-NEXT: ret i1 [[CMP3]]
+; CHECK-NEXT: [[CMP21:%.*]] = icmp eq i8 [[Y:%.*]], [[X]]
+; CHECK-NEXT: [[CMP2:%.*]] = select i1 [[CMP]], i1 [[CMP21]], i1 false
+; CHECK-NEXT: ret i1 [[CMP2]]
;
%cmp = icmp sgt i8 %x, 3
%sel = select i1 %cmp, i8 2, i8 %y
@@ -17,9 +17,9 @@ define i1 @sgt_3_impliesF_eq_2(i8 %x, i8 %y) {
define i1 @sgt_3_impliesT_sgt_2(i8 %x, i8 %y) {
; CHECK-LABEL: @sgt_3_impliesT_sgt_2(
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 [[X:%.*]], 4
-; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[SEL:%.*]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = select i1 [[CMP]], i1 [[CMP2]], i1 false
-; CHECK-NEXT: ret i1 [[CMP3]]
+; CHECK-NEXT: [[CMP21:%.*]] = icmp sgt i8 [[Y:%.*]], [[X]]
+; CHECK-NEXT: [[CMP2:%.*]] = select i1 [[CMP]], i1 [[CMP21]], i1 false
+; CHECK-NEXT: ret i1 [[CMP2]]
;
%cmp = icmp sgt i8 %x, 3
%sel = select i1 %cmp, i8 2, i8 %y
@@ -68,10 +68,10 @@ define i1 @ult_x_impliesT_eq_umax_todo(i8 %x, i8 %y, i8 %z) {
define i1 @ult_1_impliesF_eq_1(i8 %x, i8 %y) {
; CHECK-LABEL: @ult_1_impliesF_eq_1(
-; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8 [[SEL:%.*]], 0
-; CHECK-NEXT: [[CMP2:%.*]] = icmp eq i8 [[X:%.*]], [[SEL]]
-; CHECK-NEXT: [[CMP3:%.*]] = select i1 [[CMP]], i1 [[CMP2]], i1 false
-; CHECK-NEXT: ret i1 [[CMP3]]
+; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8 [[X:%.*]], 0
+; CHECK-NEXT: [[CMP21:%.*]] = icmp eq i8 [[Y:%.*]], [[X]]
+; CHECK-NEXT: [[CMP2:%.*]] = select i1 [[CMP]], i1 [[CMP21]], i1 false
+; CHECK-NEXT: ret i1 [[CMP2]]
;
%cmp = icmp ult i8 %x, 1
%sel = select i1 %cmp, i8 1, i8 %y
diff --git a/llvm/test/Transforms/InstCombine/icmp-uadd-sat.ll b/llvm/test/Transforms/InstCombine/icmp-uadd-sat.ll
index a61feac024a9c..0ef14db7a68c2 100644
--- a/llvm/test/Transforms/InstCombine/icmp-uadd-sat.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-uadd-sat.ll
@@ -8,8 +8,8 @@
; Basic tests with one user
; ==============================================================================
define i1 @icmp_eq_basic(i8 %arg) {
-; CHECK-LABEL: define i1 @icmp_eq_basic
-; CHECK-SAME: (i8 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_eq_basic(
+; CHECK-SAME: i8 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[ARG]], 3
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -19,8 +19,8 @@ define i1 @icmp_eq_basic(i8 %arg) {
}
define i1 @icmp_ne_basic(i16 %arg) {
-; CHECK-LABEL: define i1 @icmp_ne_basic
-; CHECK-SAME: (i16 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_ne_basic(
+; CHECK-SAME: i16 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i16 [[ARG]], 1
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -30,8 +30,8 @@ define i1 @icmp_ne_basic(i16 %arg) {
}
define i1 @icmp_ule_basic(i32 %arg) {
-; CHECK-LABEL: define i1 @icmp_ule_basic
-; CHECK-SAME: (i32 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_ule_basic(
+; CHECK-SAME: i32 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[ARG]], 2
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -41,8 +41,8 @@ define i1 @icmp_ule_basic(i32 %arg) {
}
define i1 @icmp_ult_basic(i64 %arg) {
-; CHECK-LABEL: define i1 @icmp_ult_basic
-; CHECK-SAME: (i64 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_ult_basic(
+; CHECK-SAME: i64 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i64 [[ARG]], 15
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -52,8 +52,8 @@ define i1 @icmp_ult_basic(i64 %arg) {
}
define i1 @icmp_uge_basic(i8 %arg) {
-; CHECK-LABEL: define i1 @icmp_uge_basic
-; CHECK-SAME: (i8 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_uge_basic(
+; CHECK-SAME: i8 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i8 [[ARG]], 3
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -63,8 +63,8 @@ define i1 @icmp_uge_basic(i8 %arg) {
}
define i1 @icmp_ugt_basic(i16 %arg) {
-; CHECK-LABEL: define i1 @icmp_ugt_basic
-; CHECK-SAME: (i16 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_ugt_basic(
+; CHECK-SAME: i16 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i16 [[ARG]], 2
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -74,8 +74,8 @@ define i1 @icmp_ugt_basic(i16 %arg) {
}
define i1 @icmp_sle_basic(i32 %arg) {
-; CHECK-LABEL: define i1 @icmp_sle_basic
-; CHECK-SAME: (i32 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_sle_basic(
+; CHECK-SAME: i32 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 [[ARG]], 2147483637
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -85,8 +85,8 @@ define i1 @icmp_sle_basic(i32 %arg) {
}
define i1 @icmp_slt_basic(i64 %arg) {
-; CHECK-LABEL: define i1 @icmp_slt_basic
-; CHECK-SAME: (i64 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_slt_basic(
+; CHECK-SAME: i64 [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i64 [[ARG]], 9223372036854775783
; CHECK-NEXT: ret i1 [[CMP]]
;
@@ -96,8 +96,8 @@ define i1 @icmp_slt_basic(i64 %arg) {
}
define i1 @icmp_sge_basic(i8 %arg) {
-; CHECK-LABEL: define i1 @icmp_sge_basic
-; CHECK-SAME: (i8 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_sge_basic(
+; CHECK-SAME: i8 [[ARG:%.*]]) {
; CHECK-NEXT: [[TMP1:%.*]] = add i8 [[ARG]], -3
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i8 [[TMP1]], 124
; CHECK-NEXT: ret i1 [[CMP]]
@@ -108,8 +108,8 @@ define i1 @icmp_sge_basic(i8 %arg) {
}
define i1 @icmp_sgt_basic(i16 %arg) {
-; CHECK-LABEL: define i1 @icmp_sgt_basic
-; CHECK-SAME: (i16 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_sgt_basic(
+; CHECK-SAME: i16 [[ARG:%.*]]) {
; CHECK-NEXT: [[TMP1:%.*]] = add i16 [[ARG]], -4
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i16 [[TMP1]], 32762
; CHECK-NEXT: ret i1 [[CMP]]
@@ -123,8 +123,8 @@ define i1 @icmp_sgt_basic(i16 %arg) {
; Tests with more than user
; ==============================================================================
define i1 @icmp_eq_multiuse(i8 %arg) {
-; CHECK-LABEL: define i1 @icmp_eq_multiuse
-; CHECK-SAME: (i8 [[ARG:%.*]]) {
+; CHECK-LABEL: define i1 @icmp_eq_multiuse(
+; CHECK-SAME: i8 [[ARG:%.*]]) {
; CHECK-NEXT: [[ADD:%.*]] = call i8 @llvm.uadd.sat.i8(i8 [[ARG]], i8 2)
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[ADD]], 5
; CHECK-NEXT: call void @use.i8(i8 [[ADD]])
@@ -140,8 +140,8 @@ define i1 @icmp_eq_multiuse(i8 %arg) {
; Tests with vector types
; ==============================================================================
define <2 x i1> @icmp_eq_vector_equal(<2 x i8> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_eq_vector_equal
-; CHECK-SAME: (<2 x i8> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_eq_vector_equal(
+; CHECK-SAME: <2 x i8> [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[ARG]], <i8 3, i8 3>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
@@ -151,8 +151,8 @@ define <2 x i1> @icmp_eq_vector_equal(<2 x i8> %arg) {
}
define <2 x i1> @icmp_eq_vector_unequal(<2 x i8> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_eq_vector_unequal
-; CHECK-SAME: (<2 x i8> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_eq_vector_unequal(
+; CHECK-SAME: <2 x i8> [[ARG:%.*]]) {
; CHECK-NEXT: [[ADD:%.*]] = call <2 x i8> @llvm.uadd.sat.v2i8(<2 x i8> [[ARG]], <2 x i8> <i8 1, i8 2>)
; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[ADD]], <i8 5, i8 6>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
@@ -163,8 +163,8 @@ define <2 x i1> @icmp_eq_vector_unequal(<2 x i8> %arg) {
}
define <2 x i1> @icmp_ne_vector_equal(<2 x i16> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_ne_vector_equal
-; CHECK-SAME: (<2 x i16> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_ne_vector_equal(
+; CHECK-SAME: <2 x i16> [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i16> [[ARG]], <i16 2, i16 2>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
@@ -174,8 +174,8 @@ define <2 x i1> @icmp_ne_vector_equal(<2 x i16> %arg) {
}
define <2 x i1> @icmp_ne_vector_unequal(<2 x i16> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_ne_vector_unequal
-; CHECK-SAME: (<2 x i16> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_ne_vector_unequal(
+; CHECK-SAME: <2 x i16> [[ARG:%.*]]) {
; CHECK-NEXT: [[ADD:%.*]] = call <2 x i16> @llvm.uadd.sat.v2i16(<2 x i16> [[ARG]], <2 x i16> <i16 3, i16 33>)
; CHECK-NEXT: [[CMP:%.*]] = icmp ne <2 x i16> [[ADD]], <i16 7, i16 6>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
@@ -186,8 +186,8 @@ define <2 x i1> @icmp_ne_vector_unequal(<2 x i16> %arg) {
}
define <2 x i1> @icmp_ule_vector_equal(<2 x i32> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_ule_vector_equal
-; CHECK-SAME: (<2 x i32> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_ule_vector_equal(
+; CHECK-SAME: <2 x i32> [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[ARG]], <i32 2, i32 2>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
@@ -197,8 +197,8 @@ define <2 x i1> @icmp_ule_vector_equal(<2 x i32> %arg) {
}
define <2 x i1> @icmp_ule_vector_unequal(<2 x i32> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_ule_vector_unequal
-; CHECK-SAME: (<2 x i32> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_ule_vector_unequal(
+; CHECK-SAME: <2 x i32> [[ARG:%.*]]) {
; CHECK-NEXT: [[ADD:%.*]] = call <2 x i32> @llvm.uadd.sat.v2i32(<2 x i32> [[ARG]], <2 x i32> <i32 3, i32 35>)
; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i32> [[ADD]], <i32 5, i32 7>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
@@ -209,8 +209,8 @@ define <2 x i1> @icmp_ule_vector_unequal(<2 x i32> %arg) {
}
define <2 x i1> @icmp_sgt_vector_equal(<2 x i64> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_sgt_vector_equal
-; CHECK-SAME: (<2 x i64> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_sgt_vector_equal(
+; CHECK-SAME: <2 x i64> [[ARG:%.*]]) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ult <2 x i64> [[ARG]], <i64 9223372036854366185, i64 9223372036854366185>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
;
@@ -220,8 +220,8 @@ define <2 x i1> @icmp_sgt_vector_equal(<2 x i64> %arg) {
}
define <2 x i1> @icmp_sgt_vector_unequal(<2 x i64> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_sgt_vector_unequal
-; CHECK-SAME: (<2 x i64> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_sgt_vector_unequal(
+; CHECK-SAME: <2 x i64> [[ARG:%.*]]) {
; CHECK-NEXT: [[ADD:%.*]] = call <2 x i64> @llvm.uadd.sat.v2i64(<2 x i64> [[ARG]], <2 x i64> <i64 320498, i64 409623>)
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt <2 x i64> [[ADD]], <i64 1234, i64 3456>
; CHECK-NEXT: ret <2 x i1> [[CMP]]
@@ -235,8 +235,8 @@ define <2 x i1> @icmp_sgt_vector_unequal(<2 x i64> %arg) {
; Tests with vector types and multiple uses
; ==============================================================================
define <2 x i1> @icmp_eq_vector_multiuse_equal(<2 x i8> %arg) {
-; CHECK-LABEL: define <2 x i1> @icmp_eq_vector_multiuse_equal
-; CHECK-SAME: (<2 x i8> [[ARG:%.*]]) {
+; CHECK-LABEL: define <2 x i1> @icmp_eq_vector_multiuse_equal(
+; CHECK-SAME: <2 x i8> [[ARG:%.*]]) {
; CHECK-NEXT: [[ADD:%.*]] = call <2 x i8> @llvm.uadd.sat.v2i8(<2 x i8> [[ARG]], <2 x i8> <i8 2, i8 2>)
; CHECK-NEXT: [[CMP:%.*]] = icmp eq <2 x i8> [[ADD]], <i8 5, i8 5>
; CHECK-NEXT: call void @use.v2i8(<2 x i8> [[ADD]])
diff --git a/llvm/test/Transforms/InstCombine/malloc-free-delete-dbginvar.ll b/llvm/test/Transforms/InstCombine/malloc-free-delete-dbginvar.ll
index c85fcbf5b6fda..17ae76ec25a8e 100644
--- a/llvm/test/Transforms/InstCombine/malloc-free-delete-dbginvar.ll
+++ b/llvm/test/Transforms/InstCombine/malloc-free-delete-dbginvar.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Check that the instcombine result is the same with/without debug info.
; This is a regression test for a function taken from malloc-free-delete.ll.
diff --git a/llvm/test/Transforms/InstCombine/masked-merge-xor.ll b/llvm/test/Transforms/InstCombine/masked-merge-xor.ll
index 74cc7625aebff..bb5818342a652 100644
--- a/llvm/test/Transforms/InstCombine/masked-merge-xor.ll
+++ b/llvm/test/Transforms/InstCombine/masked-merge-xor.ll
@@ -84,8 +84,8 @@ define i32 @p_constmask(i32 %x, i32 %y) {
; CHECK-LABEL: @p_constmask(
; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 65280
; CHECK-NEXT: [[AND1:%.*]] = and i32 [[Y:%.*]], -65281
-; CHECK-NEXT: [[RET1:%.*]] = or disjoint i32 [[AND]], [[AND1]]
-; CHECK-NEXT: ret i32 [[RET1]]
+; CHECK-NEXT: [[RET:%.*]] = or disjoint i32 [[AND]], [[AND1]]
+; CHECK-NEXT: ret i32 [[RET]]
;
%and = and i32 %x, 65280
%and1 = and i32 %y, -65281
@@ -97,8 +97,8 @@ define <2 x i32> @p_constmask_splatvec(<2 x i32> %x, <2 x i32> %y) {
; CHECK-LABEL: @p_constmask_splatvec(
; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> [[X:%.*]], <i32 65280, i32 65280>
; CHECK-NEXT: [[AND1:%.*]] = and <2 x i32> [[Y:%.*]], <i32 -65281, i32 -65281>
-; CHECK-NEXT: [[RET1:%.*]] = or disjoint <2 x i32> [[AND]], [[AND1]]
-; CHECK-NEXT: ret <2 x i32> [[RET1]]
+; CHECK-NEXT: [[RET:%.*]] = or disjoint <2 x i32> [[AND]], [[AND1]]
+; CHECK-NEXT: ret <2 x i32> [[RET]]
;
%and = and <2 x i32> %x, <i32 65280, i32 65280>
%and1 = and <2 x i32> %y, <i32 -65281, i32 -65281>
@@ -140,8 +140,8 @@ define i32 @p_constmask2(i32 %x, i32 %y) {
; CHECK-LABEL: @p_constmask2(
; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 61440
; CHECK-NEXT: [[AND1:%.*]] = and i32 [[Y:%.*]], -65281
-; CHECK-NEXT: [[RET1:%.*]] = or disjoint i32 [[AND]], [[AND1]]
-; CHECK-NEXT: ret i32 [[RET1]]
+; CHECK-NEXT: [[RET:%.*]] = or disjoint i32 [[AND]], [[AND1]]
+; CHECK-NEXT: ret i32 [[RET]]
;
%and = and i32 %x, 61440
%and1 = and i32 %y, -65281
@@ -153,8 +153,8 @@ define <2 x i32> @p_constmask2_splatvec(<2 x i32> %x, <2 x i32> %y) {
; CHECK-LABEL: @p_constmask2_splatvec(
; CHECK-NEXT: [[AND:%.*]] = and <2 x i32> [[X:%.*]], <i32 61440, i32 61440>
; CHECK-NEXT: [[AND1:%.*]] = and <2 x i32> [[Y:%.*]], <i32 -65281, i32 -65281>
-; CHECK-NEXT: [[RET1:%.*]] = or disjoint <2 x i32> [[AND]], [[AND1]]
-; CHECK-NEXT: ret <2 x i32> [[RET1]]
+; CHECK-NEXT: [[RET:%.*]] = or disjoint <2 x i32> [[AND]], [[AND1]]
+; CHECK-NEXT: ret <2 x i32> [[RET]]
;
%and = and <2 x i32> %x, <i32 61440, i32 61440>
%and1 = and <2 x i32> %y, <i32 -65281, i32 -65281>
@@ -312,8 +312,8 @@ define i32 @p_constmask_commutative(i32 %x, i32 %y) {
; CHECK-LABEL: @p_constmask_commutative(
; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 65280
; CHECK-NEXT: [[AND1:%.*]] = and i32 [[Y:%.*]], -65281
-; CHECK-NEXT: [[RET1:%.*]] = or disjoint i32 [[AND1]], [[AND]]
-; CHECK-NEXT: ret i32 [[RET1]]
+; CHECK-NEXT: [[RET:%.*]] = or disjoint i32 [[AND1]], [[AND]]
+; CHECK-NEXT: ret i32 [[RET]]
;
%and = and i32 %x, 65280
%and1 = and i32 %y, -65281
@@ -354,10 +354,10 @@ define i32 @n0_constmask_oneuse(i32 %x, i32 %y) {
; CHECK-LABEL: @n0_constmask_oneuse(
; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 65280
; CHECK-NEXT: [[AND1:%.*]] = and i32 [[Y:%.*]], -65281
-; CHECK-NEXT: [[RET1:%.*]] = or disjoint i32 [[AND]], [[AND1]]
+; CHECK-NEXT: [[RET:%.*]] = or disjoint i32 [[AND]], [[AND1]]
; CHECK-NEXT: call void @use32(i32 [[AND]])
; CHECK-NEXT: call void @use32(i32 [[AND1]])
-; CHECK-NEXT: ret i32 [[RET1]]
+; CHECK-NEXT: ret i32 [[RET]]
;
%and = and i32 %x, 65280
%and1 = and i32 %y, -65281
diff --git a/llvm/test/Transforms/InstCombine/memcmp-1.ll b/llvm/test/Transforms/InstCombine/memcmp-1.ll
index 054896647b518..ff0ef9ee0bc84 100644
--- a/llvm/test/Transforms/InstCombine/memcmp-1.ll
+++ b/llvm/test/Transforms/InstCombine/memcmp-1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the memcmp library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck --check-prefix=CHECK --check-prefix=NOBCMP %s
@@ -14,7 +15,8 @@ declare i32 @memcmp(ptr, ptr, i32)
; Check memcmp(mem, mem, size) -> 0.
define i32 @test_simplify1(ptr %mem, i32 %size) {
-; CHECK-LABEL: @test_simplify1(
+; CHECK-LABEL: define i32 @test_simplify1(
+; CHECK-SAME: ptr [[MEM:%.*]], i32 [[SIZE:%.*]]) {
; CHECK-NEXT: ret i32 0
;
%ret = call i32 @memcmp(ptr %mem, ptr %mem, i32 %size)
@@ -24,7 +26,8 @@ define i32 @test_simplify1(ptr %mem, i32 %size) {
; Check memcmp(mem1, mem2, 0) -> 0.
define i32 @test_simplify2(ptr %mem1, ptr %mem2) {
-; CHECK-LABEL: @test_simplify2(
+; CHECK-LABEL: define i32 @test_simplify2(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]]) {
; CHECK-NEXT: ret i32 0
;
%ret = call i32 @memcmp(ptr %mem1, ptr %mem2, i32 0)
@@ -34,10 +37,11 @@ define i32 @test_simplify2(ptr %mem1, ptr %mem2) {
;; Check memcmp(mem1, mem2, 1) -> *(unsigned char*)mem1 - *(unsigned char*)mem2.
define i32 @test_simplify3(ptr %mem1, ptr %mem2) {
-; CHECK-LABEL: @test_simplify3(
-; CHECK-NEXT: [[LHSC:%.*]] = load i8, ptr %mem1, align 1
+; CHECK-LABEL: define i32 @test_simplify3(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]]) {
+; CHECK-NEXT: [[LHSC:%.*]] = load i8, ptr [[MEM1]], align 1
; CHECK-NEXT: [[LHSV:%.*]] = zext i8 [[LHSC]] to i32
-; CHECK-NEXT: [[RHSC:%.*]] = load i8, ptr %mem2, align 1
+; CHECK-NEXT: [[RHSC:%.*]] = load i8, ptr [[MEM2]], align 1
; CHECK-NEXT: [[RHSV:%.*]] = zext i8 [[RHSC]] to i32
; CHECK-NEXT: [[CHARDIFF:%.*]] = sub nsw i32 [[LHSV]], [[RHSV]]
; CHECK-NEXT: ret i32 [[CHARDIFF]]
@@ -49,7 +53,7 @@ define i32 @test_simplify3(ptr %mem1, ptr %mem2) {
; Check memcmp(mem1, mem2, size) -> cnst, where all arguments are constants.
define i32 @test_simplify4() {
-; CHECK-LABEL: @test_simplify4(
+; CHECK-LABEL: define i32 @test_simplify4() {
; CHECK-NEXT: ret i32 0
;
%ret = call i32 @memcmp(ptr @hel, ptr @hello_u, i32 3)
@@ -57,7 +61,7 @@ define i32 @test_simplify4() {
}
define i32 @test_simplify5() {
-; CHECK-LABEL: @test_simplify5(
+; CHECK-LABEL: define i32 @test_simplify5() {
; CHECK-NEXT: ret i32 1
;
%ret = call i32 @memcmp(ptr @hel, ptr @foo, i32 3)
@@ -65,7 +69,7 @@ define i32 @test_simplify5() {
}
define i32 @test_simplify6() {
-; CHECK-LABEL: @test_simplify6(
+; CHECK-LABEL: define i32 @test_simplify6() {
; CHECK-NEXT: ret i32 -1
;
%ret = call i32 @memcmp(ptr @foo, ptr @hel, i32 3)
@@ -75,9 +79,10 @@ define i32 @test_simplify6() {
; Check memcmp(mem1, mem2, 8)==0 -> *(int64_t*)mem1 == *(int64_t*)mem2
define i1 @test_simplify7(i64 %x, i64 %y) {
-; CHECK-LABEL: @test_simplify7(
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 %x, %y
-; CHECK-NEXT: ret i1 [[CMP]]
+; CHECK-LABEL: define i1 @test_simplify7(
+; CHECK-SAME: i64 [[X:%.*]], i64 [[Y:%.*]]) {
+; CHECK-NEXT: [[DOTNOT:%.*]] = icmp eq i64 [[X]], [[Y]]
+; CHECK-NEXT: ret i1 [[DOTNOT]]
;
%x.addr = alloca i64, align 8
%y.addr = alloca i64, align 8
@@ -91,9 +96,10 @@ define i1 @test_simplify7(i64 %x, i64 %y) {
; Check memcmp(mem1, mem2, 4)==0 -> *(int32_t*)mem1 == *(int32_t*)mem2
define i1 @test_simplify8(i32 %x, i32 %y) {
-; CHECK-LABEL: @test_simplify8(
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 %x, %y
-; CHECK-NEXT: ret i1 [[CMP]]
+; CHECK-LABEL: define i1 @test_simplify8(
+; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[DOTNOT:%.*]] = icmp eq i32 [[X]], [[Y]]
+; CHECK-NEXT: ret i1 [[DOTNOT]]
;
%x.addr = alloca i32, align 4
%y.addr = alloca i32, align 4
@@ -107,9 +113,10 @@ define i1 @test_simplify8(i32 %x, i32 %y) {
; Check memcmp(mem1, mem2, 2)==0 -> *(int16_t*)mem1 == *(int16_t*)mem2
define i1 @test_simplify9(i16 %x, i16 %y) {
-; CHECK-LABEL: @test_simplify9(
-; CHECK-NEXT: [[CMP:%.*]] = icmp eq i16 %x, %y
-; CHECK-NEXT: ret i1 [[CMP]]
+; CHECK-LABEL: define i1 @test_simplify9(
+; CHECK-SAME: i16 [[X:%.*]], i16 [[Y:%.*]]) {
+; CHECK-NEXT: [[DOTNOT:%.*]] = icmp eq i16 [[X]], [[Y]]
+; CHECK-NEXT: ret i1 [[DOTNOT]]
;
%x.addr = alloca i16, align 2
%y.addr = alloca i16, align 2
@@ -123,14 +130,16 @@ define i1 @test_simplify9(i16 %x, i16 %y) {
; Check memcmp(mem1, mem2, size)==0 -> bcmp(mem1, mem2, size)==0
define i1 @test_simplify10(ptr %mem1, ptr %mem2, i32 %size) {
-; NOBCMP-LABEL: @test_simplify10(
-; NOBCMP-NEXT: [[CALL:%.*]] = call i32 @memcmp(ptr %mem1, ptr %mem2, i32 %size)
+; NOBCMP-LABEL: define i1 @test_simplify10(
+; NOBCMP-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; NOBCMP-NEXT: [[CALL:%.*]] = call i32 @memcmp(ptr [[MEM1]], ptr [[MEM2]], i32 [[SIZE]])
; NOBCMP-NEXT: [[CMP:%.*]] = icmp eq i32 [[CALL]], 0
; NOBCMP-NEXT: ret i1 [[CMP]]
;
-; BCMP-LABEL: @test_simplify10(
-; BCMP-NEXT: [[CALL:%.*]] = call i32 @bcmp(ptr %mem1, ptr %mem2, i32 %size)
-; BCMP-NEXT: [[CMP:%.*]] = icmp eq i32 [[CALL]], 0
+; BCMP-LABEL: define i1 @test_simplify10(
+; BCMP-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; BCMP-NEXT: [[BCMP:%.*]] = call i32 @bcmp(ptr [[MEM1]], ptr [[MEM2]], i32 [[SIZE]])
+; BCMP-NEXT: [[CMP:%.*]] = icmp eq i32 [[BCMP]], 0
; BCMP-NEXT: ret i1 [[CMP]]
;
%call = call i32 @memcmp(ptr %mem1, ptr %mem2, i32 %size)
diff --git a/llvm/test/Transforms/InstCombine/memcmp-2.ll b/llvm/test/Transforms/InstCombine/memcmp-2.ll
index 0edc815ff30c9..26dfeaa48c1c6 100644
--- a/llvm/test/Transforms/InstCombine/memcmp-2.ll
+++ b/llvm/test/Transforms/InstCombine/memcmp-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the memcmp library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -9,9 +10,11 @@ declare ptr @memcmp(ptr, ptr, i32)
; Check that memcmp functions with the wrong prototype aren't simplified.
define ptr @test_no_simplify1(ptr %mem, i32 %size) {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define ptr @test_no_simplify1(
+; CHECK-SAME: ptr [[MEM:%.*]], i32 [[SIZE:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call ptr @memcmp(ptr [[MEM]], ptr [[MEM]], i32 [[SIZE]])
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = call ptr @memcmp(ptr %mem, ptr %mem, i32 %size)
-; CHECK-NEXT: call ptr @memcmp
ret ptr %ret
-; CHECK-NEXT: ret ptr %ret
}
diff --git a/llvm/test/Transforms/InstCombine/memcpy-2.ll b/llvm/test/Transforms/InstCombine/memcpy-2.ll
index f8e677db087e3..6623535736b6e 100644
--- a/llvm/test/Transforms/InstCombine/memcpy-2.ll
+++ b/llvm/test/Transforms/InstCombine/memcpy-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the memcpy library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -9,8 +10,9 @@ declare i8 @memcpy(ptr, ptr, i32)
; Check that memcpy functions with the wrong prototype (doesn't return a pointer) aren't simplified.
define i8 @test_no_simplify1(ptr %mem1, ptr %mem2, i32 %size) {
-; CHECK-LABEL: @test_no_simplify1(
-; CHECK-NEXT: [[RET:%.*]] = call i8 @memcpy(ptr %mem1, ptr %mem2, i32 %size)
+; CHECK-LABEL: define i8 @test_no_simplify1(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i8 @memcpy(ptr [[MEM1]], ptr [[MEM2]], i32 [[SIZE]])
; CHECK-NEXT: ret i8 [[RET]]
;
%ret = call i8 @memcpy(ptr %mem1, ptr %mem2, i32 %size)
diff --git a/llvm/test/Transforms/InstCombine/memcpy_chk-2.ll b/llvm/test/Transforms/InstCombine/memcpy_chk-2.ll
index b2840378fe15d..4f6335650e4a3 100644
--- a/llvm/test/Transforms/InstCombine/memcpy_chk-2.ll
+++ b/llvm/test/Transforms/InstCombine/memcpy_chk-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that lib call simplification doesn't simplify __memcpy_chk calls
; with the wrong prototype.
;
@@ -12,9 +13,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
@t2 = common global %struct.T2 zeroinitializer
define void @test_no_simplify() {
-; CHECK-LABEL: @test_no_simplify(
+; CHECK-LABEL: define void @test_no_simplify() {
+; CHECK-NEXT: [[TMP1:%.*]] = call ptr @__memcpy_chk(ptr nonnull @t1, ptr nonnull @t2, i64 1824)
+; CHECK-NEXT: ret void
+;
-; CHECK-NEXT: call ptr @__memcpy_chk
call ptr @__memcpy_chk(ptr @t1, ptr @t2, i64 1824)
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/memmove-1.ll b/llvm/test/Transforms/InstCombine/memmove-1.ll
index 2356bef60da5f..83cc7e11dd908 100644
--- a/llvm/test/Transforms/InstCombine/memmove-1.ll
+++ b/llvm/test/Transforms/InstCombine/memmove-1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the memmove library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -9,33 +10,41 @@ declare ptr @memmove(ptr, ptr, i32)
; Check memmove(mem1, mem2, size) -> llvm.memmove(mem1, mem2, size, 1).
define ptr @test_simplify1(ptr %mem1, ptr %mem2, i32 %size) {
-; CHECK-LABEL: @test_simplify1(
+; CHECK-LABEL: define ptr @test_simplify1(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; CHECK-NEXT: call void @llvm.memmove.p0.p0.i32(ptr align 1 [[MEM1]], ptr align 1 [[MEM2]], i32 [[SIZE]], i1 false)
+; CHECK-NEXT: ret ptr [[MEM1]]
+;
%ret = call ptr @memmove(ptr %mem1, ptr %mem2, i32 %size)
-; CHECK: call void @llvm.memmove
ret ptr %ret
-; CHECK: ret ptr %mem1
}
define ptr @test_simplify2(ptr %mem1, ptr %mem2, i32 %size) {
-; CHECK-LABEL: @test_simplify2(
-; CHECK-NEXT: tail call void @llvm.memmove
-; CHECK-NEXT: ret ptr %mem1
+; CHECK-LABEL: define ptr @test_simplify2(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; CHECK-NEXT: tail call void @llvm.memmove.p0.p0.i32(ptr align 1 [[MEM1]], ptr align 1 [[MEM2]], i32 [[SIZE]], i1 false)
+; CHECK-NEXT: ret ptr [[MEM1]]
+;
%ret = tail call ptr @memmove(ptr %mem1, ptr %mem2, i32 %size)
ret ptr %ret
}
define ptr @test_no_simplify1(ptr %mem1, ptr %mem2, i32 %size) {
-; CHECK-LABEL: @test_no_simplify1(
-; CHECK-NEXT: %ret = musttail call ptr @memmove(ptr %mem1, ptr %mem2, i32 %size)
-; CHECK-NEXT: ret ptr %ret
+; CHECK-LABEL: define ptr @test_no_simplify1(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = musttail call ptr @memmove(ptr [[MEM1]], ptr [[MEM2]], i32 [[SIZE]])
+; CHECK-NEXT: ret ptr [[RET]]
+;
%ret = musttail call ptr @memmove(ptr %mem1, ptr %mem2, i32 %size)
ret ptr %ret
}
define ptr @test_no_incompatible_attr(ptr %mem1, ptr %mem2, i32 %size) {
-; CHECK-LABEL: @test_no_incompatible_attr(
+; CHECK-LABEL: define ptr @test_no_incompatible_attr(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; CHECK-NEXT: call void @llvm.memmove.p0.p0.i32(ptr align 1 [[MEM1]], ptr align 1 [[MEM2]], i32 [[SIZE]], i1 false)
+; CHECK-NEXT: ret ptr [[MEM1]]
+;
%ret = call dereferenceable(1) ptr @memmove(ptr %mem1, ptr %mem2, i32 %size)
-; CHECK: call void @llvm.memmove
ret ptr %ret
-; CHECK: ret ptr %mem1
}
diff --git a/llvm/test/Transforms/InstCombine/memmove-2.ll b/llvm/test/Transforms/InstCombine/memmove-2.ll
index a1ad1a78ad73d..9fd55a17e185c 100644
--- a/llvm/test/Transforms/InstCombine/memmove-2.ll
+++ b/llvm/test/Transforms/InstCombine/memmove-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the memmove library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -9,9 +10,11 @@ declare i8 @memmove(ptr, ptr, i32)
; Check that memmove functions with the wrong prototype aren't simplified.
define i8 @test_no_simplify1(ptr %mem1, ptr %mem2, i32 %size) {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define i8 @test_no_simplify1(
+; CHECK-SAME: ptr [[MEM1:%.*]], ptr [[MEM2:%.*]], i32 [[SIZE:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i8 @memmove(ptr [[MEM1]], ptr [[MEM2]], i32 [[SIZE]])
+; CHECK-NEXT: ret i8 [[RET]]
+;
%ret = call i8 @memmove(ptr %mem1, ptr %mem2, i32 %size)
-; CHECK: call i8 @memmove
ret i8 %ret
-; CHECK: ret i8 %ret
}
diff --git a/llvm/test/Transforms/InstCombine/memmove_chk-2.ll b/llvm/test/Transforms/InstCombine/memmove_chk-2.ll
index 11defff2a441b..19c33cdffd61b 100644
--- a/llvm/test/Transforms/InstCombine/memmove_chk-2.ll
+++ b/llvm/test/Transforms/InstCombine/memmove_chk-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that lib call simplification doesn't simplify __memmove_chk calls
; with the wrong prototype.
;
@@ -12,9 +13,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
@t2 = common global %struct.T2 zeroinitializer
define void @test_no_simplify() {
-; CHECK-LABEL: @test_no_simplify(
+; CHECK-LABEL: define void @test_no_simplify() {
+; CHECK-NEXT: [[TMP1:%.*]] = call ptr @__memmove_chk(ptr nonnull @t1, ptr nonnull @t2, i64 1824)
+; CHECK-NEXT: ret void
+;
-; CHECK-NEXT: call ptr @__memmove_chk
call ptr @__memmove_chk(ptr @t1, ptr @t2, i64 1824)
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/memset_chk-2.ll b/llvm/test/Transforms/InstCombine/memset_chk-2.ll
index c338105d170e0..cee9a2c6445bf 100644
--- a/llvm/test/Transforms/InstCombine/memset_chk-2.ll
+++ b/llvm/test/Transforms/InstCombine/memset_chk-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that lib call simplification doesn't simplify __memset_chk calls
; with the wrong prototype.
;
@@ -9,9 +10,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
@t = common global %struct.T zeroinitializer
define void @test_no_simplify() {
-; CHECK-LABEL: @test_no_simplify(
+; CHECK-LABEL: define void @test_no_simplify() {
+; CHECK-NEXT: [[TMP1:%.*]] = call ptr @__memset_chk(ptr nonnull @t, i32 0, i64 1824)
+; CHECK-NEXT: ret void
+;
-; CHECK-NEXT: call ptr @__memset_chk
call ptr @__memset_chk(ptr @t, i32 0, i64 1824)
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/minmax-fold.ll b/llvm/test/Transforms/InstCombine/minmax-fold.ll
index 3e870c695cf1a..d77a6ee3e4cbe 100644
--- a/llvm/test/Transforms/InstCombine/minmax-fold.ll
+++ b/llvm/test/Transforms/InstCombine/minmax-fold.ll
@@ -1360,11 +1360,11 @@ define i8 @PR14613_smax(i8 %x) {
define i8 @PR46271(<2 x i8> %x) {
; CHECK-LABEL: @PR46271(
-; CHECK-NEXT: [[TMP3:%.*]] = xor <2 x i8> [[X:%.*]], <i8 poison, i8 -1>
+; CHECK-NEXT: [[TMP1:%.*]] = xor <2 x i8> [[X:%.*]], <i8 poison, i8 -1>
; CHECK-NEXT: [[A_INV:%.*]] = icmp slt <2 x i8> [[X]], zeroinitializer
-; CHECK-NEXT: [[TMP1:%.*]] = select <2 x i1> [[A_INV]], <2 x i8> <i8 poison, i8 0>, <2 x i8> [[TMP3]]
-; CHECK-NEXT: [[TMP2:%.*]] = extractelement <2 x i8> [[TMP1]], i64 1
-; CHECK-NEXT: ret i8 [[TMP2]]
+; CHECK-NEXT: [[NOT:%.*]] = select <2 x i1> [[A_INV]], <2 x i8> <i8 poison, i8 0>, <2 x i8> [[TMP1]]
+; CHECK-NEXT: [[R:%.*]] = extractelement <2 x i8> [[NOT]], i64 1
+; CHECK-NEXT: ret i8 [[R]]
;
%a = icmp sgt <2 x i8> %x, <i8 -1, i8 -1>
%b = select <2 x i1> %a, <2 x i8> %x, <2 x i8> <i8 poison, i8 -1>
diff --git a/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll b/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
index a76f0f84ba340..77f52073374eb 100644
--- a/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
+++ b/llvm/test/Transforms/InstCombine/minmax-intrinsics.ll
@@ -2584,9 +2584,9 @@ entry:
define i8 @test_umax_and(i8 %x, i8 %y) {
; CHECK-LABEL: @test_umax_and(
-; CHECK-NEXT: [[RES:%.*]] = call i8 @llvm.umax.i8(i8 [[X1:%.*]], i8 [[Y1:%.*]])
-; CHECK-NEXT: [[RES1:%.*]] = and i8 [[RES]], -64
-; CHECK-NEXT: ret i8 [[RES1]]
+; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.umax.i8(i8 [[X:%.*]], i8 [[Y:%.*]])
+; CHECK-NEXT: [[RES:%.*]] = and i8 [[TMP1]], -64
+; CHECK-NEXT: ret i8 [[RES]]
;
%x1 = and i8 %x, -64
%y1 = and i8 %y, -64
@@ -2596,9 +2596,9 @@ define i8 @test_umax_and(i8 %x, i8 %y) {
define i8 @test_umin_and(i8 %x, i8 %y) {
; CHECK-LABEL: @test_umin_and(
-; CHECK-NEXT: [[RES:%.*]] = call i8 @llvm.umin.i8(i8 [[X1:%.*]], i8 [[Y1:%.*]])
-; CHECK-NEXT: [[RES1:%.*]] = and i8 [[RES]], -64
-; CHECK-NEXT: ret i8 [[RES1]]
+; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.umin.i8(i8 [[X:%.*]], i8 [[Y:%.*]])
+; CHECK-NEXT: [[RES:%.*]] = and i8 [[TMP1]], -64
+; CHECK-NEXT: ret i8 [[RES]]
;
%x1 = and i8 %x, -64
%y1 = and i8 %y, -64
@@ -2608,9 +2608,9 @@ define i8 @test_umin_and(i8 %x, i8 %y) {
define i8 @test_smax_and(i8 %x, i8 %y) {
; CHECK-LABEL: @test_smax_and(
-; CHECK-NEXT: [[RES:%.*]] = call i8 @llvm.smax.i8(i8 [[X1:%.*]], i8 [[Y1:%.*]])
-; CHECK-NEXT: [[RES1:%.*]] = and i8 [[RES]], -64
-; CHECK-NEXT: ret i8 [[RES1]]
+; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.smax.i8(i8 [[X:%.*]], i8 [[Y:%.*]])
+; CHECK-NEXT: [[RES:%.*]] = and i8 [[TMP1]], -64
+; CHECK-NEXT: ret i8 [[RES]]
;
%x1 = and i8 %x, -64
%y1 = and i8 %y, -64
@@ -2620,9 +2620,9 @@ define i8 @test_smax_and(i8 %x, i8 %y) {
define i8 @test_smin_and(i8 %x, i8 %y) {
; CHECK-LABEL: @test_smin_and(
-; CHECK-NEXT: [[RES:%.*]] = call i8 @llvm.smin.i8(i8 [[X1:%.*]], i8 [[Y1:%.*]])
-; CHECK-NEXT: [[RES1:%.*]] = and i8 [[RES]], -64
-; CHECK-NEXT: ret i8 [[RES1]]
+; CHECK-NEXT: [[TMP1:%.*]] = call i8 @llvm.smin.i8(i8 [[X:%.*]], i8 [[Y:%.*]])
+; CHECK-NEXT: [[RES:%.*]] = and i8 [[TMP1]], -64
+; CHECK-NEXT: ret i8 [[RES]]
;
%x1 = and i8 %x, -64
%y1 = and i8 %y, -64
diff --git a/llvm/test/Transforms/InstCombine/mul-inseltpoison.ll b/llvm/test/Transforms/InstCombine/mul-inseltpoison.ll
index 94f41236c6f86..088fad8274700 100644
--- a/llvm/test/Transforms/InstCombine/mul-inseltpoison.ll
+++ b/llvm/test/Transforms/InstCombine/mul-inseltpoison.ll
@@ -87,8 +87,8 @@ define i32 @test12(i32 %a, i32 %b) {
; rdar://7293527
define i32 @test15(i32 %A, i32 %B) {
; CHECK-LABEL: @test15(
-; CHECK-NEXT: [[M1:%.*]] = shl i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret i32 [[M1]]
+; CHECK-NEXT: [[M:%.*]] = shl i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret i32 [[M]]
;
%shl = shl i32 1, %B
%m = mul i32 %shl, %A
@@ -512,8 +512,8 @@ define <3 x i4> @neg_mul_constant_vec_weird(<3 x i4> %a) {
define i32 @test26(i32 %A, i32 %B) {
; CHECK-LABEL: @test26(
-; CHECK-NEXT: [[D1:%.*]] = shl nsw i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret i32 [[D1]]
+; CHECK-NEXT: [[D:%.*]] = shl nsw i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret i32 [[D]]
;
%C = shl nsw i32 1, %B
%D = mul nsw i32 %A, %C
@@ -522,8 +522,8 @@ define i32 @test26(i32 %A, i32 %B) {
define i32 @test27(i32 %A, i32 %B) {
; CHECK-LABEL: @test27(
-; CHECK-NEXT: [[D1:%.*]] = shl nuw i32 [[A:%.*]], [[B:%.*]]
-; CHECK-NEXT: ret i32 [[D1]]
+; CHECK-NEXT: [[D:%.*]] = shl nuw i32 [[A:%.*]], [[B:%.*]]
+; CHECK-NEXT: ret i32 [[D]]
;
%C = shl i32 1, %B
%D = mul nuw i32 %A, %C
@@ -572,8 +572,8 @@ define i32 @test31(i32 %V) {
; CHECK-LABEL: @test31(
; CHECK-NEXT: [[CMP:%.*]] = icmp ne ptr inttoptr (i64 1 to ptr), @PR22087
; CHECK-NEXT: [[EXT:%.*]] = zext i1 [[CMP]] to i32
-; CHECK-NEXT: [[MUL1:%.*]] = shl i32 [[V:%.*]], [[EXT]]
-; CHECK-NEXT: ret i32 [[MUL1]]
+; CHECK-NEXT: [[MUL:%.*]] = shl i32 [[V:%.*]], [[EXT]]
+; CHECK-NEXT: ret i32 [[MUL]]
;
%cmp = icmp ne ptr inttoptr (i64 1 to ptr), @PR22087
%ext = zext i1 %cmp to i32
diff --git a/llvm/test/Transforms/InstCombine/mul-min-max.ll b/llvm/test/Transforms/InstCombine/mul-min-max.ll
index fce6b9576dc3f..a7cde6d295dcf 100644
--- a/llvm/test/Transforms/InstCombine/mul-min-max.ll
+++ b/llvm/test/Transforms/InstCombine/mul-min-max.ll
@@ -22,7 +22,7 @@ entry:
define i32 @umul_min_max_comm(i32 %a, i32 %b) {
; CHECK-LABEL: @umul_min_max_comm(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[RES:%.*]] = mul i32 [[B:%.*]], [[A:%.*]]
+; CHECK-NEXT: [[RES:%.*]] = mul i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: ret i32 [[RES]]
;
entry:
@@ -61,7 +61,7 @@ entry:
define i32 @smul_min_max_comm(i32 %a, i32 %b) {
; CHECK-LABEL: @smul_min_max_comm(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[RES:%.*]] = mul i32 [[B:%.*]], [[A:%.*]]
+; CHECK-NEXT: [[RES:%.*]] = mul i32 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: ret i32 [[RES]]
;
entry:
diff --git a/llvm/test/Transforms/InstCombine/mul-pow2.ll b/llvm/test/Transforms/InstCombine/mul-pow2.ll
index c16fd710f309b..38298c44e19da 100644
--- a/llvm/test/Transforms/InstCombine/mul-pow2.ll
+++ b/llvm/test/Transforms/InstCombine/mul-pow2.ll
@@ -106,8 +106,8 @@ define <2 x i8> @mul_x_selectp2_vec(<2 x i8> %xx, i1 %c) {
define i8 @shl_add_log_may_cause_poison_pr62175_fail(i8 %x, i8 %y) {
; CHECK-LABEL: @shl_add_log_may_cause_poison_pr62175_fail(
-; CHECK-NEXT: [[SHL:%.*]] = shl i8 4, [[X:%.*]]
-; CHECK-NEXT: [[MUL:%.*]] = mul i8 [[SHL]], [[Y:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = shl i8 [[Y:%.*]], 2
+; CHECK-NEXT: [[MUL:%.*]] = shl i8 [[TMP1]], [[X:%.*]]
; CHECK-NEXT: ret i8 [[MUL]]
;
%shl = shl i8 4, %x
@@ -117,8 +117,8 @@ define i8 @shl_add_log_may_cause_poison_pr62175_fail(i8 %x, i8 %y) {
define i8 @shl_add_log_may_cause_poison_pr62175_with_nuw(i8 %x, i8 %y) {
; CHECK-LABEL: @shl_add_log_may_cause_poison_pr62175_with_nuw(
-; CHECK-NEXT: [[TMP1:%.*]] = add i8 [[X:%.*]], 2
-; CHECK-NEXT: [[MUL:%.*]] = shl i8 [[Y:%.*]], [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = shl i8 [[Y:%.*]], 2
+; CHECK-NEXT: [[MUL:%.*]] = shl i8 [[TMP1]], [[X:%.*]]
; CHECK-NEXT: ret i8 [[MUL]]
;
%shl = shl nuw i8 4, %x
@@ -128,8 +128,8 @@ define i8 @shl_add_log_may_cause_poison_pr62175_with_nuw(i8 %x, i8 %y) {
define i8 @shl_add_log_may_cause_poison_pr62175_with_nsw(i8 %x, i8 %y) {
; CHECK-LABEL: @shl_add_log_may_cause_poison_pr62175_with_nsw(
-; CHECK-NEXT: [[TMP1:%.*]] = add i8 [[X:%.*]], 2
-; CHECK-NEXT: [[MUL:%.*]] = shl i8 [[Y:%.*]], [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = shl i8 [[Y:%.*]], 2
+; CHECK-NEXT: [[MUL:%.*]] = shl i8 [[TMP1]], [[X:%.*]]
; CHECK-NEXT: ret i8 [[MUL]]
;
%shl = shl nsw i8 4, %x
diff --git a/llvm/test/Transforms/InstCombine/mul_fold.ll b/llvm/test/Transforms/InstCombine/mul_fold.ll
index a1fdec3c68cc4..b8f949bb35072 100644
--- a/llvm/test/Transforms/InstCombine/mul_fold.ll
+++ b/llvm/test/Transforms/InstCombine/mul_fold.ll
@@ -738,4 +738,4 @@ define i32 @mul32_low_extra_shl_use(i32 %in0, i32 %in1) {
call void @use32(i32 %shl)
%retLo = add i32 %shl, %m00
ret i32 %retLo
-}
\ No newline at end of file
+}
diff --git a/llvm/test/Transforms/InstCombine/multi-use-or.ll b/llvm/test/Transforms/InstCombine/multi-use-or.ll
index 19acfda6665b0..146e51aba8aa3 100644
--- a/llvm/test/Transforms/InstCombine/multi-use-or.ll
+++ b/llvm/test/Transforms/InstCombine/multi-use-or.ll
@@ -1,24 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep "fadd double .sx, .sy"
; The 'or' has multiple uses, make sure that this doesn't prevent instcombine
; from propagating the extends to the truncs.
define double @ScaleObjectAdd(double %sx, double %sy, double %sz) nounwind {
entry:
- %sx34 = bitcast double %sx to i64 ; <i64> [#uses=1]
- %sx3435 = zext i64 %sx34 to i192 ; <i192> [#uses=1]
- %sy22 = bitcast double %sy to i64 ; <i64> [#uses=1]
- %sy2223 = zext i64 %sy22 to i192 ; <i192> [#uses=1]
- %sy222324 = shl i192 %sy2223, 128 ; <i192> [#uses=1]
- %sy222324.ins = or i192 %sx3435, %sy222324 ; <i192> [#uses=1]
-
-
- %a = trunc i192 %sy222324.ins to i64 ; <i64> [#uses=1]
- %b = bitcast i64 %a to double ; <double> [#uses=1]
- %c = lshr i192 %sy222324.ins, 128 ; <i192> [#uses=1]
- %d = trunc i192 %c to i64 ; <i64> [#uses=1]
- %e = bitcast i64 %d to double ; <double> [#uses=1]
- %f = fadd double %b, %e
+ %sx34 = bitcast double %sx to i64 ; <i64> [#uses=1]
+ %sx3435 = zext i64 %sx34 to i192 ; <i192> [#uses=1]
+ %sy22 = bitcast double %sy to i64 ; <i64> [#uses=1]
+ %sy2223 = zext i64 %sy22 to i192 ; <i192> [#uses=1]
+ %sy222324 = shl i192 %sy2223, 128 ; <i192> [#uses=1]
+ %sy222324.ins = or i192 %sx3435, %sy222324 ; <i192> [#uses=1]
+
+
+ %a = trunc i192 %sy222324.ins to i64 ; <i64> [#uses=1]
+ %b = bitcast i64 %a to double ; <double> [#uses=1]
+ %c = lshr i192 %sy222324.ins, 128 ; <i192> [#uses=1]
+ %d = trunc i192 %c to i64 ; <i64> [#uses=1]
+ %e = bitcast i64 %d to double ; <double> [#uses=1]
+ %f = fadd double %b, %e
; ret double %e
- ret double %f
+ ret double %f
}
diff --git a/llvm/test/Transforms/InstCombine/musttail-thunk.ll b/llvm/test/Transforms/InstCombine/musttail-thunk.ll
index 9e6e9086d451e..eb88413998709 100644
--- a/llvm/test/Transforms/InstCombine/musttail-thunk.ll
+++ b/llvm/test/Transforms/InstCombine/musttail-thunk.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
; RUN: opt -debugify-each -passes=instcombine -S < %s | FileCheck %s
@@ -5,27 +6,37 @@
; alone.
define i32 @call_thunk(i32 %x, i32 %y) {
+; CHECK-LABEL: define i32 @call_thunk(
+; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[R:%.*]] = call i32 @inc_first_arg_thunk(i32 [[X]], i32 [[Y]])
+; CHECK-NEXT: ret i32 [[R]]
+;
%r = call i32 @inc_first_arg_thunk(i32 %x, i32 %y)
ret i32 %r
}
-; CHECK-LABEL: define i32 @call_thunk(i32 %x, i32 %y)
-; CHECK: %r = call i32 @inc_first_arg_thunk(i32 %x, i32 %y)
-; CHECK: ret i32 %r
define internal void @inc_first_arg_thunk(i32 %arg1, ...) #0 {
+; CHECK-LABEL: define internal void @inc_first_arg_thunk(
+; CHECK-SAME: i32 [[ARG1:%.*]], ...) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[INC:%.*]] = add i32 [[ARG1]], 1
+; CHECK-NEXT: musttail call void (i32, ...) @plus(i32 [[INC]], ...)
+; CHECK-NEXT: ret void
+;
entry:
%inc = add i32 %arg1, 1
musttail call void (i32, ...) @plus(i32 %inc, ...)
ret void
}
-; CHECK-LABEL: define internal void @inc_first_arg_thunk(i32 %arg1, ...) #0
-; CHECK: %inc = add i32 %arg1, 1
-; CHECK: musttail call void (i32, ...) @plus(i32 %inc, ...)
-; CHECK: ret void
define internal i32 @plus(i32 %x, i32 %y) {
+; CHECK-LABEL: define internal i32 @plus(
+; CHECK-SAME: i32 [[X:%.*]], i32 [[Y:%.*]]) {
+; CHECK-NEXT: [[R:%.*]] = add i32 [[X]], [[Y]]
+; CHECK-NEXT: ret i32 [[R]]
+;
%r = add i32 %x, %y
ret i32 %r
}
diff --git a/llvm/test/Transforms/InstCombine/object-size-opaque.ll b/llvm/test/Transforms/InstCombine/object-size-opaque.ll
index f04ef79c807ca..d5e1b21878d07 100644
--- a/llvm/test/Transforms/InstCombine/object-size-opaque.ll
+++ b/llvm/test/Transforms/InstCombine/object-size-opaque.ll
@@ -1,8 +1,14 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S %s | FileCheck %s
%opaque = type opaque
-; CHECK: call i64 @llvm.objectsize.i64
define void @foo(ptr sret(%opaque) %in, ptr %sizeptr) {
+; CHECK-LABEL: define void @foo(
+; CHECK-SAME: ptr sret([[OPAQUE:%.*]]) [[IN:%.*]], ptr [[SIZEPTR:%.*]]) {
+; CHECK-NEXT: [[SIZE:%.*]] = call i64 @llvm.objectsize.i64.p0(ptr [[IN]], i1 false, i1 false, i1 false)
+; CHECK-NEXT: store i64 [[SIZE]], ptr [[SIZEPTR]], align 4
+; CHECK-NEXT: ret void
+;
%size = call i64 @llvm.objectsize.i64(ptr %in, i1 0, i1 0, i1 0)
store i64 %size, ptr %sizeptr
ret void
diff --git a/llvm/test/Transforms/InstCombine/objsize-64.ll b/llvm/test/Transforms/InstCombine/objsize-64.ll
index b214ddae94b12..3bc82af4794a3 100644
--- a/llvm/test/Transforms/InstCombine/objsize-64.ll
+++ b/llvm/test/Transforms/InstCombine/objsize-64.ll
@@ -25,13 +25,13 @@ define i64 @f2(ptr %esc) nounwind uwtable ssp personality ptr @__gxx_personality
; CHECK-LABEL: @f2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CALL:%.*]] = invoke noalias dereferenceable(13) ptr @_Znwm(i64 13)
-; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]]
+; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]]
; CHECK: invoke.cont:
; CHECK-NEXT: store ptr [[CALL]], ptr [[ESC:%.*]], align 8
; CHECK-NEXT: ret i64 13
; CHECK: lpad:
; CHECK-NEXT: [[TMP0:%.*]] = landingpad { ptr, i32 }
-; CHECK-NEXT: filter [0 x ptr] zeroinitializer
+; CHECK-NEXT: filter [0 x ptr] zeroinitializer
; CHECK-NEXT: [[TMP1:%.*]] = extractvalue { ptr, i32 } [[TMP0]], 0
; CHECK-NEXT: tail call void @__cxa_call_unexpected(ptr [[TMP1]]) #[[ATTR3:[0-9]+]]
; CHECK-NEXT: unreachable
diff --git a/llvm/test/Transforms/InstCombine/objsize-address-space.ll b/llvm/test/Transforms/InstCombine/objsize-address-space.ll
index af7670952a8c7..399af634cb887 100644
--- a/llvm/test/Transforms/InstCombine/objsize-address-space.ll
+++ b/llvm/test/Transforms/InstCombine/objsize-address-space.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -passes=instcombine -o - %s | FileCheck %s
target datalayout = "e-p:32:32:32-p1:64:64:64-p2:8:8:8-p3:16:16:16-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:32"
@@ -19,57 +20,71 @@ declare i16 @llvm.objectsize.i16.p3(ptr addrspace(3), i1) nounwind readonly
@a_as3 = private addrspace(3) global [60 x i8] zeroinitializer, align 1
define i32 @foo_as3() nounwind {
-; CHECK-LABEL: @foo_as3(
-; CHECK-NEXT: ret i32 60
+; CHECK-LABEL: define i32 @foo_as3(
+; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: ret i32 60
+;
%1 = call i32 @llvm.objectsize.i32.p3(ptr addrspace(3) @a_as3, i1 false)
ret i32 %1
}
define i16 @foo_as3_i16() nounwind {
-; CHECK-LABEL: @foo_as3_i16(
-; CHECK-NEXT: ret i16 60
+; CHECK-LABEL: define i16 @foo_as3_i16(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT: ret i16 60
+;
%1 = call i16 @llvm.objectsize.i16.p3(ptr addrspace(3) @a_as3, i1 false)
ret i16 %1
}
@a_alias = weak alias [60 x i8], ptr addrspace(3) @a_as3
define i32 @foo_alias() nounwind {
+; CHECK-LABEL: define i32 @foo_alias(
+; CHECK-SAME: ) #[[ATTR0]] {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.objectsize.i32.p3(ptr addrspace(3) @a_alias, i1 false, i1 false, i1 false)
+; CHECK-NEXT: ret i32 [[TMP1]]
+;
%1 = call i32 @llvm.objectsize.i32.p3(ptr addrspace(3) @a_alias, i1 false)
ret i32 %1
}
define i32 @array_as2_size() {
-; CHECK-LABEL: @array_as2_size(
-; CHECK-NEXT: ret i32 60
+; CHECK-LABEL: define i32 @array_as2_size() {
+; CHECK-NEXT: ret i32 60
+;
%1 = call i32 @llvm.objectsize.i32.p2(ptr addrspace(2) @array_as2, i1 false)
ret i32 %1
}
define i32 @pointer_array_as1() {
-; CHECK-LABEL: @pointer_array_as1(
-; CHECK-NEXT: ret i32 80
+; CHECK-LABEL: define i32 @pointer_array_as1() {
+; CHECK-NEXT: ret i32 80
+;
%bc = addrspacecast ptr @array_as1_pointers to ptr addrspace(1)
%1 = call i32 @llvm.objectsize.i32.p1(ptr addrspace(1) %bc, i1 false)
ret i32 %1
}
define i32 @pointer_array_as2() {
-; CHECK-LABEL: @pointer_array_as2(
-; CHECK-NEXT: ret i32 24
+; CHECK-LABEL: define i32 @pointer_array_as2() {
+; CHECK-NEXT: ret i32 24
+;
%1 = call i32 @llvm.objectsize.i32.p0(ptr @array_as2_pointers, i1 false)
ret i32 %1
}
define i32 @pointer_array_as3() {
-; CHECK-LABEL: @pointer_array_as3(
-; CHECK-NEXT: ret i32 84
+; CHECK-LABEL: define i32 @pointer_array_as3() {
+; CHECK-NEXT: ret i32 84
+;
%1 = call i32 @llvm.objectsize.i32.p0(ptr @array_as3_pointers, i1 false)
ret i32 %1
}
define i32 @pointer_pointer_array_as2_as1() {
-; CHECK-LABEL: @pointer_pointer_array_as2_as1(
-; CHECK-NEXT: ret i32 128
+; CHECK-LABEL: define i32 @pointer_pointer_array_as2_as1() {
+; CHECK-NEXT: ret i32 128
+;
%1 = call i32 @llvm.objectsize.i32.p0(ptr @array_as2_as1_pointer_pointers, i1 false)
ret i32 %1
}
diff --git a/llvm/test/Transforms/InstCombine/odr-linkage.ll b/llvm/test/Transforms/InstCombine/odr-linkage.ll
index 280213c0114ec..89cf3156729b0 100644
--- a/llvm/test/Transforms/InstCombine/odr-linkage.ll
+++ b/llvm/test/Transforms/InstCombine/odr-linkage.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep "ret i32 10"
@g1 = available_externally constant i32 1
@@ -10,10 +11,10 @@ define i32 @test() {
%B = load i32, ptr @g2
%C = load i32, ptr @g3
%D = load i32, ptr @g4
-
+
%a = add i32 %A, %B
%b = add i32 %a, %C
%c = add i32 %b, %D
ret i32 %c
}
-
+
diff --git a/llvm/test/Transforms/InstCombine/opaque.ll b/llvm/test/Transforms/InstCombine/opaque.ll
index 6a26ded7ac12b..744cb50bf7503 100644
--- a/llvm/test/Transforms/InstCombine/opaque.ll
+++ b/llvm/test/Transforms/InstCombine/opaque.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -disable-output
; Checks that bitcasts are not converted into GEP when
; when the size of an aggregate cannot be determined.
diff --git a/llvm/test/Transforms/InstCombine/or.ll b/llvm/test/Transforms/InstCombine/or.ll
index 6e2085a8bb6c7..4f45b02f5f57d 100644
--- a/llvm/test/Transforms/InstCombine/or.ll
+++ b/llvm/test/Transforms/InstCombine/or.ll
@@ -1551,9 +1551,9 @@ define <2 x i1> @cmp_overlap_splat(<2 x i5> %x) {
define i32 @mul_no_common_bits(i32 %p1, i32 %p2) {
; CHECK-LABEL: @mul_no_common_bits(
; CHECK-NEXT: [[X:%.*]] = and i32 [[P1:%.*]], 7
-; CHECK-NEXT: [[Y:%.*]] = shl i32 [[P2:%.*]], 3
-; CHECK-NEXT: [[TMP1:%.*]] = or disjoint i32 [[Y]], 1
-; CHECK-NEXT: [[R:%.*]] = mul i32 [[X]], [[TMP1]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X]], [[P2:%.*]]
+; CHECK-NEXT: [[M:%.*]] = shl i32 [[TMP1]], 3
+; CHECK-NEXT: [[R:%.*]] = or disjoint i32 [[M]], [[X]]
; CHECK-NEXT: ret i32 [[R]]
;
%x = and i32 %p1, 7
@@ -1590,8 +1590,8 @@ define <2 x i12> @mul_no_common_bits_commute(<2 x i12> %p) {
define i32 @mul_no_common_bits_commute2(i32 %p1, i32 %p2) {
; CHECK-LABEL: @mul_no_common_bits_commute2(
; CHECK-NEXT: [[X:%.*]] = and i32 [[P1:%.*]], 7
-; CHECK-NEXT: [[Y:%.*]] = shl i32 [[P2:%.*]], 3
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[Y]], [[X]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X]], [[P2:%.*]]
+; CHECK-NEXT: [[M:%.*]] = shl i32 [[TMP1]], 3
; CHECK-NEXT: [[R:%.*]] = or disjoint i32 [[M]], [[X]]
; CHECK-NEXT: ret i32 [[R]]
;
@@ -1628,8 +1628,8 @@ define i32 @mul_no_common_bits_const_op_disjoint(i32 %x, i32 %y) {
define i32 @mul_no_common_bits_uses(i32 %p1, i32 %p2) {
; CHECK-LABEL: @mul_no_common_bits_uses(
; CHECK-NEXT: [[X:%.*]] = and i32 [[P1:%.*]], 7
-; CHECK-NEXT: [[Y:%.*]] = shl i32 [[P2:%.*]], 3
-; CHECK-NEXT: [[M:%.*]] = mul i32 [[X]], [[Y]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i32 [[X]], [[P2:%.*]]
+; CHECK-NEXT: [[M:%.*]] = shl i32 [[TMP1]], 3
; CHECK-NEXT: call void @use(i32 [[M]])
; CHECK-NEXT: [[R:%.*]] = or disjoint i32 [[M]], [[X]]
; CHECK-NEXT: ret i32 [[R]]
diff --git a/llvm/test/Transforms/InstCombine/osx-names.ll b/llvm/test/Transforms/InstCombine/osx-names.ll
index b8ab8001421da..b166066e15597 100644
--- a/llvm/test/Transforms/InstCombine/osx-names.ll
+++ b/llvm/test/Transforms/InstCombine/osx-names.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; <rdar://problem/9815881>
; On OSX x86-32, fwrite and fputs aren't called fwrite and fputs.
@@ -15,14 +16,20 @@ target triple = "i386-apple-macosx10.7.2"
define void @test1(ptr %stream) nounwind {
; CHECK-LABEL: define void @test1(
-; CHECK: call i32 @"fwrite$UNIX2003"
+; CHECK-SAME: ptr [[STREAM:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[TMP1:%.*]] = tail call i32 @"fwrite$UNIX2003"(ptr nonnull @.str, i32 12, i32 1, ptr [[STREAM]]) #[[ATTR0]]
+; CHECK-NEXT: ret void
+;
%call = tail call i32 (ptr, ptr, ...) @fprintf(ptr %stream, ptr @.str) nounwind
ret void
}
define void @test2(ptr %stream, ptr %str) nounwind ssp {
; CHECK-LABEL: define void @test2(
-; CHECK: call i32 @"fputs$UNIX2003"
+; CHECK-SAME: ptr [[STREAM:%.*]], ptr [[STR:%.*]]) #[[ATTR1:[0-9]+]] {
+; CHECK-NEXT: %"fputs$UNIX2003" = tail call i32 @"fputs$UNIX2003"(ptr [[STR]], ptr [[STREAM]]) #[[ATTR0]]
+; CHECK-NEXT: ret void
+;
%call = tail call i32 (ptr, ptr, ...) @fprintf(ptr %stream, ptr @.str2, ptr %str) nounwind
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/sadd_sat.ll b/llvm/test/Transforms/InstCombine/sadd_sat.ll
index 1cce297122f8a..b181db9ff9bb9 100644
--- a/llvm/test/Transforms/InstCombine/sadd_sat.ll
+++ b/llvm/test/Transforms/InstCombine/sadd_sat.ll
@@ -679,10 +679,10 @@ entry:
define i32 @ashrA(i64 %a, i32 %b) {
; CHECK-LABEL: @ashrA(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
-; CHECK-NEXT: [[TMP1:%.*]] = trunc nuw i64 [[TMP0]] to i32
-; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.sadd.sat.i32(i32 [[TMP1]], i32 [[B:%.*]])
-; CHECK-NEXT: ret i32 [[TMP2]]
+; CHECK-NEXT: [[CONV:%.*]] = lshr i64 [[A:%.*]], 32
+; CHECK-NEXT: [[TMP0:%.*]] = trunc nuw i64 [[CONV]] to i32
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.sadd.sat.i32(i32 [[TMP0]], i32 [[B:%.*]])
+; CHECK-NEXT: ret i32 [[TMP1]]
;
entry:
%conv = ashr i64 %a, 32
@@ -697,10 +697,10 @@ entry:
define i32 @ashrB(i32 %a, i64 %b) {
; CHECK-LABEL: @ashrB(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[B:%.*]], 32
-; CHECK-NEXT: [[TMP1:%.*]] = trunc nuw i64 [[TMP0]] to i32
-; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.sadd.sat.i32(i32 [[TMP1]], i32 [[A:%.*]])
-; CHECK-NEXT: ret i32 [[TMP2]]
+; CHECK-NEXT: [[CONV1:%.*]] = lshr i64 [[B:%.*]], 32
+; CHECK-NEXT: [[TMP0:%.*]] = trunc nuw i64 [[CONV1]] to i32
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @llvm.sadd.sat.i32(i32 [[TMP0]], i32 [[A:%.*]])
+; CHECK-NEXT: ret i32 [[TMP1]]
;
entry:
%conv = sext i32 %a to i64
@@ -717,12 +717,12 @@ entry:
define i32 @ashrAB(i64 %a, i64 %b) {
; CHECK-LABEL: @ashrAB(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = lshr i64 [[A:%.*]], 32
-; CHECK-NEXT: [[TMP1:%.*]] = lshr i64 [[B:%.*]], 32
-; CHECK-NEXT: [[TMP2:%.*]] = trunc nuw i64 [[TMP1]] to i32
-; CHECK-NEXT: [[TMP3:%.*]] = trunc nuw i64 [[TMP0]] to i32
-; CHECK-NEXT: [[TMP4:%.*]] = call i32 @llvm.sadd.sat.i32(i32 [[TMP2]], i32 [[TMP3]])
-; CHECK-NEXT: ret i32 [[TMP4]]
+; CHECK-NEXT: [[CONV:%.*]] = lshr i64 [[A:%.*]], 32
+; CHECK-NEXT: [[CONV1:%.*]] = lshr i64 [[B:%.*]], 32
+; CHECK-NEXT: [[TMP0:%.*]] = trunc nuw i64 [[CONV1]] to i32
+; CHECK-NEXT: [[TMP1:%.*]] = trunc nuw i64 [[CONV]] to i32
+; CHECK-NEXT: [[TMP2:%.*]] = call i32 @llvm.sadd.sat.i32(i32 [[TMP0]], i32 [[TMP1]])
+; CHECK-NEXT: ret i32 [[TMP2]]
;
entry:
%conv = ashr i64 %a, 32
@@ -805,10 +805,10 @@ entry:
define <2 x i8> @ashrv2i8_s(<2 x i16> %a, <2 x i8> %b) {
; CHECK-LABEL: @ashrv2i8_s(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = lshr <2 x i16> [[A:%.*]], <i16 8, i16 8>
-; CHECK-NEXT: [[TMP1:%.*]] = trunc nuw <2 x i16> [[TMP0]] to <2 x i8>
-; CHECK-NEXT: [[TMP2:%.*]] = call <2 x i8> @llvm.sadd.sat.v2i8(<2 x i8> [[TMP1]], <2 x i8> [[B:%.*]])
-; CHECK-NEXT: ret <2 x i8> [[TMP2]]
+; CHECK-NEXT: [[CONV:%.*]] = lshr <2 x i16> [[A:%.*]], <i16 8, i16 8>
+; CHECK-NEXT: [[TMP0:%.*]] = trunc nuw <2 x i16> [[CONV]] to <2 x i8>
+; CHECK-NEXT: [[TMP1:%.*]] = call <2 x i8> @llvm.sadd.sat.v2i8(<2 x i8> [[TMP0]], <2 x i8> [[B:%.*]])
+; CHECK-NEXT: ret <2 x i8> [[TMP1]]
;
entry:
%conv = ashr <2 x i16> %a, <i16 8, i16 8>
diff --git a/llvm/test/Transforms/InstCombine/salvage-dbg-declare.ll b/llvm/test/Transforms/InstCombine/salvage-dbg-declare.ll
index 6538810639842..e8ddd1d0dcdef 100644
--- a/llvm/test/Transforms/InstCombine/salvage-dbg-declare.ll
+++ b/llvm/test/Transforms/InstCombine/salvage-dbg-declare.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S -o - %s | FileCheck %s
; RUN: opt -passes=instcombine -S -o - %s --try-experimental-debuginfo-iterators | FileCheck %s
@@ -5,8 +6,14 @@ declare dso_local i32 @bar(ptr)
; Function Attrs: nounwind
define internal i32 @foo() #0 !dbg !1 {
-; CHECK: %[[VLA:.*]] = alloca [2 x i32]
-; CHECK: #dbg_declare(ptr %[[VLA]], {{.*}}, !DIExpression(),
+; CHECK-LABEL: define internal i32 @foo(
+; CHECK-SAME: ) #[[ATTR0:[0-9]+]] !dbg [[DBG4:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[VLA1:%.*]] = alloca [2 x i32], align 4, !dbg [[DBG16:![0-9]+]]
+; CHECK-NEXT: #dbg_declare(ptr [[VLA1]], [[META19:![0-9]+]], !DIExpression(), [[META20:![0-9]+]])
+; CHECK-NEXT: [[CALL:%.*]] = call i32 @bar(ptr nonnull [[VLA1]]) #[[ATTR0]], !dbg [[DBG21:![0-9]+]]
+; CHECK-NEXT: unreachable
+;
entry:
%vla = alloca i32, i64 2, align 4, !dbg !16
@@ -47,3 +54,26 @@ attributes #1 = { nounwind readnone speculatable }
!20 = !DILocation(line: 240, column: 12, scope: !17)
!21 = !DILocation(line: 241, column: 65, scope: !17)
!22 = !DILocation(line: 241, column: 11, scope: !17)
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C99, file: [[META1:![0-9]+]], producer: "clang version", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: [[META2:![0-9]+]], retainedTypes: [[META2]], globals: [[META2]])
+; CHECK: [[META1]] = !DIFile(filename: "b", directory: {{.*}})
+; CHECK: [[META2]] = !{}
+; CHECK: [[DBG4]] = distinct !DISubprogram(name: "a", scope: [[META1]], file: [[META1]], line: 232, type: [[META5:![0-9]+]], scopeLine: 234, flags: DIFlagPrototyped, spFlags: DISPFlagLocalToUnit | DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META6:![0-9]+]])
+; CHECK: [[META5]] = !DISubroutineType(types: [[META2]])
+; CHECK: [[META6]] = !{[[META7:![0-9]+]], [[META11:![0-9]+]]}
+; CHECK: [[META7]] = !DILocalVariable(name: "__vla_expr", scope: [[META8:![0-9]+]], type: [[META10:![0-9]+]], flags: DIFlagArtificial)
+; CHECK: [[META8]] = distinct !DILexicalBlock(scope: [[META9:![0-9]+]], file: [[META1]], line: 238, column: 39)
+; CHECK: [[META9]] = distinct !DILexicalBlock(scope: [[DBG4]], file: [[META1]], line: 238, column: 6)
+; CHECK: [[META10]] = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
+; CHECK: [[META11]] = !DILocalVariable(name: "ptr32", scope: [[META8]], file: [[META1]], line: 240, type: [[META12:![0-9]+]])
+; CHECK: [[META12]] = !DICompositeType(tag: DW_TAG_array_type, baseType: [[META13:![0-9]+]], elements: [[META14:![0-9]+]])
+; CHECK: [[META13]] = !DIBasicType(name: "unsigned int", size: 32, encoding: DW_ATE_unsigned)
+; CHECK: [[META14]] = !{[[META15:![0-9]+]]}
+; CHECK: [[META15]] = !DISubrange(count: [[META7]])
+; CHECK: [[DBG16]] = !DILocation(line: 240, column: 3, scope: [[META17:![0-9]+]])
+; CHECK: [[META17]] = distinct !DILexicalBlock(scope: [[META18:![0-9]+]], file: [[META1]], line: 238, column: 39)
+; CHECK: [[META18]] = distinct !DILexicalBlock(scope: [[DBG4]], file: [[META1]], line: 238, column: 6)
+; CHECK: [[META19]] = !DILocalVariable(name: "ptr32", scope: [[META17]], file: [[META1]], line: 240, type: [[META12]])
+; CHECK: [[META20]] = !DILocation(line: 240, column: 12, scope: [[META17]])
+; CHECK: [[DBG21]] = !DILocation(line: 241, column: 11, scope: [[META17]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/scalable-bitcast-inseltpoison.ll b/llvm/test/Transforms/InstCombine/scalable-bitcast-inseltpoison.ll
index ee4861046f4b2..c663f9ba8f3a1 100644
--- a/llvm/test/Transforms/InstCombine/scalable-bitcast-inseltpoison.ll
+++ b/llvm/test/Transforms/InstCombine/scalable-bitcast-inseltpoison.ll
@@ -1,11 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
; We shouldn't fold bitcast(insert <vscale x 1 x iX> .., iX %val, i32 0)
; into bitcast(iX %val) for scalable vectors.
define <vscale x 2 x i8> @bitcast_of_insert_i8_i16(i16 %val) #0 {
-; CHECK-LABEL: @bitcast_of_insert_i8_i16(
-; CHECK-NOT: bitcast i16 %val to <vscale x 2 x i8>
-; CHECK: bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
+; CHECK-LABEL: define <vscale x 2 x i8> @bitcast_of_insert_i8_i16(
+; CHECK-SAME: i16 [[VAL:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[OP2:%.*]] = insertelement <vscale x 1 x i16> poison, i16 [[VAL]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast <vscale x 1 x i16> [[OP2]] to <vscale x 2 x i8>
+; CHECK-NEXT: ret <vscale x 2 x i8> [[TMP0]]
+;
entry:
%op2 = insertelement <vscale x 1 x i16> poison, i16 %val, i32 0
%0 = bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
diff --git a/llvm/test/Transforms/InstCombine/scalable-bitcast.ll b/llvm/test/Transforms/InstCombine/scalable-bitcast.ll
index 6fc2fb19bfa7d..1d43760b996d7 100644
--- a/llvm/test/Transforms/InstCombine/scalable-bitcast.ll
+++ b/llvm/test/Transforms/InstCombine/scalable-bitcast.ll
@@ -1,11 +1,16 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
; We shouldn't fold bitcast(insert <vscale x 1 x iX> .., iX %val, i32 0)
; into bitcast(iX %val) for scalable vectors.
define <vscale x 2 x i8> @bitcast_of_insert_i8_i16(i16 %val) #0 {
-; CHECK-LABEL: @bitcast_of_insert_i8_i16(
-; CHECK-NOT: bitcast i16 %val to <vscale x 2 x i8>
-; CHECK: bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
+; CHECK-LABEL: define <vscale x 2 x i8> @bitcast_of_insert_i8_i16(
+; CHECK-SAME: i16 [[VAL:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[OP2:%.*]] = insertelement <vscale x 1 x i16> undef, i16 [[VAL]], i64 0
+; CHECK-NEXT: [[TMP0:%.*]] = bitcast <vscale x 1 x i16> [[OP2]] to <vscale x 2 x i8>
+; CHECK-NEXT: ret <vscale x 2 x i8> [[TMP0]]
+;
entry:
%op2 = insertelement <vscale x 1 x i16> undef, i16 %val, i32 0
%0 = bitcast <vscale x 1 x i16> %op2 to <vscale x 2 x i8>
diff --git a/llvm/test/Transforms/InstCombine/scalable-const-fp-splat.ll b/llvm/test/Transforms/InstCombine/scalable-const-fp-splat.ll
index b3b20609296d6..00a815322cd24 100644
--- a/llvm/test/Transforms/InstCombine/scalable-const-fp-splat.ll
+++ b/llvm/test/Transforms/InstCombine/scalable-const-fp-splat.ll
@@ -1,9 +1,12 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S -o - < %s | FileCheck %s
define <vscale x 2 x float> @shrink_splat_scalable_extend(<vscale x 2 x float> %a) {
- ; CHECK-LABEL: @shrink_splat_scalable_extend
- ; CHECK-NEXT: %[[FADD:.*]] = fadd <vscale x 2 x float> %a, shufflevector (<vscale x 2 x float> insertelement (<vscale x 2 x float> undef, float -1.000000e+00, i32 0), <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer)
- ; CHECK-NEXT: ret <vscale x 2 x float> %[[FADD]]
+; CHECK-LABEL: define <vscale x 2 x float> @shrink_splat_scalable_extend(
+; CHECK-SAME: <vscale x 2 x float> [[A:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = fadd <vscale x 2 x float> [[A]], shufflevector (<vscale x 2 x float> insertelement (<vscale x 2 x float> undef, float -1.000000e+00, i32 0), <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer)
+; CHECK-NEXT: ret <vscale x 2 x float> [[TMP1]]
+;
%1 = shufflevector <vscale x 2 x float> insertelement (<vscale x 2 x float> undef, float -1.000000e+00, i32 0), <vscale x 2 x float> undef, <vscale x 2 x i32> zeroinitializer
%2 = fpext <vscale x 2 x float> %a to <vscale x 2 x double>
%3 = fpext <vscale x 2 x float> %1 to <vscale x 2 x double>
diff --git a/llvm/test/Transforms/InstCombine/scalarization.ll b/llvm/test/Transforms/InstCombine/scalarization.ll
index 7e645ef7e883e..fd8f8ec9df081 100644
--- a/llvm/test/Transforms/InstCombine/scalarization.ll
+++ b/llvm/test/Transforms/InstCombine/scalarization.ll
@@ -344,8 +344,8 @@ define i1 @extractelt_vector_fcmp_constrhs_dynidx(<2 x float> %arg, i32 %idx) {
define i1 @extractelt_vector_fcmp_copy_flags(<4 x float> %x) {
; CHECK-LABEL: @extractelt_vector_fcmp_copy_flags(
; CHECK-NEXT: [[TMP1:%.*]] = extractelement <4 x float> [[X:%.*]], i64 2
-; CHECK-NEXT: [[TMP2:%.*]] = fcmp nsz arcp oeq float [[TMP1]], 0.000000e+00
-; CHECK-NEXT: ret i1 [[TMP2]]
+; CHECK-NEXT: [[R:%.*]] = fcmp nsz arcp oeq float [[TMP1]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[R]]
;
%cmp = fcmp nsz arcp oeq <4 x float> %x, zeroinitializer
%r = extractelement <4 x i1> %cmp, i32 2
diff --git a/llvm/test/Transforms/InstCombine/sdiv-2.ll b/llvm/test/Transforms/InstCombine/sdiv-2.ll
index e7d7a1ac9da25..9e2ef47486aec 100644
--- a/llvm/test/Transforms/InstCombine/sdiv-2.ll
+++ b/llvm/test/Transforms/InstCombine/sdiv-2.ll
@@ -1,28 +1,29 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -disable-output
; PR3144
define fastcc i32 @func(i32 %length) nounwind {
entry:
- %0 = icmp ne i32 %length, -1 ; <i1> [#uses=1]
- %iftmp.13.0 = select i1 %0, i128 0, i128 200000000 ; <i128> [#uses=2]
- %1 = sdiv i128 %iftmp.13.0, 10 ; <i128> [#uses=1]
- br label %bb5
+ %0 = icmp ne i32 %length, -1 ; <i1> [#uses=1]
+ %iftmp.13.0 = select i1 %0, i128 0, i128 200000000 ; <i128> [#uses=2]
+ %1 = sdiv i128 %iftmp.13.0, 10 ; <i128> [#uses=1]
+ br label %bb5
bb5: ; preds = %bb8, %entry
- %v.0 = phi i128 [ 0, %entry ], [ %6, %bb8 ] ; <i128> [#uses=2]
- %2 = icmp sgt i128 %v.0, %1 ; <i1> [#uses=1]
- br i1 %2, label %overflow, label %bb7
+ %v.0 = phi i128 [ 0, %entry ], [ %6, %bb8 ] ; <i128> [#uses=2]
+ %2 = icmp sgt i128 %v.0, %1 ; <i1> [#uses=1]
+ br i1 %2, label %overflow, label %bb7
bb7: ; preds = %bb5
- %3 = mul i128 %v.0, 10 ; <i128> [#uses=2]
- %4 = sub i128 %iftmp.13.0, 0 ; <i128> [#uses=1]
- %5 = icmp slt i128 %4, %3 ; <i1> [#uses=1]
- br i1 %5, label %overflow, label %bb8
+ %3 = mul i128 %v.0, 10 ; <i128> [#uses=2]
+ %4 = sub i128 %iftmp.13.0, 0 ; <i128> [#uses=1]
+ %5 = icmp slt i128 %4, %3 ; <i1> [#uses=1]
+ br i1 %5, label %overflow, label %bb8
bb8: ; preds = %bb7
- %6 = add i128 0, %3 ; <i128> [#uses=1]
- br label %bb5
+ %6 = add i128 0, %3 ; <i128> [#uses=1]
+ br label %bb5
overflow: ; preds = %bb7, %bb5
- ret i32 1
+ ret i32 1
}
diff --git a/llvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll b/llvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll
index 36af8685f9ae3..1302700f3d844 100644
--- a/llvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll
+++ b/llvm/test/Transforms/InstCombine/sdiv-exact-by-power-of-two.ll
@@ -121,8 +121,8 @@ define i8 @prove_exact_with_high_mask(i8 %x, i8 %y) {
define i8 @prove_exact_with_high_mask_limit(i8 %x, i8 %y) {
; CHECK-LABEL: @prove_exact_with_high_mask_limit(
-; CHECK-NEXT: [[A:%.*]] = ashr i8 [[X:%.*]], 3
-; CHECK-NEXT: ret i8 [[A]]
+; CHECK-NEXT: [[D:%.*]] = ashr i8 [[X:%.*]], 3
+; CHECK-NEXT: ret i8 [[D]]
;
%a = and i8 %x, -8
%d = sdiv i8 %a, 8
diff --git a/llvm/test/Transforms/InstCombine/select-crash.ll b/llvm/test/Transforms/InstCombine/select-crash.ll
index d5689c2ea6d8a..11fb63ac10527 100644
--- a/llvm/test/Transforms/InstCombine/select-crash.ll
+++ b/llvm/test/Transforms/InstCombine/select-crash.ll
@@ -1,10 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
; Formerly crashed, PR8490.
define fastcc double @gimp_operation_color_balance_map(float %value, double %highlights) nounwind readnone inlinehint {
+; CHECK-LABEL: define fastcc double @gimp_operation_color_balance_map(
+; CHECK-SAME: float [[VALUE:%.*]], double [[HIGHLIGHTS:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[CONV:%.*]] = fpext float [[VALUE]] to double
+; CHECK-NEXT: [[DIV:%.*]] = fmul double [[CONV]], 6.250000e-02
+; CHECK-NEXT: [[ADD:%.*]] = fadd double [[DIV]], 1.000000e+00
+; CHECK-NEXT: [[DIV1:%.*]] = fdiv double 1.000000e+00, [[ADD]]
+; CHECK-NEXT: [[SUB:%.*]] = fsub double 1.075000e+00, [[DIV1]]
+; CHECK-NEXT: [[CMP86:%.*]] = fcmp ogt double [[HIGHLIGHTS]], 0.000000e+00
+; CHECK-NEXT: [[TMP0:%.*]] = fneg double [[SUB]]
+; CHECK-NEXT: [[COND90_P:%.*]] = select i1 [[CMP86]], double [[TMP0]], double [[SUB]]
+; CHECK-NEXT: [[COND90:%.*]] = fadd double [[COND90_P]], 1.000000e+00
+; CHECK-NEXT: [[MUL91:%.*]] = fmul double [[COND90]], [[HIGHLIGHTS]]
+; CHECK-NEXT: [[ADD94:%.*]] = fadd double [[MUL91]], [[MUL91]]
+; CHECK-NEXT: ret double [[ADD94]]
+;
entry:
-; CHECK: gimp_operation_color_balance_map
-; CHECK: fneg double
%conv = fpext float %value to double
%div = fdiv double %conv, 1.600000e+01
%add = fadd double %div, 1.000000e+00
@@ -21,12 +36,15 @@ entry:
; PR10180: same crash, but with vectors
define <4 x float> @foo(i1 %b, <4 x float> %x, <4 x float> %y, <4 x float> %z) {
-; CHECK-LABEL: @foo(
-; CHECK: fneg <4 x float>
-; CHECK: select
-; CHECK: fadd <4 x float>
+; CHECK-LABEL: define <4 x float> @foo(
+; CHECK-SAME: i1 [[B:%.*]], <4 x float> [[X:%.*]], <4 x float> [[Y:%.*]], <4 x float> [[Z:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = fneg <4 x float> [[Z]]
+; CHECK-NEXT: [[SEL_P:%.*]] = select i1 [[B]], <4 x float> [[Y]], <4 x float> [[TMP1]]
+; CHECK-NEXT: [[SEL:%.*]] = fadd <4 x float> [[SEL_P]], [[X]]
+; CHECK-NEXT: ret <4 x float> [[SEL]]
+;
%a = fadd <4 x float> %x, %y
%sub = fsub <4 x float> %x, %z
- %sel = select i1 %b, <4 x float> %a, <4 x float> %sub
+ %sel = select i1 %b, <4 x float> %a, <4 x float> %sub
ret <4 x float> %sel
}
diff --git a/llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll b/llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll
index 59d33ee3b39df..037ea706e2e3d 100644
--- a/llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll
+++ b/llvm/test/Transforms/InstCombine/select-ctlz-to-cttz.ll
@@ -156,8 +156,8 @@ define i64 @select_clz_to_ctz_i64_wrong_xor(i64 %a) {
; CHECK-NEXT: [[SUB:%.*]] = sub i64 0, [[A:%.*]]
; CHECK-NEXT: [[AND:%.*]] = and i64 [[SUB]], [[A]]
; CHECK-NEXT: [[LZ:%.*]] = tail call range(i64 0, 65) i64 @llvm.ctlz.i64(i64 [[AND]], i1 true)
-; CHECK-NEXT: [[SUB11:%.*]] = or disjoint i64 [[LZ]], 64
-; CHECK-NEXT: ret i64 [[SUB11]]
+; CHECK-NEXT: [[SUB1:%.*]] = or disjoint i64 [[LZ]], 64
+; CHECK-NEXT: ret i64 [[SUB1]]
;
%sub = sub i64 0, %a
%and = and i64 %sub, %a
diff --git a/llvm/test/Transforms/InstCombine/select-load-call.ll b/llvm/test/Transforms/InstCombine/select-load-call.ll
index aba2c115e190e..3b9b9263d6026 100644
--- a/llvm/test/Transforms/InstCombine/select-load-call.ll
+++ b/llvm/test/Transforms/InstCombine/select-load-call.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep "ret i32 1"
declare void @test2()
diff --git a/llvm/test/Transforms/InstCombine/select-select.ll b/llvm/test/Transforms/InstCombine/select-select.ll
index 84fe973093e32..aff71e987f387 100644
--- a/llvm/test/Transforms/InstCombine/select-select.ll
+++ b/llvm/test/Transforms/InstCombine/select-select.ll
@@ -18,9 +18,9 @@ define float @foo1(float %a) {
define float @foo2(float %a) {
; CHECK-LABEL: @foo2(
-; CHECK-NEXT: [[B:%.*]] = fcmp ule float [[C:%.*]], 0.000000e+00
-; CHECK-NEXT: [[D:%.*]] = fcmp olt float [[C]], 1.000000e+00
-; CHECK-NEXT: [[E:%.*]] = select i1 [[D]], float [[C]], float 1.000000e+00
+; CHECK-NEXT: [[B:%.*]] = fcmp ule float [[A:%.*]], 0.000000e+00
+; CHECK-NEXT: [[TMP1:%.*]] = fcmp olt float [[A]], 1.000000e+00
+; CHECK-NEXT: [[E:%.*]] = select i1 [[TMP1]], float [[A]], float 1.000000e+00
; CHECK-NEXT: [[F:%.*]] = select i1 [[B]], float 0.000000e+00, float [[E]]
; CHECK-NEXT: ret float [[F]]
;
diff --git a/llvm/test/Transforms/InstCombine/setcc-strength-reduce.ll b/llvm/test/Transforms/InstCombine/setcc-strength-reduce.ll
index 8109445f5f8b0..c06a60ef032d0 100644
--- a/llvm/test/Transforms/InstCombine/setcc-strength-reduce.ll
+++ b/llvm/test/Transforms/InstCombine/setcc-strength-reduce.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; This test ensures that "strength reduction" of conditional expressions are
; working. Basically this boils down to converting setlt,gt,le,ge instructions
; into equivalent setne,eq instructions.
@@ -8,30 +9,30 @@
define i1 @test1(i32 %A) {
; setne %A, 0
- %B = icmp uge i32 %A, 1 ; <i1> [#uses=1]
- ret i1 %B
+ %B = icmp uge i32 %A, 1 ; <i1> [#uses=1]
+ ret i1 %B
}
define i1 @test2(i32 %A) {
; setne %A, 0
- %B = icmp ugt i32 %A, 0 ; <i1> [#uses=1]
- ret i1 %B
+ %B = icmp ugt i32 %A, 0 ; <i1> [#uses=1]
+ ret i1 %B
}
define i1 @test3(i8 %A) {
; setne %A, -128
- %B = icmp sge i8 %A, -127 ; <i1> [#uses=1]
- ret i1 %B
+ %B = icmp sge i8 %A, -127 ; <i1> [#uses=1]
+ ret i1 %B
}
define i1 @test4(i8 %A) {
- ; setne %A, 127
- %B = icmp sle i8 %A, 126 ; <i1> [#uses=1]
- ret i1 %B
+ ; setne %A, 127
+ %B = icmp sle i8 %A, 126 ; <i1> [#uses=1]
+ ret i1 %B
}
define i1 @test5(i8 %A) {
; setne %A, 127
- %B = icmp slt i8 %A, 127 ; <i1> [#uses=1]
- ret i1 %B
+ %B = icmp slt i8 %A, 127 ; <i1> [#uses=1]
+ ret i1 %B
}
diff --git a/llvm/test/Transforms/InstCombine/shift-by-signext.ll b/llvm/test/Transforms/InstCombine/shift-by-signext.ll
index f57d7f605c563..1a1bb95692541 100644
--- a/llvm/test/Transforms/InstCombine/shift-by-signext.ll
+++ b/llvm/test/Transforms/InstCombine/shift-by-signext.ll
@@ -117,8 +117,8 @@ declare i8 @llvm.fshl.i8(i8 %a, i8 %b, i8 %c)
declare i8 @llvm.fshr.i8(i8 %a, i8 %b, i8 %c)
define i8 @t9_fshl(i8 %x, i8 %y, i6 %shamt) {
; CHECK-LABEL: @t9_fshl(
-; CHECK-NEXT: [[SHAMT_WIDE1:%.*]] = zext i6 [[SHAMT:%.*]] to i8
-; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 [[X:%.*]], i8 [[Y:%.*]], i8 [[SHAMT_WIDE1]])
+; CHECK-NEXT: [[SHAMT_WIDE:%.*]] = zext i6 [[SHAMT:%.*]] to i8
+; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshl.i8(i8 [[X:%.*]], i8 [[Y:%.*]], i8 [[SHAMT_WIDE]])
; CHECK-NEXT: ret i8 [[R]]
;
%shamt_wide = sext i6 %shamt to i8
@@ -127,8 +127,8 @@ define i8 @t9_fshl(i8 %x, i8 %y, i6 %shamt) {
}
define i8 @t10_fshr(i8 %x, i8 %y, i6 %shamt) {
; CHECK-LABEL: @t10_fshr(
-; CHECK-NEXT: [[SHAMT_WIDE1:%.*]] = zext i6 [[SHAMT:%.*]] to i8
-; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshr.i8(i8 [[X:%.*]], i8 [[Y:%.*]], i8 [[SHAMT_WIDE1]])
+; CHECK-NEXT: [[SHAMT_WIDE:%.*]] = zext i6 [[SHAMT:%.*]] to i8
+; CHECK-NEXT: [[R:%.*]] = call i8 @llvm.fshr.i8(i8 [[X:%.*]], i8 [[Y:%.*]], i8 [[SHAMT_WIDE]])
; CHECK-NEXT: ret i8 [[R]]
;
%shamt_wide = sext i6 %shamt to i8
diff --git a/llvm/test/Transforms/InstCombine/shl-demand.ll b/llvm/test/Transforms/InstCombine/shl-demand.ll
index 08e6e74581848..c0702b8718b1a 100644
--- a/llvm/test/Transforms/InstCombine/shl-demand.ll
+++ b/llvm/test/Transforms/InstCombine/shl-demand.ll
@@ -121,8 +121,8 @@ define <2 x i32> @src_srem_shl_mask_vector_nonconstant(<2 x i32> %a0, <2 x i32>
define i16 @sext_shl_trunc_same_size(i16 %x, i32 %y) {
; CHECK-LABEL: @sext_shl_trunc_same_size(
-; CHECK-NEXT: [[CONV1:%.*]] = zext i16 [[X:%.*]] to i32
-; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[CONV1]], [[Y:%.*]]
+; CHECK-NEXT: [[CONV:%.*]] = zext i16 [[X:%.*]] to i32
+; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[CONV]], [[Y:%.*]]
; CHECK-NEXT: [[T:%.*]] = trunc i32 [[SHL]] to i16
; CHECK-NEXT: ret i16 [[T]]
;
@@ -134,8 +134,8 @@ define i16 @sext_shl_trunc_same_size(i16 %x, i32 %y) {
define i5 @sext_shl_trunc_smaller(i16 %x, i32 %y) {
; CHECK-LABEL: @sext_shl_trunc_smaller(
-; CHECK-NEXT: [[CONV1:%.*]] = zext i16 [[X:%.*]] to i32
-; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[CONV1]], [[Y:%.*]]
+; CHECK-NEXT: [[CONV:%.*]] = zext i16 [[X:%.*]] to i32
+; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[CONV]], [[Y:%.*]]
; CHECK-NEXT: [[T:%.*]] = trunc i32 [[SHL]] to i5
; CHECK-NEXT: ret i5 [[T]]
;
@@ -162,8 +162,8 @@ define i17 @sext_shl_trunc_larger(i16 %x, i32 %y) {
define i32 @sext_shl_mask(i16 %x, i32 %y) {
; CHECK-LABEL: @sext_shl_mask(
-; CHECK-NEXT: [[CONV1:%.*]] = zext i16 [[X:%.*]] to i32
-; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[CONV1]], [[Y:%.*]]
+; CHECK-NEXT: [[CONV:%.*]] = zext i16 [[X:%.*]] to i32
+; CHECK-NEXT: [[SHL:%.*]] = shl i32 [[CONV]], [[Y:%.*]]
; CHECK-NEXT: [[T:%.*]] = and i32 [[SHL]], 65535
; CHECK-NEXT: ret i32 [[T]]
;
diff --git a/llvm/test/Transforms/InstCombine/signmask-of-sext-vs-of-shl-of-zext.ll b/llvm/test/Transforms/InstCombine/signmask-of-sext-vs-of-shl-of-zext.ll
index e7505721cad60..893dc6622f515 100644
--- a/llvm/test/Transforms/InstCombine/signmask-of-sext-vs-of-shl-of-zext.ll
+++ b/llvm/test/Transforms/InstCombine/signmask-of-sext-vs-of-shl-of-zext.ll
@@ -132,8 +132,8 @@ define <2 x i32> @t8(<2 x i16> %x) {
define <2 x i32> @t9(<2 x i16> %x) {
; CHECK-LABEL: @t9(
-; CHECK-NEXT: [[I1:%.*]] = sext <2 x i16> [[X:%.*]] to <2 x i32>
-; CHECK-NEXT: [[R:%.*]] = and <2 x i32> [[I1]], <i32 -2147483648, i32 -2147483648>
+; CHECK-NEXT: [[X_SIGNEXT:%.*]] = sext <2 x i16> [[X:%.*]] to <2 x i32>
+; CHECK-NEXT: [[R:%.*]] = and <2 x i32> [[X_SIGNEXT]], <i32 -2147483648, i32 -2147483648>
; CHECK-NEXT: ret <2 x i32> [[R]]
;
%i0 = zext <2 x i16> %x to <2 x i32>
@@ -158,8 +158,8 @@ define <2 x i32> @t10_undef(<2 x i16> %x) {
define <2 x i32> @t10_poison(<2 x i16> %x) {
; CHECK-LABEL: @t10_poison(
-; CHECK-NEXT: [[I1:%.*]] = sext <2 x i16> [[X:%.*]] to <2 x i32>
-; CHECK-NEXT: [[R:%.*]] = and <2 x i32> [[I1]], <i32 -2147483648, i32 poison>
+; CHECK-NEXT: [[X_SIGNEXT:%.*]] = sext <2 x i16> [[X:%.*]] to <2 x i32>
+; CHECK-NEXT: [[R:%.*]] = and <2 x i32> [[X_SIGNEXT]], <i32 -2147483648, i32 poison>
; CHECK-NEXT: ret <2 x i32> [[R]]
;
%i0 = zext <2 x i16> %x to <2 x i32>
diff --git a/llvm/test/Transforms/InstCombine/simple_phi_condition.ll b/llvm/test/Transforms/InstCombine/simple_phi_condition.ll
index 5501cb707e899..29d1ca4b5bb01 100644
--- a/llvm/test/Transforms/InstCombine/simple_phi_condition.ll
+++ b/llvm/test/Transforms/InstCombine/simple_phi_condition.ll
@@ -266,9 +266,9 @@ define i8 @test_switch(i8 %cond) {
; CHECK-LABEL: @test_switch(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[DEFAULT:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE:%.*]]
@@ -309,9 +309,9 @@ define i8 @test_switch_direct_edge(i8 %cond) {
; CHECK-LABEL: @test_switch_direct_edge(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[DEFAULT:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[MERGE:%.*]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[MERGE:%.*]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE]]
@@ -347,9 +347,9 @@ define i8 @test_switch_duplicate_direct_edge(i8 %cond) {
; CHECK-LABEL: @test_switch_duplicate_direct_edge(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[DEFAULT:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[MERGE:%.*]]
-; CHECK-NEXT: i8 19, label [[MERGE]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[MERGE:%.*]]
+; CHECK-NEXT: i8 19, label [[MERGE]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE]]
@@ -381,9 +381,9 @@ define i8 @test_switch_subset(i8 %cond) {
; CHECK-LABEL: @test_switch_subset(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[DEFAULT:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE:%.*]]
@@ -424,9 +424,9 @@ define i8 @test_switch_wrong_value(i8 %cond) {
; CHECK-LABEL: @test_switch_wrong_value(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[DEFAULT:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE:%.*]]
@@ -468,9 +468,9 @@ define i8 @test_switch_inverted(i8 %cond) {
; CHECK-LABEL: @test_switch_inverted(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[DEFAULT:%.*]] [
-; CHECK-NEXT: i8 0, label [[SW_0:%.*]]
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 2, label [[SW_2:%.*]]
+; CHECK-NEXT: i8 0, label [[SW_0:%.*]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 2, label [[SW_2:%.*]]
; CHECK-NEXT: ]
; CHECK: sw.0:
; CHECK-NEXT: br label [[MERGE:%.*]]
@@ -512,9 +512,9 @@ define i8 @test_switch_duplicate_edge(i8 %cond) {
; CHECK-LABEL: @test_switch_duplicate_edge(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[DEFAULT:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[SW_7]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[SW_7]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE:%.*]]
@@ -551,9 +551,9 @@ define i8 @test_switch_default_edge(i8 %cond) {
; CHECK-LABEL: @test_switch_default_edge(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[MERGE:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[SW_19:%.*]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE]]
@@ -590,9 +590,9 @@ define i8 @test_switch_default_edge_direct(i8 %cond) {
; CHECK-LABEL: @test_switch_default_edge_direct(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[MERGE:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[MERGE]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[MERGE]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE]]
@@ -621,9 +621,9 @@ define i8 @test_switch_default_edge_duplicate(i8 %cond) {
; CHECK-LABEL: @test_switch_default_edge_duplicate(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i8 [[COND:%.*]], label [[SW_19:%.*]] [
-; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
-; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
-; CHECK-NEXT: i8 19, label [[SW_19]]
+; CHECK-NEXT: i8 1, label [[SW_1:%.*]]
+; CHECK-NEXT: i8 7, label [[SW_7:%.*]]
+; CHECK-NEXT: i8 19, label [[SW_19]]
; CHECK-NEXT: ]
; CHECK: sw.1:
; CHECK-NEXT: br label [[MERGE:%.*]]
diff --git a/llvm/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll b/llvm/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll
index 5e2f563e2cbb0..439fdb12c8690 100644
--- a/llvm/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll
+++ b/llvm/test/Transforms/InstCombine/simplify-demanded-bits-pointer.ll
@@ -1,84 +1,85 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -disable-output
; SimplifyDemandedBits should cope with pointer types.
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128"
target triple = "x86_64-unknown-linux-gnu"
- %struct.VEC_rtx_base = type { i32, i32, [1 x ptr] }
- %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base }
- %struct.block_symbol = type { [3 x %struct.rtunion], ptr, i64 }
- %struct.object_block = type { ptr, i32, i64, ptr, ptr }
- %struct.omp_clause_subcode = type { i32 }
- %struct.rtunion = type { ptr }
- %struct.rtx_def = type { i16, i8, i8, %struct.u }
- %struct.section = type { %struct.unnamed_section }
- %struct.u = type { %struct.block_symbol }
- %struct.unnamed_section = type { %struct.omp_clause_subcode, ptr, ptr, ptr }
+ %struct.VEC_rtx_base = type { i32, i32, [1 x ptr] }
+ %struct.VEC_rtx_gc = type { %struct.VEC_rtx_base }
+ %struct.block_symbol = type { [3 x %struct.rtunion], ptr, i64 }
+ %struct.object_block = type { ptr, i32, i64, ptr, ptr }
+ %struct.omp_clause_subcode = type { i32 }
+ %struct.rtunion = type { ptr }
+ %struct.rtx_def = type { i16, i8, i8, %struct.u }
+ %struct.section = type { %struct.unnamed_section }
+ %struct.u = type { %struct.block_symbol }
+ %struct.unnamed_section = type { %struct.omp_clause_subcode, ptr, ptr, ptr }
define fastcc void @cse_insn(ptr %insn, ptr %libcall_insn, ptr %ptr, i1 %c1, i1 %c2, i1 %c3, i1 %c4, i1 %c5, i1 %c6, i1 %c7, i1 %c8, i1 %c9) nounwind {
entry:
- br i1 %c1, label %bb43, label %bb88
+ br i1 %c1, label %bb43, label %bb88
bb43: ; preds = %entry
- br label %bb88
+ br label %bb88
bb88: ; preds = %bb43, %entry
- br i1 %c2, label %bb95, label %bb107
+ br i1 %c2, label %bb95, label %bb107
bb95: ; preds = %bb88
- unreachable
+ unreachable
bb107: ; preds = %bb88
- %0 = load i16, ptr %ptr, align 8 ; <i16> [#uses=1]
- %1 = icmp eq i16 %0, 38 ; <i1> [#uses=1]
- %src_eqv_here.0 = select i1 %1, ptr null, ptr null ; <ptr> [#uses=1]
- br i1 %c3, label %bb127, label %bb125
+ %0 = load i16, ptr %ptr, align 8 ; <i16> [#uses=1]
+ %1 = icmp eq i16 %0, 38 ; <i1> [#uses=1]
+ %src_eqv_here.0 = select i1 %1, ptr null, ptr null ; <ptr> [#uses=1]
+ br i1 %c3, label %bb127, label %bb125
bb125: ; preds = %bb107
- br i1 %c4, label %bb127, label %bb126
+ br i1 %c4, label %bb127, label %bb126
bb126: ; preds = %bb125
- br i1 %c5, label %bb129, label %bb133
+ br i1 %c5, label %bb129, label %bb133
bb127: ; preds = %bb125, %bb107
- unreachable
+ unreachable
bb129: ; preds = %bb126
- br label %bb133
+ br label %bb133
bb133: ; preds = %bb129, %bb126
- br i1 %c6, label %bb134, label %bb146
+ br i1 %c6, label %bb134, label %bb146
bb134: ; preds = %bb133
- unreachable
+ unreachable
bb146: ; preds = %bb133
- br i1 %c7, label %bb180, label %bb186
+ br i1 %c7, label %bb180, label %bb186
bb180: ; preds = %bb146
- %2 = icmp eq ptr null, null ; <i1> [#uses=1]
- %3 = zext i1 %2 to i8 ; <i8> [#uses=1]
- %4 = icmp ne ptr %src_eqv_here.0, null ; <i1> [#uses=1]
- %5 = zext i1 %4 to i8 ; <i8> [#uses=1]
- %toBool181 = icmp ne i8 %3, 0 ; <i1> [#uses=1]
- %toBool182 = icmp ne i8 %5, 0 ; <i1> [#uses=1]
- %6 = and i1 %toBool181, %toBool182 ; <i1> [#uses=1]
- %7 = zext i1 %6 to i8 ; <i8> [#uses=1]
- %toBool183 = icmp ne i8 %7, 0 ; <i1> [#uses=1]
- br i1 %toBool183, label %bb184, label %bb186
+ %2 = icmp eq ptr null, null ; <i1> [#uses=1]
+ %3 = zext i1 %2 to i8 ; <i8> [#uses=1]
+ %4 = icmp ne ptr %src_eqv_here.0, null ; <i1> [#uses=1]
+ %5 = zext i1 %4 to i8 ; <i8> [#uses=1]
+ %toBool181 = icmp ne i8 %3, 0 ; <i1> [#uses=1]
+ %toBool182 = icmp ne i8 %5, 0 ; <i1> [#uses=1]
+ %6 = and i1 %toBool181, %toBool182 ; <i1> [#uses=1]
+ %7 = zext i1 %6 to i8 ; <i8> [#uses=1]
+ %toBool183 = icmp ne i8 %7, 0 ; <i1> [#uses=1]
+ br i1 %toBool183, label %bb184, label %bb186
bb184: ; preds = %bb180
- br i1 %c8, label %bb185, label %bb186
+ br i1 %c8, label %bb185, label %bb186
bb185: ; preds = %bb184
- br label %bb186
+ br label %bb186
bb186: ; preds = %bb185, %bb184, %bb180, %bb146
- br i1 %c9, label %bb190, label %bb195
+ br i1 %c9, label %bb190, label %bb195
bb190: ; preds = %bb186
- unreachable
+ unreachable
bb195: ; preds = %bb186
- unreachable
+ unreachable
}
diff --git a/llvm/test/Transforms/InstCombine/simplify-libcalls-inreg.ll b/llvm/test/Transforms/InstCombine/simplify-libcalls-inreg.ll
index 8bbd972ef6e0f..0b4d38978ddfc 100644
--- a/llvm/test/Transforms/InstCombine/simplify-libcalls-inreg.ll
+++ b/llvm/test/Transforms/InstCombine/simplify-libcalls-inreg.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S %s | FileCheck %s
; The intent of this test is to check that the declarations produces for
@@ -15,10 +16,16 @@ declare i32 @__sprintf_chk(ptr, i32, i32, ptr, ...)
@b = common global [60 x i8] zeroinitializer, align 1
@h = constant [2 x i8] c"h\00"
-; CHECK: declare i32 @bcmp(ptr inreg nocapture, ptr inreg nocapture, i32 inreg)
-; CHECK-NOT: declare i32 @bcmp(ptr nocapture, ptr nocapture, i32)
define i32 @baz(ptr inreg noundef %s2, i32 inreg noundef %n){
+; CHECK-LABEL: define i32 @baz(
+; CHECK-SAME: ptr inreg noundef [[S2:%.*]], i32 inreg noundef [[N:%.*]]) {
+; CHECK-NEXT: [[CALL:%.*]] = call ptr @foo()
+; CHECK-NEXT: [[BCMP:%.*]] = call i32 @bcmp(ptr [[CALL]], ptr [[S2]], i32 [[N]])
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[BCMP]], 0
+; CHECK-NEXT: [[CONV:%.*]] = zext i1 [[CMP]] to i32
+; CHECK-NEXT: ret i32 [[CONV]]
+;
%call = call ptr @foo()
%call1 = call i32 @memcmp(ptr inreg noundef %call, ptr inreg noundef %s2, i32 inreg noundef %n)
%cmp = icmp eq i32 %call1, 0
@@ -26,26 +33,34 @@ define i32 @baz(ptr inreg noundef %s2, i32 inreg noundef %n){
ret i32 %conv
}
-; CHECK: declare noundef i32 @putchar(i32 inreg noundef)
-; CHECK-NOT: declare noundef i32 @putchar(i32 noundef)
define void @test_fewer_params_than_num_register_parameters() {
+; CHECK-LABEL: define void @test_fewer_params_than_num_register_parameters() {
+; CHECK-NEXT: [[PUTCHAR:%.*]] = call i32 @putchar(i32 104)
+; CHECK-NEXT: ret void
+;
call i32 (ptr, ...) @printf(ptr @h)
ret void
}
-; CHECK: declare double @ldexp(double, i32 inreg)
-; CHECK-NOT: declare double @ldexp(double, i32)
define double @test_non_int_params(i16 signext %x) {
+; CHECK-LABEL: define double @test_non_int_params(
+; CHECK-SAME: i16 signext [[X:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = sext i16 [[X]] to i32
+; CHECK-NEXT: [[LDEXP:%.*]] = call double @ldexp(double 1.000000e+00, i32 [[TMP1]])
+; CHECK-NEXT: ret double [[LDEXP]]
+;
%conv = sitofp i16 %x to double
%ret = call double @exp2(double %conv)
ret double %ret
}
-; CHECK: declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...)
-; CHECK-NOT: declare noundef i32 @sprintf(ptr inreg noalias nocapture noundef writeonly, ptr inreg nocapture noundef readonly, ...)
define i32 @test_variadic() {
+; CHECK-LABEL: define i32 @test_variadic() {
+; CHECK-NEXT: [[SPRINTF:%.*]] = call i32 (ptr, ptr, ...) @sprintf(ptr nonnull dereferenceable(1) @a, ptr nonnull dereferenceable(1) @b)
+; CHECK-NEXT: ret i32 [[SPRINTF]]
+;
%ret = call i32 (ptr, i32, i32, ptr, ...) @__sprintf_chk(ptr @a, i32 0, i32 -1, ptr @b)
ret i32 %ret
}
diff --git a/llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll b/llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll
index ecfafbc69797b..e843b35175b78 100644
--- a/llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll
+++ b/llvm/test/Transforms/InstCombine/simplify-libcalls-new.ll
@@ -1,9 +1,9 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
;; Test behavior of -optimize-hot-cold-new and related options.
;; Check that we don't get hot/cold new calls without enabling it explicitly.
; RUN: opt < %s -passes=instcombine -S | FileCheck %s --check-prefix=OFF
; OFF-NOT: hot_cold_t
-; OFF-LABEL: @new_hot_cold()
;; First check with the default cold and hot hint values (255 = -2).
; RUN: opt < %s -passes=instcombine -optimize-hot-cold-new -S | FileCheck %s --check-prefix=HOTCOLD -DCOLD=1 -DHOT=-2 -DPREVHINTCOLD=7 -DPREVHINTNOTCOLD=7 -DPREVHINTHOT=7
@@ -22,18 +22,23 @@
;; Check that operator new(unsigned long) converted to
;; operator new(unsigned long, __hot_cold_t) with a hot or cold attribute.
-; HOTCOLD-LABEL: @new()
define void @new() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[COLD]])
+; OFF-LABEL: define void @new() {
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_Znwm(i64 10) #[[ATTR0:[0-9]+]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_Znwm(i64 10) #[[ATTR1:[0-9]+]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_Znwm(i64 10) #[[ATTR2:[0-9]+]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_Znwm(i64 10) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_Znwm(i64 10)
%call1 = call ptr @_Znwm(i64 10) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[HOT]])
%call2 = call ptr @_Znwm(i64 10) #2
call void @dummy(ptr %call2)
ret void
@@ -42,18 +47,23 @@ define void @new() {
;; Check that operator new(unsigned long, std::align_val_t) converted to
;; operator new(unsigned long, std::align_val_t, __hot_cold_t) with a hot or
;; cold attribute.
-; HOTCOLD-LABEL: @new_align()
define void @new_align() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[COLD]])
+; OFF-LABEL: define void @new_align() {
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_ZnwmSt11align_val_t(i64 10, i64 8)
%call1 = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[HOT]])
%call2 = call ptr @_ZnwmSt11align_val_t(i64 10, i64 8) #2
call void @dummy(ptr %call2)
ret void
@@ -62,19 +72,25 @@ define void @new_align() {
;; Check that operator new(unsigned long, const std::nothrow_t&) converted to
;; operator new(unsigned long, const std::nothrow_t&, __hot_cold_t) with a hot or
;; cold attribute.
-; HOTCOLD-LABEL: @new_nothrow()
define void @new_nothrow() {
+; OFF-LABEL: define void @new_nothrow() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr nonnull [[NT]]) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr nonnull [[NT]]) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr nonnull [[NT]]) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[COLD]])
%call = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_ZnwmRKSt9nothrow_t(i64 10, ptr nonnull %nt)
%call1 = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[HOT]])
%call2 = call ptr @_ZnwmRKSt9nothrow_t(i64 10, ptr %nt) #2
call void @dummy(ptr %call2)
ret void
@@ -84,19 +100,25 @@ define void @new_nothrow() {
;; converted to
;; operator new(unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
;; with a hot or cold attribute.
-; HOTCOLD-LABEL: @new_align_nothrow()
define void @new_align_nothrow() {
+; OFF-LABEL: define void @new_align_nothrow() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull [[NT]]) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull [[NT]]) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull [[NT]]) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[COLD]])
%call = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull %nt)
%call1 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[HOT]])
%call2 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #2
call void @dummy(ptr %call2)
ret void
@@ -104,18 +126,23 @@ define void @new_align_nothrow() {
;; Check that operator new[](unsigned long) converted to
;; operator new[](unsigned long, __hot_cold_t) with a hot or cold attribute.
-; HOTCOLD-LABEL: @array_new()
define void @array_new() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[COLD]])
+; OFF-LABEL: define void @array_new() {
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_Znam(i64 10) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_Znam(i64 10) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_Znam(i64 10) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_Znam(i64 10) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_Znam(i64 10)
%call1 = call ptr @_Znam(i64 10) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[HOT]])
%call2 = call ptr @_Znam(i64 10) #2
call void @dummy(ptr %call2)
ret void
@@ -124,18 +151,23 @@ define void @array_new() {
;; Check that operator new[](unsigned long, std::align_val_t) converted to
;; operator new[](unsigned long, std::align_val_t, __hot_cold_t) with a hot or
;; cold attribute.
-; HOTCOLD-LABEL: @array_new_align()
define void @array_new_align() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[COLD]])
+; OFF-LABEL: define void @array_new_align() {
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_t(i64 10, i64 8) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_t(i64 10, i64 8) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_t(i64 10, i64 8) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_ZnamSt11align_val_t(i64 10, i64 8)
%call1 = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[HOT]])
%call2 = call ptr @_ZnamSt11align_val_t(i64 10, i64 8) #2
call void @dummy(ptr %call2)
ret void
@@ -144,19 +176,25 @@ define void @array_new_align() {
;; Check that operator new[](unsigned long, const std::nothrow_t&) converted to
;; operator new[](unsigned long, const std::nothrow_t&, __hot_cold_t) with a hot or
;; cold attribute.
-; HOTCOLD-LABEL: @array_new_nothrow()
define void @array_new_nothrow() {
+; OFF-LABEL: define void @array_new_nothrow() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_ZnamRKSt9nothrow_t(i64 10, ptr nonnull [[NT]]) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_ZnamRKSt9nothrow_t(i64 10, ptr nonnull [[NT]]) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_ZnamRKSt9nothrow_t(i64 10, ptr nonnull [[NT]]) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[COLD]])
%call = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_ZnamRKSt9nothrow_t(i64 10, ptr nonnull %nt)
%call1 = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[HOT]])
%call2 = call ptr @_ZnamRKSt9nothrow_t(i64 10, ptr %nt) #2
call void @dummy(ptr %call2)
ret void
@@ -166,19 +204,25 @@ define void @array_new_nothrow() {
;; converted to
;; operator new[](unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
;; with a hot or cold attribute.
-; HOTCOLD-LABEL: @array_new_align_nothrow()
define void @array_new_align_nothrow() {
+; OFF-LABEL: define void @array_new_align_nothrow() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull [[NT]]) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull [[NT]]) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull [[NT]]) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[COLD]])
%call = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #0
call void @dummy(ptr %call)
;; Attribute notcold has no effect.
- ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr nonnull %nt)
%call1 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[HOT]])
%call2 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t(i64 10, i64 8, ptr %nt) #2
call void @dummy(ptr %call2)
ret void
@@ -186,18 +230,23 @@ define void @array_new_align_nothrow() {
;; Check that operator new(unsigned long, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @new_hot_cold()
define void @new_hot_cold() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTCOLD]])
+; OFF-LABEL: define void @new_hot_cold() {
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_Znwm12__hot_cold_t(i64 10, i8 [[PREVHINTHOT]])
%call2 = call ptr @_Znwm12__hot_cold_t(i64 10, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -205,18 +254,23 @@ define void @new_hot_cold() {
;; Check that operator new(unsigned long, std::align_val_t, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @new_align_hot_cold()
define void @new_align_hot_cold() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTCOLD]])
+; OFF-LABEL: define void @new_align_hot_cold() {
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTHOT]])
%call2 = call ptr @_ZnwmSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -224,19 +278,25 @@ define void @new_align_hot_cold() {
;; Check that operator new(unsigned long, const std::nothrow_t&, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @new_nothrow_hot_cold()
define void @new_nothrow_hot_cold() {
+; OFF-LABEL: define void @new_nothrow_hot_cold() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull [[NT]], i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull [[NT]], i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull [[NT]], i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTCOLD]])
%call = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTHOT]])
%call2 = call ptr @_ZnwmRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -244,19 +304,25 @@ define void @new_nothrow_hot_cold() {
;; Check that operator new(unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @new_align_nothrow_hot_cold()
define void @new_align_nothrow_hot_cold() {
+; OFF-LABEL: define void @new_align_nothrow_hot_cold() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull [[NT]], i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull [[NT]], i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull [[NT]], i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTCOLD]])
%call = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTHOT]])
%call2 = call ptr @_ZnwmSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -264,18 +330,23 @@ define void @new_align_nothrow_hot_cold() {
;; Check that operator new[](unsigned long, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @array_new_hot_cold()
define void @array_new_hot_cold() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTCOLD]])
+; OFF-LABEL: define void @array_new_hot_cold() {
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_Znam12__hot_cold_t(i64 10, i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_Znam12__hot_cold_t(i64 10, i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_Znam12__hot_cold_t(i64 10, i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_Znam12__hot_cold_t(i64 10, i8 [[PREVHINTHOT]])
%call2 = call ptr @_Znam12__hot_cold_t(i64 10, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -283,18 +354,23 @@ define void @array_new_hot_cold() {
;; Check that operator new[](unsigned long, std::align_val_t, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @array_new_align_hot_cold()
define void @array_new_align_hot_cold() {
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTCOLD]])
+; OFF-LABEL: define void @array_new_align_hot_cold() {
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%call = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 [[PREVHINTHOT]])
%call2 = call ptr @_ZnamSt11align_val_t12__hot_cold_t(i64 10, i64 8, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -302,19 +378,25 @@ define void @array_new_align_hot_cold() {
;; Check that operator new[](unsigned long, const std::nothrow_t&, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @array_new_nothrow_hot_cold()
define void @array_new_nothrow_hot_cold() {
+; OFF-LABEL: define void @array_new_nothrow_hot_cold() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call dereferenceable_or_null(10) ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull [[NT]], i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call dereferenceable_or_null(10) ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull [[NT]], i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call dereferenceable_or_null(10) ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull [[NT]], i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTCOLD]])
%call = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr nonnull %nt, i8 [[PREVHINTHOT]])
%call2 = call ptr @_ZnamRKSt9nothrow_t12__hot_cold_t(i64 10, ptr %nt, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -322,19 +404,25 @@ define void @array_new_nothrow_hot_cold() {
;; Check that operator new[](unsigned long, std::align_val_t, const std::nothrow_t&, __hot_cold_t)
;; optionally has its hint updated.
-; HOTCOLD-LABEL: @array_new_align_nothrow_hot_cold()
define void @array_new_align_nothrow_hot_cold() {
+; OFF-LABEL: define void @array_new_align_nothrow_hot_cold() {
+; OFF-NEXT: [[NT:%.*]] = alloca i8, align 1
+; OFF-NEXT: [[CALL:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull [[NT]], i8 7) #[[ATTR0]]
+; OFF-NEXT: call void @dummy(ptr [[CALL]])
+; OFF-NEXT: [[CALL1:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull [[NT]], i8 7) #[[ATTR1]]
+; OFF-NEXT: call void @dummy(ptr [[CALL1]])
+; OFF-NEXT: [[CALL2:%.*]] = call align 8 dereferenceable_or_null(10) ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull [[NT]], i8 7) #[[ATTR2]]
+; OFF-NEXT: call void @dummy(ptr [[CALL2]])
+; OFF-NEXT: ret void
+;
%nt = alloca i8
;; Attribute cold converted to __hot_cold_t cold value.
- ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTCOLD]])
%call = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #0
call void @dummy(ptr %call)
;; Attribute notcold converted to __hot_cold_t notcold value.
- ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTNOTCOLD]])
%call1 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #1
call void @dummy(ptr %call1)
;; Attribute hot converted to __hot_cold_t hot value.
- ; HOTCOLD: @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr nonnull %nt, i8 [[PREVHINTHOT]])
%call2 = call ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64 10, i64 8, ptr %nt, i8 7) #2
call void @dummy(ptr %call2)
ret void
@@ -363,3 +451,5 @@ declare ptr @_ZnamSt11align_val_tRKSt9nothrow_t12__hot_cold_t(i64, i64, ptr, i8)
attributes #0 = { builtin allocsize(0) "memprof"="cold" }
attributes #1 = { builtin allocsize(0) "memprof"="notcold" }
attributes #2 = { builtin allocsize(0) "memprof"="hot" }
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; HOTCOLD: {{.*}}
diff --git a/llvm/test/Transforms/InstCombine/sink-alloca.ll b/llvm/test/Transforms/InstCombine/sink-alloca.ll
index f04771c289813..9c7620f5b2951 100644
--- a/llvm/test/Transforms/InstCombine/sink-alloca.ll
+++ b/llvm/test/Transforms/InstCombine/sink-alloca.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S < %s | FileCheck %s
target datalayout = "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128"
@@ -15,6 +16,25 @@ declare ptr @llvm.stacksave() #0
declare void @llvm.stackrestore(ptr) #0
define void @foo(i32 %x) {
+; CHECK-LABEL: define void @foo(
+; CHECK-SAME: i32 [[X:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[C1:%.*]] = call i1 @cond()
+; CHECK-NEXT: br i1 [[C1]], label %[[RET:.*]], label %[[NONENTRY:.*]]
+; CHECK: [[NONENTRY]]:
+; CHECK-NEXT: [[ARGMEM:%.*]] = alloca i32, i32 [[X]], align 4
+; CHECK-NEXT: [[SP:%.*]] = call ptr @llvm.stacksave.p0()
+; CHECK-NEXT: [[C2:%.*]] = call i1 @cond()
+; CHECK-NEXT: br i1 [[C2]], label %[[RET]], label %[[SINKTARGET:.*]]
+; CHECK: [[SINKTARGET]]:
+; CHECK-NEXT: [[P:%.*]] = call ptr @use_and_return(ptr nonnull [[ARGMEM]])
+; CHECK-NEXT: store i32 13, ptr [[P]], align 4
+; CHECK-NEXT: call void @llvm.stackrestore.p0(ptr [[SP]])
+; CHECK-NEXT: [[TMP0:%.*]] = call ptr @use_and_return(ptr nonnull [[P]])
+; CHECK-NEXT: br label %[[RET]]
+; CHECK: [[RET]]:
+; CHECK-NEXT: ret void
+;
entry:
%c1 = call i1 @cond()
br i1 %c1, label %ret, label %nonentry
@@ -37,16 +57,5 @@ ret: ; preds = %sinktarget, %nonent
ret void
}
-; CHECK-LABEL: define void @foo(i32 %x)
-; CHECK: nonentry:
-; CHECK: %argmem = alloca i32, i32 %x
-; CHECK: %sp = call ptr @llvm.stacksave.p0()
-; CHECK: %c2 = call i1 @cond()
-; CHECK: br i1 %c2, label %ret, label %sinktarget
-; CHECK: sinktarget:
-; CHECK: %p = call ptr @use_and_return(ptr nonnull %argmem)
-; CHECK: store i32 13, ptr %p
-; CHECK: call void @llvm.stackrestore.p0(ptr %sp)
-; CHECK: %0 = call ptr @use_and_return(ptr nonnull %p)
attributes #0 = { nounwind }
diff --git a/llvm/test/Transforms/InstCombine/sink-instruction-introduces-unnecessary-poison-value.ll b/llvm/test/Transforms/InstCombine/sink-instruction-introduces-unnecessary-poison-value.ll
index b48e5795b7181..0b9a36b6210eb 100644
--- a/llvm/test/Transforms/InstCombine/sink-instruction-introduces-unnecessary-poison-value.ll
+++ b/llvm/test/Transforms/InstCombine/sink-instruction-introduces-unnecessary-poison-value.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine -S -o - < %s | FileCheck %s
; RUN: opt -passes=instcombine -S -o - < %s --try-experimental-debuginfo-iterators | FileCheck %s
@@ -21,11 +22,6 @@
; 15 }
; CHECK-LABEL: sw.bb:
-; CHECK: %[[REG:[0-9]+]] = load i32, ptr @"?Two{{.*}}
-; CHECK: #dbg_value(i32 %[[REG]], ![[DBG1:[0-9]+]], {{.*}}
-; CHECK: #dbg_value(i32 %[[REG]], ![[DBG2:[0-9]+]], {{.*}}
-; CHECK-DAG: ![[DBG1]] = !DILocalVariable(name: "Four"{{.*}})
-; CHECK-DAG: ![[DBG2]] = !DILocalVariable(name: "Three"{{.*}})
@"?One@@3HA" = dso_local global i32 0, align 4, !dbg !0
@"?Two@@3HA" = dso_local global i32 0, align 4, !dbg !5
@@ -37,8 +33,8 @@ entry:
call void @llvm.dbg.value(metadata i32 %0, metadata !22, metadata !DIExpression()), !dbg !20
%1 = load i32, ptr @"?One@@3HA", align 4, !dbg !23
switch i32 %1, label %sw.epilog [
- i32 0, label %sw.bb
- i32 2, label %sw.bb1
+ i32 0, label %sw.bb
+ i32 2, label %sw.bb1
], !dbg !23
sw.bb: ; preds = %entry
@@ -90,3 +86,5 @@ declare void @llvm.dbg.value(metadata, metadata, metadata)
!25 = distinct !DILexicalBlock(scope: !15, file: !3, line: 6)
!26 = !DILocation(line: 12, scope: !25)
!27 = !DILocation(line: 14, scope: !15)
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; CHECK: {{.*}}
diff --git a/llvm/test/Transforms/InstCombine/sink-into-catchswitch.ll b/llvm/test/Transforms/InstCombine/sink-into-catchswitch.ll
index 0e4c3f9205831..a86f1ebad930e 100644
--- a/llvm/test/Transforms/InstCombine/sink-into-catchswitch.ll
+++ b/llvm/test/Transforms/InstCombine/sink-into-catchswitch.ll
@@ -12,13 +12,13 @@ define void @test1(ptr %p) personality ptr @__CxxFrameHandler3 {
; CHECK-NEXT: [[TMP0:%.*]] = load <2 x i64>, ptr [[P:%.*]], align 8
; CHECK-NEXT: [[TMP1:%.*]] = extractelement <2 x i64> [[TMP0]], i64 0
; CHECK-NEXT: invoke void @throw()
-; CHECK-NEXT: to label [[UNREACHABLE:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
+; CHECK-NEXT: to label [[UNREACHABLE:%.*]] unwind label [[CATCH_DISPATCH:%.*]]
; CHECK: catch.dispatch:
; CHECK-NEXT: [[CS:%.*]] = catchswitch within none [label %invoke.cont1] unwind label [[EHCLEANUP:%.*]]
; CHECK: invoke.cont1:
; CHECK-NEXT: [[CATCH:%.*]] = catchpad within [[CS]] [ptr null, i32 64, ptr null]
; CHECK-NEXT: invoke void @throw() [ "funclet"(token [[CATCH]]) ]
-; CHECK-NEXT: to label [[UNREACHABLE]] unwind label [[EHCLEANUP]]
+; CHECK-NEXT: to label [[UNREACHABLE]] unwind label [[EHCLEANUP]]
; CHECK: ehcleanup:
; CHECK-NEXT: [[PHI:%.*]] = phi i64 [ [[TMP1]], [[CATCH_DISPATCH]] ], [ 9, [[INVOKE_CONT1:%.*]] ]
; CHECK-NEXT: [[CLEANUP:%.*]] = cleanuppad within none []
diff --git a/llvm/test/Transforms/InstCombine/sink-into-resume-block.ll b/llvm/test/Transforms/InstCombine/sink-into-resume-block.ll
index 39cf1255d47aa..c1b352e17efba 100644
--- a/llvm/test/Transforms/InstCombine/sink-into-resume-block.ll
+++ b/llvm/test/Transforms/InstCombine/sink-into-resume-block.ll
@@ -10,12 +10,12 @@ define void @t0_noop(i32 %arg) personality ptr @__gxx_personality_v0 {
; CHECK-NEXT: br i1 [[C]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: invoke void @simple_throw()
-; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]]
+; CHECK-NEXT: to label [[INVOKE_CONT:%.*]] unwind label [[LPAD:%.*]]
; CHECK: invoke.cont:
; CHECK-NEXT: unreachable
; CHECK: lpad:
; CHECK-NEXT: [[EH:%.*]] = landingpad { ptr, i32 }
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: [[V0:%.*]] = add i32 [[ARG:%.*]], 42
; CHECK-NEXT: call void @consume(i32 [[V0]])
; CHECK-NEXT: call void @destructor()
diff --git a/llvm/test/Transforms/InstCombine/sink-not-into-logical-and.ll b/llvm/test/Transforms/InstCombine/sink-not-into-logical-and.ll
index 8998be562abb9..2286e60670b97 100644
--- a/llvm/test/Transforms/InstCombine/sink-not-into-logical-and.ll
+++ b/llvm/test/Transforms/InstCombine/sink-not-into-logical-and.ll
@@ -211,10 +211,10 @@ define i1 @PR59704(i1 %c, i1 %b, i64 %arg) {
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[C:%.*]], label [[IF:%.*]], label [[JOIN:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP_NOT:%.*]] = icmp eq i64 [[ARG:%.*]], 0
+; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[ARG:%.*]], 0
; CHECK-NEXT: br label [[JOIN]]
; CHECK: join:
-; CHECK-NEXT: [[PHI:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[CMP_NOT]], [[IF]] ]
+; CHECK-NEXT: [[PHI:%.*]] = phi i1 [ true, [[ENTRY:%.*]] ], [ [[CMP]], [[IF]] ]
; CHECK-NEXT: ret i1 [[PHI]]
;
entry:
diff --git a/llvm/test/Transforms/InstCombine/sink_instruction.ll b/llvm/test/Transforms/InstCombine/sink_instruction.ll
index c938002788bc2..4a31ffd62fe36 100644
--- a/llvm/test/Transforms/InstCombine/sink_instruction.ll
+++ b/llvm/test/Transforms/InstCombine/sink_instruction.ll
@@ -86,8 +86,8 @@ define i32 @test3(ptr nocapture readonly %P, i32 %i) {
; CHECK-LABEL: @test3(
; CHECK-NEXT: entry:
; CHECK-NEXT: switch i32 [[I:%.*]], label [[SW_EPILOG:%.*]] [
-; CHECK-NEXT: i32 5, label [[SW_BB:%.*]]
-; CHECK-NEXT: i32 2, label [[SW_BB]]
+; CHECK-NEXT: i32 5, label [[SW_BB:%.*]]
+; CHECK-NEXT: i32 2, label [[SW_BB]]
; CHECK-NEXT: ]
; CHECK: sw.bb:
; CHECK-NEXT: [[IDXPROM:%.*]] = sext i32 [[I]] to i64
@@ -190,8 +190,8 @@ define i32 @test6(ptr nocapture readonly %P, i32 %i, i1 %cond) {
; CHECK-NEXT: [[ARRAYIDX:%.*]] = getelementptr inbounds i32, ptr [[P:%.*]], i64 [[IDXPROM]]
; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[ARRAYIDX]], align 4
; CHECK-NEXT: switch i32 [[I]], label [[SW_BB:%.*]] [
-; CHECK-NEXT: i32 5, label [[SW_EPILOG:%.*]]
-; CHECK-NEXT: i32 2, label [[SW_EPILOG]]
+; CHECK-NEXT: i32 5, label [[SW_EPILOG:%.*]]
+; CHECK-NEXT: i32 2, label [[SW_EPILOG]]
; CHECK-NEXT: ]
; CHECK: sw.bb:
; CHECK-NEXT: br label [[SW_EPILOG]]
diff --git a/llvm/test/Transforms/InstCombine/sitofp.ll b/llvm/test/Transforms/InstCombine/sitofp.ll
index 51eff39cd900e..194fae56ee598 100644
--- a/llvm/test/Transforms/InstCombine/sitofp.ll
+++ b/llvm/test/Transforms/InstCombine/sitofp.ll
@@ -51,8 +51,8 @@ define i32 @test5(i32 %A) {
define i32 @test6(i32 %A) {
; CHECK-LABEL: @test6(
-; CHECK-NEXT: [[ADDCONV:%.*]] = and i32 [[A:%.*]], 39
-; CHECK-NEXT: ret i32 [[ADDCONV]]
+; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[A:%.*]], 39
+; CHECK-NEXT: ret i32 [[TMP1]]
;
%B = and i32 %A, 7
%C = and i32 %A, 32
diff --git a/llvm/test/Transforms/InstCombine/srem-simplify-bug.ll b/llvm/test/Transforms/InstCombine/srem-simplify-bug.ll
index 4a5833a58066f..5b9a1c6d7d0da 100644
--- a/llvm/test/Transforms/InstCombine/srem-simplify-bug.ll
+++ b/llvm/test/Transforms/InstCombine/srem-simplify-bug.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep "ret i1 false"
; PR2276
diff --git a/llvm/test/Transforms/InstCombine/srem1.ll b/llvm/test/Transforms/InstCombine/srem1.ll
index eddf2296ae3a6..2725d4826e78c 100644
--- a/llvm/test/Transforms/InstCombine/srem1.ll
+++ b/llvm/test/Transforms/InstCombine/srem1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine
; PR2670
@@ -5,14 +6,14 @@
define i32 @func_56(i32 %p_58, i32 %p_59, i32 %p_61, i16 signext %p_62) nounwind {
entry:
- %call = call i32 (...) @rshift_s_s( i32 %p_61, i32 1 ) ; <i32> [#uses=1]
- %conv = sext i32 %call to i64 ; <i64> [#uses=1]
- %or = or i64 -1734012817166602727, %conv ; <i64> [#uses=1]
- %rem = srem i64 %or, 1 ; <i64> [#uses=1]
- %cmp = icmp eq i64 %rem, 1 ; <i1> [#uses=1]
- %cmp.ext = zext i1 %cmp to i32 ; <i32> [#uses=1]
- store i32 %cmp.ext, ptr @g_127
- ret i32 undef
+ %call = call i32 (...) @rshift_s_s( i32 %p_61, i32 1 ) ; <i32> [#uses=1]
+ %conv = sext i32 %call to i64 ; <i64> [#uses=1]
+ %or = or i64 -1734012817166602727, %conv ; <i64> [#uses=1]
+ %rem = srem i64 %or, 1 ; <i64> [#uses=1]
+ %cmp = icmp eq i64 %rem, 1 ; <i1> [#uses=1]
+ %cmp.ext = zext i1 %cmp to i32 ; <i32> [#uses=1]
+ store i32 %cmp.ext, ptr @g_127
+ ret i32 undef
}
declare i32 @rshift_s_s(...)
diff --git a/llvm/test/Transforms/InstCombine/stack-overalign.ll b/llvm/test/Transforms/InstCombine/stack-overalign.ll
index 92663a0d095a3..7b1cc334ea57a 100644
--- a/llvm/test/Transforms/InstCombine/stack-overalign.ll
+++ b/llvm/test/Transforms/InstCombine/stack-overalign.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | grep "align 32" | count 2
; It's tempting to have an instcombine in which the src pointer of a
diff --git a/llvm/test/Transforms/InstCombine/stacksaverestore.ll b/llvm/test/Transforms/InstCombine/stacksaverestore.ll
index daba3c24e9433..82a53e47548ba 100644
--- a/llvm/test/Transforms/InstCombine/stacksaverestore.ll
+++ b/llvm/test/Transforms/InstCombine/stacksaverestore.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@glob = global i32 0
@@ -7,74 +8,119 @@ declare void @llvm.stackrestore(ptr)
;; Test that llvm.stackrestore is removed when possible.
define ptr @test1(i32 %P) {
- %tmp = call ptr @llvm.stacksave( )
- call void @llvm.stackrestore( ptr %tmp ) ;; not restoring anything
- %A = alloca i32, i32 %P
- ret ptr %A
+; CHECK-LABEL: define ptr @test1(
+; CHECK-SAME: i32 [[P:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = zext i32 [[P]] to i64
+; CHECK-NEXT: [[A:%.*]] = alloca i32, i64 [[TMP1]], align 4
+; CHECK-NEXT: ret ptr [[A]]
+;
+ %tmp = call ptr @llvm.stacksave( )
+ call void @llvm.stackrestore( ptr %tmp ) ;; not restoring anything
+ %A = alloca i32, i32 %P
+ ret ptr %A
}
-; CHECK-LABEL: define ptr @test1(
-; CHECK-NOT: call void @llvm.stackrestore
-; CHECK: ret ptr
define void @test2(ptr %X) {
- call void @llvm.stackrestore( ptr %X ) ;; no allocas before return.
- ret void
+; CHECK-LABEL: define void @test2(
+; CHECK-SAME: ptr [[X:%.*]]) {
+; CHECK-NEXT: ret void
+;
+ call void @llvm.stackrestore( ptr %X ) ;; no allocas before return.
+ ret void
}
-; CHECK-LABEL: define void @test2(
-; CHECK-NOT: call void @llvm.stackrestore
-; CHECK: ret void
define void @foo(i32 %size) nounwind {
+; CHECK-LABEL: define void @foo(
+; CHECK-SAME: i32 [[SIZE:%.*]]) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: [[TMP118124:%.*]] = icmp sgt i32 [[SIZE]], 0
+; CHECK-NEXT: br i1 [[TMP118124]], label %[[BB_PREHEADER:.*]], label %[[RETURN:.*]]
+; CHECK: [[BB_PREHEADER]]:
+; CHECK-NEXT: br label %[[BB:.*]]
+; CHECK: [[BB]]:
+; CHECK-NEXT: [[I_0_REG2MEM_0:%.*]] = phi i32 [ 0, %[[BB_PREHEADER]] ], [ [[INDVAR_NEXT:%.*]], %[[BB]] ]
+; CHECK-NEXT: [[TMP:%.*]] = call ptr @llvm.stacksave.p0()
+; CHECK-NEXT: [[TMP0:%.*]] = zext nneg i32 [[SIZE]] to i64
+; CHECK-NEXT: [[TMP23:%.*]] = alloca i8, i64 [[TMP0]], align 1
+; CHECK-NEXT: [[TMP1:%.*]] = zext nneg i32 [[SIZE]] to i64
+; CHECK-NEXT: [[TMP2:%.*]] = getelementptr i8, ptr [[TMP23]], i64 [[TMP1]]
+; CHECK-NEXT: [[TMP27:%.*]] = getelementptr i8, ptr [[TMP2]], i64 -1
+; CHECK-NEXT: store i8 0, ptr [[TMP27]], align 1
+; CHECK-NEXT: [[TMP3:%.*]] = zext nneg i32 [[SIZE]] to i64
+; CHECK-NEXT: [[TMP52:%.*]] = alloca i8, i64 [[TMP3]], align 1
+; CHECK-NEXT: [[TMP4:%.*]] = zext nneg i32 [[SIZE]] to i64
+; CHECK-NEXT: [[TMP77:%.*]] = alloca i8, i64 [[TMP4]], align 1
+; CHECK-NEXT: [[TMP5:%.*]] = zext nneg i32 [[SIZE]] to i64
+; CHECK-NEXT: [[TMP102:%.*]] = alloca i8, i64 [[TMP5]], align 1
+; CHECK-NEXT: call void @bar(i32 [[I_0_REG2MEM_0]], ptr nonnull [[TMP23]], ptr nonnull [[TMP52]], ptr nonnull [[TMP77]], ptr nonnull [[TMP102]], i32 [[SIZE]]) #[[ATTR0]]
+; CHECK-NEXT: call void @llvm.stackrestore.p0(ptr [[TMP]])
+; CHECK-NEXT: [[INDVAR_NEXT]] = add i32 [[I_0_REG2MEM_0]], 1
+; CHECK-NEXT: [[EXITCOND:%.*]] = icmp eq i32 [[INDVAR_NEXT]], [[SIZE]]
+; CHECK-NEXT: br i1 [[EXITCOND]], label %[[RETURN]], label %[[BB]]
+; CHECK: [[RETURN]]:
+; CHECK-NEXT: ret void
+;
entry:
- %tmp118124 = icmp sgt i32 %size, 0 ; <i1> [#uses=1]
- br i1 %tmp118124, label %bb.preheader, label %return
+ %tmp118124 = icmp sgt i32 %size, 0 ; <i1> [#uses=1]
+ br i1 %tmp118124, label %bb.preheader, label %return
bb.preheader: ; preds = %entry
- %tmp25 = add i32 %size, -1 ; <i32> [#uses=1]
- %tmp125 = icmp slt i32 %size, 1 ; <i1> [#uses=1]
- %smax = select i1 %tmp125, i32 1, i32 %size ; <i32> [#uses=1]
- br label %bb
+ %tmp25 = add i32 %size, -1 ; <i32> [#uses=1]
+ %tmp125 = icmp slt i32 %size, 1 ; <i1> [#uses=1]
+ %smax = select i1 %tmp125, i32 1, i32 %size ; <i32> [#uses=1]
+ br label %bb
bb: ; preds = %bb, %bb.preheader
- %i.0.reg2mem.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
- %tmp = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
- %tmp23 = alloca i8, i32 %size ; <ptr> [#uses=2]
- %tmp27 = getelementptr i8, ptr %tmp23, i32 %tmp25 ; <ptr> [#uses=1]
- store i8 0, ptr %tmp27, align 1
- %tmp28 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
- %tmp52 = alloca i8, i32 %size ; <ptr> [#uses=1]
- %tmp53 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
- %tmp77 = alloca i8, i32 %size ; <ptr> [#uses=1]
- %tmp78 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
- %tmp102 = alloca i8, i32 %size ; <ptr> [#uses=1]
- call void @bar( i32 %i.0.reg2mem.0, ptr %tmp23, ptr %tmp52, ptr %tmp77, ptr %tmp102, i32 %size ) nounwind
- call void @llvm.stackrestore( ptr %tmp78 )
- call void @llvm.stackrestore( ptr %tmp53 )
- call void @llvm.stackrestore( ptr %tmp28 )
- call void @llvm.stackrestore( ptr %tmp )
- %indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
- %exitcond = icmp eq i32 %indvar.next, %smax ; <i1> [#uses=1]
- br i1 %exitcond, label %return, label %bb
+ %i.0.reg2mem.0 = phi i32 [ 0, %bb.preheader ], [ %indvar.next, %bb ] ; <i32> [#uses=2]
+ %tmp = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
+ %tmp23 = alloca i8, i32 %size ; <ptr> [#uses=2]
+ %tmp27 = getelementptr i8, ptr %tmp23, i32 %tmp25 ; <ptr> [#uses=1]
+ store i8 0, ptr %tmp27, align 1
+ %tmp28 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
+ %tmp52 = alloca i8, i32 %size ; <ptr> [#uses=1]
+ %tmp53 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
+ %tmp77 = alloca i8, i32 %size ; <ptr> [#uses=1]
+ %tmp78 = call ptr @llvm.stacksave( ) ; <ptr> [#uses=1]
+ %tmp102 = alloca i8, i32 %size ; <ptr> [#uses=1]
+ call void @bar( i32 %i.0.reg2mem.0, ptr %tmp23, ptr %tmp52, ptr %tmp77, ptr %tmp102, i32 %size ) nounwind
+ call void @llvm.stackrestore( ptr %tmp78 )
+ call void @llvm.stackrestore( ptr %tmp53 )
+ call void @llvm.stackrestore( ptr %tmp28 )
+ call void @llvm.stackrestore( ptr %tmp )
+ %indvar.next = add i32 %i.0.reg2mem.0, 1 ; <i32> [#uses=2]
+ %exitcond = icmp eq i32 %indvar.next, %smax ; <i1> [#uses=1]
+ br i1 %exitcond, label %return, label %bb
return: ; preds = %bb, %entry
- ret void
+ ret void
}
-; CHECK-LABEL: define void @foo(
-; CHECK: %tmp = call ptr @llvm.stacksave.p0()
-; CHECK: alloca i8
-; CHECK-NOT: stacksave
-; CHECK: call void @bar(
-; CHECK-NEXT: call void @llvm.stackrestore.p0(ptr %tmp)
-; CHECK: ret void
declare void @bar(i32, ptr, ptr, ptr, ptr, i32)
declare void @inalloca_callee(ptr inalloca(i32))
define void @test3(i32 %c) {
+; CHECK-LABEL: define void @test3(
+; CHECK-SAME: i32 [[C:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: br label %[[LOOP:.*]]
+; CHECK: [[LOOP]]:
+; CHECK-NEXT: [[I:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[I1:%.*]], %[[LOOP]] ]
+; CHECK-NEXT: [[SAVE1:%.*]] = call ptr @llvm.stacksave.p0()
+; CHECK-NEXT: [[ARGMEM:%.*]] = alloca inalloca i32, align 4
+; CHECK-NEXT: store i32 0, ptr [[ARGMEM]], align 4
+; CHECK-NEXT: call void @inalloca_callee(ptr nonnull inalloca(i32) [[ARGMEM]])
+; CHECK-NEXT: call void @llvm.stackrestore.p0(ptr [[SAVE1]])
+; CHECK-NEXT: store i32 0, ptr @glob, align 4
+; CHECK-NEXT: [[I1]] = add i32 [[I]], 1
+; CHECK-NEXT: [[DONE:%.*]] = icmp eq i32 [[I1]], [[C]]
+; CHECK-NEXT: br i1 [[DONE]], label %[[LOOP]], label %[[RETURN:.*]]
+; CHECK: [[RETURN]]:
+; CHECK-NEXT: ret void
+;
entry:
br label %loop
@@ -100,18 +146,27 @@ return:
ret void
}
-; CHECK-LABEL: define void @test3(
-; CHECK: loop:
-; CHECK: %i = phi i32 [ 0, %entry ], [ %i1, %loop ]
-; CHECK: %save1 = call ptr @llvm.stacksave.p0()
-; CHECK: %argmem = alloca inalloca i32
-; CHECK: store i32 0, ptr %argmem
-; CHECK: call void @inalloca_callee(ptr {{.*}} inalloca(i32) %argmem)
-; CHECK: call void @llvm.stackrestore.p0(ptr %save1)
-; CHECK: br i1 %done, label %loop, label %return
-; CHECK: ret void
define i32 @test4(i32 %m, ptr %a, ptr %b) {
+; CHECK-LABEL: define i32 @test4(
+; CHECK-SAME: i32 [[M:%.*]], ptr [[A:%.*]], ptr [[B:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*]]:
+; CHECK-NEXT: br label %[[FOR_BODY:.*]]
+; CHECK: [[FOR_BODY]]:
+; CHECK-NEXT: [[X_012:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[ADD2:%.*]], %[[FOR_BODY]] ]
+; CHECK-NEXT: [[I_011:%.*]] = phi i32 [ 0, %[[ENTRY]] ], [ [[INC:%.*]], %[[FOR_BODY]] ]
+; CHECK-NEXT: [[LOAD1:%.*]] = load i32, ptr [[A]], align 4
+; CHECK-NEXT: [[MUL1:%.*]] = mul nsw i32 [[LOAD1]], [[M]]
+; CHECK-NEXT: [[ADD1:%.*]] = add nsw i32 [[MUL1]], [[X_012]]
+; CHECK-NEXT: [[LOAD2:%.*]] = load i32, ptr [[B]], align 4
+; CHECK-NEXT: [[MUL2:%.*]] = mul nsw i32 [[LOAD2]], [[M]]
+; CHECK-NEXT: [[ADD2]] = add nsw i32 [[MUL2]], [[ADD1]]
+; CHECK-NEXT: [[INC]] = add nuw nsw i32 [[I_011]], 1
+; CHECK-NEXT: [[EXITCOND_NOT:%.*]] = icmp eq i32 [[INC]], 100
+; CHECK-NEXT: br i1 [[EXITCOND_NOT]], label %[[FOR_COND_CLEANUP:.*]], label %[[FOR_BODY]]
+; CHECK: [[FOR_COND_CLEANUP]]:
+; CHECK-NEXT: ret i32 [[ADD2]]
+;
entry:
br label %for.body
@@ -135,6 +190,3 @@ for.cond.cleanup:
ret i32 %add2
}
-; CHECK-LABEL: define i32 @test4(
-; CHECK-NOT: call void @llvm.stackrestore
-; CHECK: ret i32 %add2
diff --git a/llvm/test/Transforms/InstCombine/statepoint-cleanup.ll b/llvm/test/Transforms/InstCombine/statepoint-cleanup.ll
index 95906f0f456d6..43d002f3e604c 100644
--- a/llvm/test/Transforms/InstCombine/statepoint-cleanup.ll
+++ b/llvm/test/Transforms/InstCombine/statepoint-cleanup.ll
@@ -92,7 +92,7 @@ define void @test_invoke(ptr addrspace(1) %b) gc "statepoint-example" personalit
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = getelementptr i8, ptr addrspace(1) [[B:%.*]], i64 64
; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) [[B]], ptr addrspace(1) [[D]]) ]
-; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
; CHECK: normal_dest:
; CHECK-NEXT: [[B_NEW_1:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
; CHECK-NEXT: [[B_NEW_2:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
@@ -109,7 +109,7 @@ define void @test_invoke(ptr addrspace(1) %b) gc "statepoint-example" personalit
; CHECK-NEXT: ret void
; CHECK: unwind_dest:
; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: [[LPB_NEW_1:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[LPAD]], i32 0, i32 0)
; CHECK-NEXT: [[LPB_NEW_2:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[LPAD]], i32 0, i32 0)
; CHECK-NEXT: [[LPD_NEW_1:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[LPAD]], i32 0, i32 1)
@@ -166,14 +166,14 @@ define void @test_no_derived_use_invoke(ptr addrspace(1) %b) gc "statepoint-exam
; CHECK-LABEL: @test_no_derived_use_invoke(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) [[B:%.*]]) ]
-; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
; CHECK: normal_dest:
; CHECK-NEXT: [[B_NEW_1:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
; CHECK-NEXT: store i32 1, ptr addrspace(1) [[B_NEW_1]], align 4
; CHECK-NEXT: ret void
; CHECK: unwind_dest:
; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: [[LPB_NEW_1:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[LPAD]], i32 0, i32 0)
; CHECK-NEXT: store i32 2, ptr addrspace(1) [[LPB_NEW_1]], align 4
; CHECK-NEXT: ret void
@@ -211,14 +211,14 @@ define void @test_no_base_use_invoke(ptr addrspace(1) %b) gc "statepoint-example
; CHECK-NEXT: entry:
; CHECK-NEXT: [[D:%.*]] = getelementptr i8, ptr addrspace(1) [[B:%.*]], i64 64
; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) [[B]], ptr addrspace(1) [[D]]) ]
-; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
; CHECK: normal_dest:
; CHECK-NEXT: [[D_NEW_1:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 1)
; CHECK-NEXT: store i32 1, ptr addrspace(1) [[D_NEW_1]], align 4
; CHECK-NEXT: ret void
; CHECK: unwind_dest:
; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: [[LPD_NEW_1:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[LPAD]], i32 0, i32 1)
; CHECK-NEXT: store i32 2, ptr addrspace(1) [[LPD_NEW_1]], align 4
; CHECK-NEXT: ret void
diff --git a/llvm/test/Transforms/InstCombine/statepoint.ll b/llvm/test/Transforms/InstCombine/statepoint.ll
index 29cdc35cc64ef..47c954bfbf10d 100644
--- a/llvm/test/Transforms/InstCombine/statepoint.ll
+++ b/llvm/test/Transforms/InstCombine/statepoint.ll
@@ -65,14 +65,14 @@ define i1 @test_negative_invoke(ptr addrspace(1) %p) gc "statepoint-example" per
; CHECK-LABEL: @test_negative_invoke(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"(ptr addrspace(1) [[P:%.*]]) ]
-; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
; CHECK: normal_dest:
; CHECK-NEXT: [[PNEW:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[SAFEPOINT_TOKEN]], i32 0, i32 0)
; CHECK-NEXT: [[CMP:%.*]] = icmp eq ptr addrspace(1) [[PNEW]], null
; CHECK-NEXT: ret i1 [[CMP]]
; CHECK: unwind_dest:
; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: [[PNEW2:%.*]] = call ptr addrspace(1) @llvm.experimental.gc.relocate.p1(token [[LPAD]], i32 0, i32 0)
; CHECK-NEXT: [[CMP2:%.*]] = icmp ne ptr addrspace(1) [[PNEW2]], null
; CHECK-NEXT: ret i1 [[CMP2]]
@@ -97,12 +97,12 @@ define i1 @test_nonnull_invoke(ptr addrspace(1) nonnull %p) gc "statepoint-examp
; CHECK-LABEL: @test_nonnull_invoke(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
-; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
; CHECK: normal_dest:
; CHECK-NEXT: ret i1 false
; CHECK: unwind_dest:
; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: ret i1 true
;
entry:
@@ -125,12 +125,12 @@ define i1 @test_null_invoke() gc "statepoint-example" personality ptr @fake_pers
; CHECK-LABEL: @test_null_invoke(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
-; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
; CHECK: normal_dest:
; CHECK-NEXT: ret i1 true
; CHECK: unwind_dest:
; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: ret i1 false
;
entry:
@@ -153,12 +153,12 @@ define i1 @test_undef_invoke() gc "statepoint-example" personality ptr @fake_per
; CHECK-LABEL: @test_undef_invoke(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SAFEPOINT_TOKEN:%.*]] = invoke token (i64, i32, ptr, i32, i32, ...) @llvm.experimental.gc.statepoint.p0(i64 0, i32 0, ptr nonnull elementtype(void ()) @func, i32 0, i32 0, i32 0, i32 0) [ "gc-live"() ]
-; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
+; CHECK-NEXT: to label [[NORMAL_DEST:%.*]] unwind label [[UNWIND_DEST:%.*]]
; CHECK: normal_dest:
; CHECK-NEXT: ret i1 undef
; CHECK: unwind_dest:
; CHECK-NEXT: [[LPAD:%.*]] = landingpad token
-; CHECK-NEXT: cleanup
+; CHECK-NEXT: cleanup
; CHECK-NEXT: ret i1 undef
;
entry:
diff --git a/llvm/test/Transforms/InstCombine/stdiocall-bad-sig.ll b/llvm/test/Transforms/InstCombine/stdiocall-bad-sig.ll
index f2f8ea321408f..ac18aa16e2f53 100644
--- a/llvm/test/Transforms/InstCombine/stdiocall-bad-sig.ll
+++ b/llvm/test/Transforms/InstCombine/stdiocall-bad-sig.ll
@@ -1,7 +1,7 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Verify that calls to known stdio library functions declared with
; incompatible signatures are handled gracefully and without aborting.
;
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
declare i32 @fwrite(ptr, i64, i64, ptr)
@@ -21,6 +21,11 @@ declare i8 @sprintf(ptr, ptr)
; trigger an abort).
define void @call_fwrite(ptr %fp) {
+; CHECK-LABEL: define void @call_fwrite(
+; CHECK-SAME: ptr [[FP:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @fwrite(ptr nonnull @ca1, i64 1, i64 1, ptr [[FP]])
+; CHECK-NEXT: ret void
+;
call i32 @fwrite(ptr @ca1, i64 1, i64 1, ptr %fp)
ret void
}
@@ -30,7 +35,10 @@ define void @call_fwrite(ptr %fp) {
; isn't transformed.
define void @call_printf(ptr %s) {
-; CHECK-LABEL: @call_printf(
+; CHECK-LABEL: define void @call_printf(
+; CHECK-SAME: ptr [[S:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @printf(ptr nonnull @pcnt_s)
+; CHECK-NEXT: ret void
;
call i32 @printf(ptr @pcnt_s)
ret void
@@ -40,7 +48,10 @@ define void @call_printf(ptr %s) {
; transformed.
define i8 @call_fprintf(ptr %fp, ptr %p) {
-; CHECK-LABEL: @call_fprintf(
+; CHECK-LABEL: define i8 @call_fprintf(
+; CHECK-SAME: ptr [[FP:%.*]], ptr [[P:%.*]]) {
+; CHECK-NEXT: [[CALL:%.*]] = call i8 (ptr, ptr, ...) @fprintf(ptr [[FP]], ptr nonnull @pcnt_s, ptr [[P]])
+; CHECK-NEXT: ret i8 [[CALL]]
;
%call = call i8 (ptr, ptr, ...) @fprintf(ptr %fp, ptr @pcnt_s, ptr %p)
ret i8 %call
@@ -50,7 +61,10 @@ define i8 @call_fprintf(ptr %fp, ptr %p) {
; transformed.
define i8 @call_sprintf(ptr %p, ptr %q) {
-; CHECK-LABEL: @call_sprintf(
+; CHECK-LABEL: define i8 @call_sprintf(
+; CHECK-SAME: ptr [[P:%.*]], ptr [[Q:%.*]]) {
+; CHECK-NEXT: [[CALL:%.*]] = call i8 (ptr, ptr, ...) @sprintf(ptr [[P]], ptr nonnull @pcnt_s, ptr [[Q]])
+; CHECK-NEXT: ret i8 [[CALL]]
;
%call = call i8 (ptr, ptr, ...) @sprintf(ptr %p, ptr @pcnt_s, ptr %q)
ret i8 %call
diff --git a/llvm/test/Transforms/InstCombine/store-load-unaliased-gep.ll b/llvm/test/Transforms/InstCombine/store-load-unaliased-gep.ll
index 737e9cbdf23fc..f9d5874e2efef 100644
--- a/llvm/test/Transforms/InstCombine/store-load-unaliased-gep.ll
+++ b/llvm/test/Transforms/InstCombine/store-load-unaliased-gep.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine %s -S 2>&1 | FileCheck %s
; RUN: opt -aa-pipeline=basic-aa -passes=instcombine %s -S 2>&1 | FileCheck %s
@@ -6,17 +7,18 @@
; Doable only if instcombine has access to alias-analysis.
define i32 @test1(i32 %length) {
-; CHECK-LABEL: entry:
+; CHECK-LABEL: define i32 @test1(
+; CHECK-SAME: i32 [[LENGTH:%.*]]) {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: ret i32 [[LENGTH]]
+;
entry:
%array = alloca i32, i32 2
- ; CHECK-NOT: %array
%value_gep = getelementptr inbounds i32, ptr %array, i32 1
store i32 %length, ptr %array
store i32 0, ptr %value_gep
%loaded_length = load i32, ptr %array
- ; CHECK-NOT: %loaded_length = load i32
ret i32 %loaded_length
- ; CHECK: ret i32 %length
}
diff --git a/llvm/test/Transforms/InstCombine/storemerge-dbg.ll b/llvm/test/Transforms/InstCombine/storemerge-dbg.ll
index f2bdf4493fbaf..a73bcba65307d 100644
--- a/llvm/test/Transforms/InstCombine/storemerge-dbg.ll
+++ b/llvm/test/Transforms/InstCombine/storemerge-dbg.ll
@@ -1,10 +1,26 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt < %s -passes=debugify,instcombine -S | FileCheck %s
; RUN: opt < %s -passes=debugify,instcombine -S --try-experimental-debuginfo-iterators | FileCheck %s
declare i32 @escape(i32)
-; CHECK-LABEL: define {{.*}}@foo(
define i32 @foo(i1 %c1) {
+; CHECK-LABEL: define i32 @foo(
+; CHECK-SAME: i1 [[C1:%.*]]) !dbg [[DBG5:![0-9]+]] {
+; CHECK-NEXT: [[ENTRY:.*:]]
+; CHECK-NEXT: #dbg_value(ptr poison, [[META9:![0-9]+]], !DIExpression(), [[META14:![0-9]+]])
+; CHECK-NEXT: br i1 [[C1]], label %[[LHS:.*]], label %[[RHS:.*]], !dbg [[DBG15:![0-9]+]]
+; CHECK: [[LHS]]:
+; CHECK-NEXT: br label %[[CLEANUP:.*]], !dbg [[DBG16:![0-9]+]]
+; CHECK: [[RHS]]:
+; CHECK-NEXT: br label %[[CLEANUP]], !dbg [[DBG17:![0-9]+]]
+; CHECK: [[CLEANUP]]:
+; CHECK-NEXT: [[STOREMERGE:%.*]] = phi i32 [ 2, %[[RHS]] ], [ 1, %[[LHS]] ], !dbg [[DBG18:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i32 [[STOREMERGE]], [[META11:![0-9]+]], !DIExpression(), [[META19:![0-9]+]])
+; CHECK-NEXT: [[RET_VAL:%.*]] = call i32 @escape(i32 [[STOREMERGE]]), !dbg [[DBG20:![0-9]+]]
+; CHECK-NEXT: #dbg_value(i32 [[RET_VAL]], [[META13:![0-9]+]], !DIExpression(), [[DBG20]])
+; CHECK-NEXT: ret i32 [[RET_VAL]], !dbg [[DBG21:![0-9]+]]
+;
entry:
%baz = alloca i32
br i1 %c1, label %lhs, label %rhs
@@ -18,10 +34,29 @@ rhs:
br label %cleanup
cleanup:
- ; CHECK: %storemerge = phi i32 [ 2, %rhs ], [ 1, %lhs ], !dbg [[merge_loc:![0-9]+]]
%baz.val = load i32, ptr %baz
%ret.val = call i32 @escape(i32 %baz.val)
ret i32 %ret.val
}
-; CHECK: [[merge_loc]] = !DILocation(line: 0
+;.
+; CHECK: [[META0:![0-9]+]] = distinct !DICompileUnit(language: DW_LANG_C, file: [[META1:![0-9]+]], producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug)
+; CHECK: [[META1]] = !DIFile(filename: "<stdin>", directory: {{.*}})
+; CHECK: [[DBG5]] = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: null, file: [[META1]], line: 1, type: [[META6:![0-9]+]], scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: [[META0]], retainedNodes: [[META8:![0-9]+]])
+; CHECK: [[META6]] = !DISubroutineType(types: [[META7:![0-9]+]])
+; CHECK: [[META7]] = !{}
+; CHECK: [[META8]] = !{[[META9]], [[META11]], [[META13]]}
+; CHECK: [[META9]] = !DILocalVariable(name: "1", scope: [[DBG5]], file: [[META1]], line: 1, type: [[META10:![0-9]+]])
+; CHECK: [[META10]] = !DIBasicType(name: "ty64", size: 64, encoding: DW_ATE_unsigned)
+; CHECK: [[META11]] = !DILocalVariable(name: "2", scope: [[DBG5]], file: [[META1]], line: 7, type: [[META12:![0-9]+]])
+; CHECK: [[META12]] = !DIBasicType(name: "ty32", size: 32, encoding: DW_ATE_unsigned)
+; CHECK: [[META13]] = !DILocalVariable(name: "3", scope: [[DBG5]], file: [[META1]], line: 8, type: [[META12]])
+; CHECK: [[META14]] = !DILocation(line: 1, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG15]] = !DILocation(line: 2, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG16]] = !DILocation(line: 4, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG17]] = !DILocation(line: 6, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG18]] = !DILocation(line: 0, scope: [[DBG5]])
+; CHECK: [[META19]] = !DILocation(line: 7, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG20]] = !DILocation(line: 8, column: 1, scope: [[DBG5]])
+; CHECK: [[DBG21]] = !DILocation(line: 9, column: 1, scope: [[DBG5]])
+;.
diff --git a/llvm/test/Transforms/InstCombine/stpcpy-2.ll b/llvm/test/Transforms/InstCombine/stpcpy-2.ll
index 55851ebd894f4..d2c046a4f18bf 100644
--- a/llvm/test/Transforms/InstCombine/stpcpy-2.ll
+++ b/llvm/test/Transforms/InstCombine/stpcpy-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the stpcpy library call simplifier works correctly.
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
;
@@ -11,10 +12,12 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare i16 @stpcpy(ptr, ptr)
define void @test_no_simplify1() {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define void @test_no_simplify1() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i16 @stpcpy(ptr nonnull @a, ptr nonnull @hello)
+; CHECK-NEXT: ret void
+;
call i16 @stpcpy(ptr @a, ptr @hello)
-; CHECK: call i16 @stpcpy
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/stpcpy_chk-2.ll b/llvm/test/Transforms/InstCombine/stpcpy_chk-2.ll
index 8da306a46c250..e6199e74b2a87 100644
--- a/llvm/test/Transforms/InstCombine/stpcpy_chk-2.ll
+++ b/llvm/test/Transforms/InstCombine/stpcpy_chk-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that lib call simplification doesn't simplify __stpcpy_chk calls
; with the wrong prototype.
;
@@ -9,9 +10,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
@.str = private constant [8 x i8] c"abcdefg\00"
define void @test_no_simplify() {
-; CHECK-LABEL: @test_no_simplify(
+; CHECK-LABEL: define void @test_no_simplify() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i16 @__strcpy_chk(ptr nonnull @a, ptr nonnull @.str, i32 8)
+; CHECK-NEXT: ret void
+;
-; CHECK-NEXT: call i16 @__strcpy_chk
call i16 @__strcpy_chk(ptr @a, ptr @.str, i32 8)
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/strcat-1.ll b/llvm/test/Transforms/InstCombine/strcat-1.ll
index c1658bd93a019..b4ab4e68b7270 100644
--- a/llvm/test/Transforms/InstCombine/strcat-1.ll
+++ b/llvm/test/Transforms/InstCombine/strcat-1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strcat libcall simplifier works correctly per the
; bug found in PR3661.
;
@@ -13,9 +14,15 @@ declare ptr @strcat(ptr, ptr)
declare i32 @puts(ptr)
define i32 @main() {
-; CHECK-LABEL: @main(
-; CHECK-NOT: call ptr @strcat
-; CHECK: call i32 @puts
+; CHECK-LABEL: define i32 @main() {
+; CHECK-NEXT: [[TARGET:%.*]] = alloca [1024 x i8], align 1
+; CHECK-NEXT: store i8 0, ptr [[TARGET]], align 1
+; CHECK-NEXT: [[STRLEN:%.*]] = call i32 @strlen(ptr noundef nonnull dereferenceable(1) [[TARGET]])
+; CHECK-NEXT: [[ENDPTR:%.*]] = getelementptr inbounds i8, ptr [[TARGET]], i32 [[STRLEN]]
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(6) [[ENDPTR]], ptr noundef nonnull align 1 dereferenceable(6) @hello, i32 6, i1 false)
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @puts(ptr noundef nonnull dereferenceable(1) [[TARGET]])
+; CHECK-NEXT: ret i32 0
+;
%target = alloca [1024 x i8]
store i8 0, ptr %target
diff --git a/llvm/test/Transforms/InstCombine/strcat-2.ll b/llvm/test/Transforms/InstCombine/strcat-2.ll
index 6e22c40cfa4f8..700f45ee21e2e 100644
--- a/llvm/test/Transforms/InstCombine/strcat-2.ll
+++ b/llvm/test/Transforms/InstCombine/strcat-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strcat libcall simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -11,17 +12,21 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare ptr @strcat(ptr, ptr)
define void @test_simplify1() {
-; CHECK-LABEL: @test_simplify1(
-; CHECK-NOT: call ptr @strcat
-; CHECK: ret void
+; CHECK-LABEL: define void @test_simplify1() {
+; CHECK-NEXT: [[STRLEN:%.*]] = call i32 @strlen(ptr noundef nonnull dereferenceable(1) @a)
+; CHECK-NEXT: [[ENDPTR:%.*]] = getelementptr inbounds i8, ptr @a, i32 [[STRLEN]]
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(6) [[ENDPTR]], ptr noundef nonnull align 1 dereferenceable(6) @hello, i32 6, i1 false)
+; CHECK-NEXT: ret void
+;
call ptr @strcat(ptr @a, ptr @hello)
ret void
}
define void @test_simplify2() {
-; CHECK-LABEL: @test_simplify2(
-; CHECK-NEXT: ret void
+; CHECK-LABEL: define void @test_simplify2() {
+; CHECK-NEXT: ret void
+;
call ptr @strcat(ptr @a, ptr @empty)
ret void
diff --git a/llvm/test/Transforms/InstCombine/strcat-3.ll b/llvm/test/Transforms/InstCombine/strcat-3.ll
index 1824d3ea52e77..026abf30f3cf7 100644
--- a/llvm/test/Transforms/InstCombine/strcat-3.ll
+++ b/llvm/test/Transforms/InstCombine/strcat-3.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strcat folder avoids simplifying a call to the function
; declared with an incompatible type.
;
@@ -13,9 +14,10 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare i16 @strcat(ptr, ptr)
define void @test_nosimplify1() {
-; CHECK-LABEL: @test_nosimplify1(
-; CHECK: call i16 @strcat
-; CHECK: ret void
+; CHECK-LABEL: define void @test_nosimplify1() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i16 @strcat(ptr nonnull @a, ptr nonnull @hello)
+; CHECK-NEXT: ret void
+;
call i16 @strcat(ptr @a, ptr @hello)
ret void
diff --git a/llvm/test/Transforms/InstCombine/strchr-2.ll b/llvm/test/Transforms/InstCombine/strchr-2.ll
index c86e4ac866856..55f6746c0d224 100644
--- a/llvm/test/Transforms/InstCombine/strchr-2.ll
+++ b/llvm/test/Transforms/InstCombine/strchr-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strchr libcall simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -10,9 +11,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare i8 @strchr(ptr, i32)
define void @test_nosimplify1() {
-; CHECK: test_nosimplify1
-; CHECK: call i8 @strchr
-; CHECK: ret void
+; CHECK-LABEL: define void @test_nosimplify1() {
+; CHECK-NEXT: [[DST:%.*]] = call i8 @strchr(ptr nonnull @hello, i32 119)
+; CHECK-NEXT: store i8 [[DST]], ptr @chr, align 1
+; CHECK-NEXT: ret void
+;
%dst = call i8 @strchr(ptr @hello, i32 119)
store i8 %dst, ptr @chr
diff --git a/llvm/test/Transforms/InstCombine/strcmp-2.ll b/llvm/test/Transforms/InstCombine/strcmp-2.ll
index 5412df8ec8f06..14d977e525cbd 100644
--- a/llvm/test/Transforms/InstCombine/strcmp-2.ll
+++ b/llvm/test/Transforms/InstCombine/strcmp-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strcmp library call simplifier works correctly.
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -9,9 +10,10 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare i16 @strcmp(ptr, ptr)
define i16 @test_nosimplify() {
-; CHECK-LABEL: @test_nosimplify(
-; CHECK: call i16 @strcmp
-; CHECK: ret i16 %temp1
+; CHECK-LABEL: define i16 @test_nosimplify() {
+; CHECK-NEXT: [[TEMP1:%.*]] = call i16 @strcmp(ptr nonnull @hell, ptr nonnull @hello)
+; CHECK-NEXT: ret i16 [[TEMP1]]
+;
%temp1 = call i16 @strcmp(ptr @hell, ptr @hello)
ret i16 %temp1
diff --git a/llvm/test/Transforms/InstCombine/strcpy-2.ll b/llvm/test/Transforms/InstCombine/strcpy-2.ll
index 21bc99430b90c..bab579a984300 100644
--- a/llvm/test/Transforms/InstCombine/strcpy-2.ll
+++ b/llvm/test/Transforms/InstCombine/strcpy-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strcpy folder avoids simplifying a call to the function
; declared with an incompatible type.
;
@@ -14,10 +15,12 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare i16 @strcpy(ptr, ptr)
define void @test_no_simplify1() {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define void @test_no_simplify1() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i16 @strcpy(ptr nonnull @a, ptr nonnull @hello)
+; CHECK-NEXT: ret void
+;
call i16 @strcpy(ptr @a, ptr @hello)
-; CHECK: call i16 @strcpy
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/strcpy_chk-2.ll b/llvm/test/Transforms/InstCombine/strcpy_chk-2.ll
index 7d5ca38cf8f37..c7b9042028e7c 100644
--- a/llvm/test/Transforms/InstCombine/strcpy_chk-2.ll
+++ b/llvm/test/Transforms/InstCombine/strcpy_chk-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that lib call simplification doesn't simplify __strcpy_chk calls
; with the wrong prototype.
;
@@ -9,9 +10,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
@.str = private constant [8 x i8] c"abcdefg\00"
define void @test_no_simplify() {
-; CHECK-LABEL: @test_no_simplify(
+; CHECK-LABEL: define void @test_no_simplify() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i16 @__strcpy_chk(ptr nonnull @a, ptr nonnull @.str, i32 8)
+; CHECK-NEXT: ret void
+;
-; CHECK-NEXT: call i16 @__strcpy_chk
call i16 @__strcpy_chk(ptr @a, ptr @.str, i32 8)
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/strcspn-2.ll b/llvm/test/Transforms/InstCombine/strcspn-2.ll
index bba099d9ddd22..6be4bbc99e673 100644
--- a/llvm/test/Transforms/InstCombine/strcspn-2.ll
+++ b/llvm/test/Transforms/InstCombine/strcspn-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strcspn library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -11,10 +12,12 @@ declare double @strcspn(ptr, ptr)
; Check that strcspn functions with the wrong prototype aren't simplified.
define double @test_no_simplify1(ptr %pat) {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define double @test_no_simplify1(
+; CHECK-SAME: ptr [[PAT:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call double @strcspn(ptr nonnull @null, ptr [[PAT]])
+; CHECK-NEXT: ret double [[RET]]
+;
%ret = call double @strcspn(ptr @null, ptr %pat)
-; CHECK-NEXT: call double @strcspn
ret double %ret
-; CHECK-NEXT: ret double %ret
}
diff --git a/llvm/test/Transforms/InstCombine/strlen_chk.ll b/llvm/test/Transforms/InstCombine/strlen_chk.ll
index 0e2ad6e648e39..99abc2c2b8079 100644
--- a/llvm/test/Transforms/InstCombine/strlen_chk.ll
+++ b/llvm/test/Transforms/InstCombine/strlen_chk.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that __strlen_chk simplification works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -11,37 +12,51 @@ declare i32 @__strlen_chk(ptr, i32)
; Check __strlen_chk(string constant) -> strlen or constants
-; CHECK-LABEL: @unknown_str_known_object_size
define i32 @unknown_str_known_object_size(ptr %c) {
- ; CHECK: call i32 @__strlen_chk
+; CHECK-LABEL: define i32 @unknown_str_known_object_size(
+; CHECK-SAME: ptr [[C:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__strlen_chk(ptr [[C]], i32 8)
+; CHECK-NEXT: ret i32 [[TMP1]]
+;
%1 = call i32 @__strlen_chk(ptr %c, i32 8)
ret i32 %1
}
-; CHECK-LABEL: @known_str_known_object_size
define i32 @known_str_known_object_size(ptr %c) {
- ; CHECK: ret i32 5
+; CHECK-LABEL: define i32 @known_str_known_object_size(
+; CHECK-SAME: ptr [[C:%.*]]) {
+; CHECK-NEXT: ret i32 5
+;
%1 = call i32 @__strlen_chk(ptr @hello, i32 6)
ret i32 %1
}
-; CHECK-LABEL: @known_str_too_small_object_size
define i32 @known_str_too_small_object_size(ptr %c) {
- ; CHECK: call i32 @__strlen_chk
+; CHECK-LABEL: define i32 @known_str_too_small_object_size(
+; CHECK-SAME: ptr [[C:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__strlen_chk(ptr nonnull dereferenceable(6) @hello, i32 5)
+; CHECK-NEXT: ret i32 [[TMP1]]
+;
%1 = call i32 @__strlen_chk(ptr @hello, i32 5)
ret i32 %1
}
-; CHECK-LABEL: @known_str_no_nul
define i32 @known_str_no_nul(ptr %c) {
- ; CHECK: call i32 @__strlen_chk
+; CHECK-LABEL: define i32 @known_str_no_nul(
+; CHECK-SAME: ptr [[C:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @__strlen_chk(ptr nonnull dereferenceable(6) @hello_no_nul, i32 5)
+; CHECK-NEXT: ret i32 [[TMP1]]
+;
%1 = call i32 @__strlen_chk(ptr @hello_no_nul, i32 5)
ret i32 %1
}
-; CHECK-LABEL: @unknown_str_unknown_object_size
define i32 @unknown_str_unknown_object_size(ptr %c) {
- ; CHECK: call i32 @strlen
+; CHECK-LABEL: define i32 @unknown_str_unknown_object_size(
+; CHECK-SAME: ptr [[C:%.*]]) {
+; CHECK-NEXT: [[STRLEN:%.*]] = call i32 @strlen(ptr noundef nonnull dereferenceable(1) [[C]])
+; CHECK-NEXT: ret i32 [[STRLEN]]
+;
%1 = call i32 @__strlen_chk(ptr %c, i32 -1)
ret i32 %1
}
diff --git a/llvm/test/Transforms/InstCombine/strncat-1.ll b/llvm/test/Transforms/InstCombine/strncat-1.ll
index ffd4b52b9f194..5f96b3bc7dc07 100644
--- a/llvm/test/Transforms/InstCombine/strncat-1.ll
+++ b/llvm/test/Transforms/InstCombine/strncat-1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strncat libcall simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -12,9 +13,15 @@ declare ptr @strncat(ptr, ptr, i32)
declare i32 @puts(ptr)
define i32 @main() {
-; CHECK-LABEL: @main(
-; CHECK-NOT: call ptr @strncat
-; CHECK: call i32 @puts
+; CHECK-LABEL: define i32 @main() {
+; CHECK-NEXT: [[TARGET:%.*]] = alloca [1024 x i8], align 1
+; CHECK-NEXT: store i8 0, ptr [[TARGET]], align 1
+; CHECK-NEXT: [[STRLEN:%.*]] = call i32 @strlen(ptr noundef nonnull dereferenceable(1) [[TARGET]])
+; CHECK-NEXT: [[ENDPTR:%.*]] = getelementptr inbounds i8, ptr [[TARGET]], i32 [[STRLEN]]
+; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(6) [[ENDPTR]], ptr noundef nonnull align 1 dereferenceable(6) @hello, i32 6, i1 false)
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @puts(ptr noundef nonnull dereferenceable(1) [[TARGET]])
+; CHECK-NEXT: ret i32 0
+;
%target = alloca [1024 x i8]
store i8 0, ptr %target
diff --git a/llvm/test/Transforms/InstCombine/strncat-3.ll b/llvm/test/Transforms/InstCombine/strncat-3.ll
index c4026bd3b9f58..22270014df31d 100644
--- a/llvm/test/Transforms/InstCombine/strncat-3.ll
+++ b/llvm/test/Transforms/InstCombine/strncat-3.ll
@@ -1,7 +1,7 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strncat folder avoids simplifying a call to the function
; declared with an incompatible type.
;
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
@@ -13,7 +13,7 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare i16 @strncat(ptr, ptr, i32)
define void @test_nosimplify1() {
-; CHECK-LABEL: @test_nosimplify1(
+; CHECK-LABEL: define void @test_nosimplify1() {
; CHECK-NEXT: [[TMP1:%.*]] = call i16 @strncat(ptr nonnull @a, ptr nonnull @hello, i32 13)
; CHECK-NEXT: ret void
;
diff --git a/llvm/test/Transforms/InstCombine/strncmp-wrong-datalayout.ll b/llvm/test/Transforms/InstCombine/strncmp-wrong-datalayout.ll
index e5da923221627..01302aa8c71b3 100644
--- a/llvm/test/Transforms/InstCombine/strncmp-wrong-datalayout.ll
+++ b/llvm/test/Transforms/InstCombine/strncmp-wrong-datalayout.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strncpy simplification doesn't crash if datalayout specifies
; 64 bit pointers while length is a 32 bit argument
;
@@ -8,8 +9,11 @@ target datalayout = "e-p:64:64:64"
declare i32 @strncmp(ptr, ptr, i32)
define i32 @test6(ptr %str1, ptr %str2) {
-; CHECK-LABEL: @test6(
-; CHECK: call i32 @strncmp(ptr %str1, ptr %str2, i32 1)
+; CHECK-LABEL: define i32 @test6(
+; CHECK-SAME: ptr [[STR1:%.*]], ptr [[STR2:%.*]]) {
+; CHECK-NEXT: [[TEMP1:%.*]] = call i32 @strncmp(ptr [[STR1]], ptr [[STR2]], i32 1)
+; CHECK-NEXT: ret i32 [[TEMP1]]
+;
%temp1 = call i32 @strncmp(ptr %str1, ptr %str2, i32 1)
ret i32 %temp1
diff --git a/llvm/test/Transforms/InstCombine/strncpy-2.ll b/llvm/test/Transforms/InstCombine/strncpy-2.ll
index bb6596ee7ef77..a70b93a3654b0 100644
--- a/llvm/test/Transforms/InstCombine/strncpy-2.ll
+++ b/llvm/test/Transforms/InstCombine/strncpy-2.ll
@@ -1,7 +1,7 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strncpy folder avoids simplifying a call to the function
; declared with an incompatible type.
;
-; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
; Test that the strncpy library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -16,7 +16,7 @@ declare i16 @strncpy(ptr, ptr, i32)
; Check that 'strncpy' functions with the wrong prototype aren't simplified.
define void @test_no_simplify1() {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define void @test_no_simplify1() {
; CHECK-NEXT: [[TMP1:%.*]] = call i16 @strncpy(ptr nonnull @a, ptr nonnull @hello, i32 6)
; CHECK-NEXT: ret void
;
diff --git a/llvm/test/Transforms/InstCombine/strncpy_chk-2.ll b/llvm/test/Transforms/InstCombine/strncpy_chk-2.ll
index d54f7c14f9f04..eb7ca8a0efb06 100644
--- a/llvm/test/Transforms/InstCombine/strncpy_chk-2.ll
+++ b/llvm/test/Transforms/InstCombine/strncpy_chk-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that lib call simplification doesn't simplify __strncpy_chk calls
; with the wrong prototype.
;
@@ -9,9 +10,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
@b = common global [60 x i8] zeroinitializer, align 1
define void @test_no_simplify() {
-; CHECK-LABEL: @test_no_simplify(
+; CHECK-LABEL: define void @test_no_simplify() {
+; CHECK-NEXT: [[TMP1:%.*]] = call i16 @__strncpy_chk(ptr nonnull @a, ptr nonnull @b, i32 60, i32 60)
+; CHECK-NEXT: ret void
+;
-; CHECK-NEXT: call i16 @__strncpy_chk
call i16 @__strncpy_chk(ptr @a, ptr @b, i32 60, i32 60)
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/strpbrk-2.ll b/llvm/test/Transforms/InstCombine/strpbrk-2.ll
index 24bb97a498f14..466a60660d3de 100644
--- a/llvm/test/Transforms/InstCombine/strpbrk-2.ll
+++ b/llvm/test/Transforms/InstCombine/strpbrk-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strpbrk folder doesn't simplify a call to the function
; declared with an incompatible prototype.
;
@@ -13,10 +14,11 @@ declare i8 @strpbrk(ptr, ptr)
; Check that 'strpbrk' functions with the wrong prototype aren't simplified.
define i8 @test_no_simplify1() {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define i8 @test_no_simplify1() {
+; CHECK-NEXT: [[RET:%.*]] = call i8 @strpbrk(ptr nonnull @hello, ptr nonnull @w)
+; CHECK-NEXT: ret i8 [[RET]]
+;
%ret = call i8 @strpbrk(ptr @hello, ptr @w)
-; CHECK-NEXT: %ret = call i8 @strpbrk
ret i8 %ret
-; CHECK-NEXT: ret i8 %ret
}
diff --git a/llvm/test/Transforms/InstCombine/strrchr-2.ll b/llvm/test/Transforms/InstCombine/strrchr-2.ll
index 989c9759f5303..f0406b4714d19 100644
--- a/llvm/test/Transforms/InstCombine/strrchr-2.ll
+++ b/llvm/test/Transforms/InstCombine/strrchr-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strrchr libcall simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -10,9 +11,11 @@ target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f3
declare i8 @strrchr(ptr, i32)
define void @test_nosimplify1() {
-; CHECK: test_nosimplify1
-; CHECK: call i8 @strrchr
-; CHECK: ret void
+; CHECK-LABEL: define void @test_nosimplify1() {
+; CHECK-NEXT: [[DST:%.*]] = call i8 @strrchr(ptr nonnull @hello, i32 119)
+; CHECK-NEXT: store i8 [[DST]], ptr @chr, align 1
+; CHECK-NEXT: ret void
+;
%dst = call i8 @strrchr(ptr @hello, i32 119)
store i8 %dst, ptr @chr
diff --git a/llvm/test/Transforms/InstCombine/strspn-1.ll b/llvm/test/Transforms/InstCombine/strspn-1.ll
index aaa72ddf7d190..3b62e38f56585 100644
--- a/llvm/test/Transforms/InstCombine/strspn-1.ll
+++ b/llvm/test/Transforms/InstCombine/strspn-1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strspn library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -11,40 +12,47 @@ declare i64 @strspn(ptr, ptr)
; Check strspn(s, "") -> 0.
define i64 @test_simplify1(ptr %str) {
-; CHECK-LABEL: @test_simplify1(
+; CHECK-LABEL: define i64 @test_simplify1(
+; CHECK-SAME: ptr [[STR:%.*]]) {
+; CHECK-NEXT: ret i64 0
+;
%ret = call i64 @strspn(ptr %str, ptr @null)
ret i64 %ret
-; CHECK-NEXT: ret i64 0
}
; Check strspn("", s) -> 0.
define i64 @test_simplify2(ptr %pat) {
-; CHECK-LABEL: @test_simplify2(
+; CHECK-LABEL: define i64 @test_simplify2(
+; CHECK-SAME: ptr [[PAT:%.*]]) {
+; CHECK-NEXT: ret i64 0
+;
%ret = call i64 @strspn(ptr @null, ptr %pat)
ret i64 %ret
-; CHECK-NEXT: ret i64 0
}
; Check strspn(s1, s2), where s1 and s2 are constants.
define i64 @test_simplify3() {
-; CHECK-LABEL: @test_simplify3(
+; CHECK-LABEL: define i64 @test_simplify3() {
+; CHECK-NEXT: ret i64 5
+;
%ret = call i64 @strspn(ptr @abcba, ptr @abc)
ret i64 %ret
-; CHECK-NEXT: ret i64 5
}
; Check cases that shouldn't be simplified.
define i64 @test_no_simplify1(ptr %str, ptr %pat) {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define i64 @test_no_simplify1(
+; CHECK-SAME: ptr [[STR:%.*]], ptr [[PAT:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i64 @strspn(ptr [[STR]], ptr [[PAT]])
+; CHECK-NEXT: ret i64 [[RET]]
+;
%ret = call i64 @strspn(ptr %str, ptr %pat)
-; CHECK-NEXT: %ret = call i64 @strspn(ptr %str, ptr %pat)
ret i64 %ret
-; CHECK-NEXT: ret i64 %ret
}
diff --git a/llvm/test/Transforms/InstCombine/strstr-2.ll b/llvm/test/Transforms/InstCombine/strstr-2.ll
index d93aba744fe6d..20ddf75f53d75 100644
--- a/llvm/test/Transforms/InstCombine/strstr-2.ll
+++ b/llvm/test/Transforms/InstCombine/strstr-2.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strstr library call simplifier works correctly.
;
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
@@ -9,9 +10,11 @@ target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f3
declare i8 @strstr(ptr, ptr)
define i8 @test_no_simplify1(ptr %str) {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define i8 @test_no_simplify1(
+; CHECK-SAME: ptr [[STR:%.*]]) {
+; CHECK-NEXT: [[RET:%.*]] = call i8 @strstr(ptr [[STR]], ptr nonnull @null)
+; CHECK-NEXT: ret i8 [[RET]]
+;
%ret = call i8 @strstr(ptr %str, ptr @null)
-; CHECK-NEXT: call i8 @strstr
ret i8 %ret
-; CHECK-NEXT: ret i8 %ret
}
diff --git a/llvm/test/Transforms/InstCombine/strto-1.ll b/llvm/test/Transforms/InstCombine/strto-1.ll
index 131997dc4b53d..0f250dc31d420 100644
--- a/llvm/test/Transforms/InstCombine/strto-1.ll
+++ b/llvm/test/Transforms/InstCombine/strto-1.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; Test that the strto* library call simplifiers works correctly.
;
; RUN: opt < %s -passes='function(instcombine),inferattrs' -S | FileCheck %s
@@ -5,78 +6,95 @@
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
declare i32 @strtol(ptr %s, ptr %endptr, i32 %base)
-; CHECK: declare i32 @strtol(ptr readonly, ptr nocapture, i32)
declare double @strtod(ptr %s, ptr %endptr)
-; CHECK: declare double @strtod(ptr readonly, ptr nocapture)
declare float @strtof(ptr %s, ptr %endptr)
-; CHECK: declare float @strtof(ptr readonly, ptr nocapture)
declare i64 @strtoul(ptr %s, ptr %endptr, i32 %base)
-; CHECK: declare i64 @strtoul(ptr readonly, ptr nocapture, i32)
declare i64 @strtoll(ptr %s, ptr %endptr, i32 %base)
-; CHECK: declare i64 @strtoll(ptr readonly, ptr nocapture, i32)
declare double @strtold(ptr %s, ptr %endptr)
-; CHECK: declare double @strtold(ptr readonly, ptr nocapture)
declare i64 @strtoull(ptr %s, ptr %endptr, i32 %base)
-; CHECK: declare i64 @strtoull(ptr readonly, ptr nocapture, i32)
define void @test_simplify1(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_simplify1(
+; CHECK-LABEL: define void @test_simplify1(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @strtol(ptr nocapture [[X]], ptr null, i32 10)
+; CHECK-NEXT: ret void
+;
call i32 @strtol(ptr %x, ptr null, i32 10)
-; CHECK-NEXT: call i32 @strtol(ptr nocapture %x, ptr null, i32 10)
ret void
}
define void @test_simplify2(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_simplify2(
+; CHECK-LABEL: define void @test_simplify2(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call double @strtod(ptr nocapture [[X]], ptr null)
+; CHECK-NEXT: ret void
+;
call double @strtod(ptr %x, ptr null)
-; CHECK-NEXT: call double @strtod(ptr nocapture %x, ptr null)
ret void
}
define void @test_simplify3(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_simplify3(
+; CHECK-LABEL: define void @test_simplify3(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call float @strtof(ptr nocapture [[X]], ptr null)
+; CHECK-NEXT: ret void
+;
call float @strtof(ptr %x, ptr null)
-; CHECK-NEXT: call float @strtof(ptr nocapture %x, ptr null)
ret void
}
define void @test_simplify4(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_simplify4(
+; CHECK-LABEL: define void @test_simplify4(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i64 @strtoul(ptr nocapture [[X]], ptr null, i32 10)
+; CHECK-NEXT: ret void
+;
call i64 @strtoul(ptr %x, ptr null, i32 10)
-; CHECK-NEXT: call i64 @strtoul(ptr nocapture %x, ptr null, i32 10)
ret void
}
define void @test_simplify5(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_simplify5(
+; CHECK-LABEL: define void @test_simplify5(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i64 @strtoll(ptr nocapture [[X]], ptr null, i32 10)
+; CHECK-NEXT: ret void
+;
call i64 @strtoll(ptr %x, ptr null, i32 10)
-; CHECK-NEXT: call i64 @strtoll(ptr nocapture %x, ptr null, i32 10)
ret void
}
define void @test_simplify6(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_simplify6(
+; CHECK-LABEL: define void @test_simplify6(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call double @strtold(ptr nocapture [[X]], ptr null)
+; CHECK-NEXT: ret void
+;
call double @strtold(ptr %x, ptr null)
-; CHECK-NEXT: call double @strtold(ptr nocapture %x, ptr null)
ret void
}
define void @test_simplify7(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_simplify7(
+; CHECK-LABEL: define void @test_simplify7(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i64 @strtoull(ptr nocapture [[X]], ptr null, i32 10)
+; CHECK-NEXT: ret void
+;
call i64 @strtoull(ptr %x, ptr null, i32 10)
-; CHECK-NEXT: call i64 @strtoull(ptr nocapture %x, ptr null, i32 10)
ret void
}
define void @test_no_simplify1(ptr %x, ptr %endptr) {
-; CHECK-LABEL: @test_no_simplify1(
+; CHECK-LABEL: define void @test_no_simplify1(
+; CHECK-SAME: ptr [[X:%.*]], ptr [[ENDPTR:%.*]]) {
+; CHECK-NEXT: [[TMP1:%.*]] = call i32 @strtol(ptr [[X]], ptr [[ENDPTR]], i32 10)
+; CHECK-NEXT: ret void
+;
call i32 @strtol(ptr %x, ptr %endptr, i32 10)
-; CHECK-NEXT: call i32 @strtol(ptr %x, ptr %endptr, i32 10)
ret void
}
diff --git a/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll b/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll
index faf388b72e9db..d8514ca829117 100644
--- a/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll
+++ b/llvm/test/Transforms/InstCombine/struct-assign-tbaa-new.ll
@@ -50,9 +50,9 @@ define ptr @test2() {
;.
; CHECK: attributes #[[ATTR0:[0-9]+]] = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
;.
-; CHECK: [[TBAA0]] = !{!1, !1, i64 0, i64 4}
-; CHECK: [[META1:![0-9]+]] = !{!2, i64 4, !"A", !4, i64 0, i64 4}
-; CHECK: [[META2:![0-9]+]] = !{!3, !"char"}
-; CHECK: [[META3:![0-9]+]] = !{!"root"}
-; CHECK: [[META4:![0-9]+]] = !{!2, !"float"}
+; CHECK: [[TBAA0]] = !{[[META1:![0-9]+]], [[META1]], i64 0, i64 4}
+; CHECK: [[META1]] = !{[[META2:![0-9]+]], i64 4, !"A", [[META4:![0-9]+]], i64 0, i64 4}
+; CHECK: [[META2]] = !{[[META3:![0-9]+]], !"char"}
+; CHECK: [[META3]] = !{!"root"}
+; CHECK: [[META4]] = !{[[META2]], !"float"}
;.
diff --git a/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll b/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll
index 996d2c0e67e16..c3a039f983a19 100644
--- a/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll
+++ b/llvm/test/Transforms/InstCombine/struct-assign-tbaa.ll
@@ -50,8 +50,8 @@ entry:
define void @test4_multiple_copy_first_field(ptr nocapture %a, ptr nocapture %b) {
; CHECK-LABEL: @test4_multiple_copy_first_field(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[B:%.*]], align 4
-; CHECK-NEXT: store i32 [[TMP0]], ptr [[A:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[B:%.*]], align 4, !tbaa [[TBAA0]]
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[A:%.*]], align 4, !tbaa [[TBAA0]]
; CHECK-NEXT: ret void
;
entry:
@@ -62,8 +62,8 @@ entry:
define void @test5_multiple_copy_more_than_first_field(ptr nocapture %a, ptr nocapture %b) {
; CHECK-LABEL: @test5_multiple_copy_more_than_first_field(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[B:%.*]], align 4
-; CHECK-NEXT: store i32 [[TMP0]], ptr [[A:%.*]], align 4
+; CHECK-NEXT: [[TMP0:%.*]] = load i32, ptr [[B:%.*]], align 4, !tbaa.struct [[TBAA_STRUCT4:![0-9]+]]
+; CHECK-NEXT: store i32 [[TMP0]], ptr [[A:%.*]], align 4, !tbaa.struct [[TBAA_STRUCT4]]
; CHECK-NEXT: ret void
;
entry:
@@ -87,4 +87,5 @@ entry:
; CHECK: [[META1]] = !{!"float", [[META2:![0-9]+]]}
; CHECK: [[META2]] = !{!"Simple C/C++ TBAA"}
; CHECK: [[TBAA_STRUCT3]] = !{i64 0, i64 4, [[TBAA0]], i64 4, i64 4, [[TBAA0]]}
+; CHECK: [[TBAA_STRUCT4]] = !{i64 0, i64 2, [[TBAA0]], i64 4, i64 6, [[TBAA0]]}
;.
diff --git a/llvm/test/Transforms/InstCombine/sub-gep.ll b/llvm/test/Transforms/InstCombine/sub-gep.ll
index 5130883409b28..09b69a226f19c 100644
--- a/llvm/test/Transforms/InstCombine/sub-gep.ll
+++ b/llvm/test/Transforms/InstCombine/sub-gep.ll
@@ -421,8 +421,8 @@ define i64 @nullptrtoint_scalable_x(i64 %x) {
; CHECK-LABEL: @nullptrtoint_scalable_x(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[TMP0:%.*]] = call i64 @llvm.vscale.i64()
-; CHECK-NEXT: [[TMP1:%.*]] = shl i64 [[TMP0]], 4
-; CHECK-NEXT: [[PTR_IDX:%.*]] = mul nsw i64 [[TMP1]], [[X:%.*]]
+; CHECK-NEXT: [[TMP1:%.*]] = mul i64 [[TMP0]], [[X:%.*]]
+; CHECK-NEXT: [[PTR_IDX:%.*]] = shl i64 [[TMP1]], 4
; CHECK-NEXT: ret i64 [[PTR_IDX]]
;
entry:
diff --git a/llvm/test/Transforms/InstCombine/switch-constant-expr.ll b/llvm/test/Transforms/InstCombine/switch-constant-expr.ll
index e3a5e2ac8c117..740793757a22f 100644
--- a/llvm/test/Transforms/InstCombine/switch-constant-expr.ll
+++ b/llvm/test/Transforms/InstCombine/switch-constant-expr.ll
@@ -19,8 +19,8 @@ x:
define i32 @multiple_cases() {
; CHECK-LABEL: @multiple_cases(
; CHECK-NEXT: switch i32 add (i32 ptrtoint (ptr @g to i32), i32 -1), label [[X:%.*]] [
-; CHECK-NEXT: i32 1, label [[ONE:%.*]]
-; CHECK-NEXT: i32 2, label [[TWO:%.*]]
+; CHECK-NEXT: i32 1, label [[ONE:%.*]]
+; CHECK-NEXT: i32 2, label [[TWO:%.*]]
; CHECK-NEXT: ]
; CHECK: x:
; CHECK-NEXT: ret i32 0
diff --git a/llvm/test/Transforms/InstCombine/switch-truncate-crash.ll b/llvm/test/Transforms/InstCombine/switch-truncate-crash.ll
index 625955aa73723..0c9f63602f015 100644
--- a/llvm/test/Transforms/InstCombine/switch-truncate-crash.ll
+++ b/llvm/test/Transforms/InstCombine/switch-truncate-crash.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -passes=instcombine < %s
define void @test() {
More information about the llvm-commits
mailing list