Skip to content

Commit e7ac499

Browse files
authored
[InstSimplify] Add poison propagation for trivially vectorizable intrinsics (#149243)
Fixes #146769 Test cases added to `llvm/test/Transforms/InstSimplify/fold-intrinsics.ll`
1 parent d77ac81 commit e7ac499

File tree

10 files changed

+404
-646
lines changed

10 files changed

+404
-646
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7912,6 +7912,8 @@ bool llvm::intrinsicPropagatesPoison(Intrinsic::ID IID) {
79127912
case Intrinsic::ushl_sat:
79137913
case Intrinsic::smul_fix:
79147914
case Intrinsic::smul_fix_sat:
7915+
case Intrinsic::umul_fix:
7916+
case Intrinsic::umul_fix_sat:
79157917
case Intrinsic::pow:
79167918
case Intrinsic::powi:
79177919
case Intrinsic::sin:
@@ -7928,6 +7930,22 @@ bool llvm::intrinsicPropagatesPoison(Intrinsic::ID IID) {
79287930
case Intrinsic::atan2:
79297931
case Intrinsic::canonicalize:
79307932
case Intrinsic::sqrt:
7933+
case Intrinsic::exp:
7934+
case Intrinsic::exp2:
7935+
case Intrinsic::exp10:
7936+
case Intrinsic::log:
7937+
case Intrinsic::log2:
7938+
case Intrinsic::log10:
7939+
case Intrinsic::modf:
7940+
case Intrinsic::floor:
7941+
case Intrinsic::ceil:
7942+
case Intrinsic::trunc:
7943+
case Intrinsic::rint:
7944+
case Intrinsic::nearbyint:
7945+
case Intrinsic::round:
7946+
case Intrinsic::roundeven:
7947+
case Intrinsic::lrint:
7948+
case Intrinsic::llrint:
79317949
return true;
79327950
default:
79337951
return false;

llvm/test/CodeGen/AMDGPU/llvm.exp.ll

Lines changed: 8 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -5213,121 +5213,15 @@ define float @v_exp_f32_dynamic_mode(float %in) #1 {
52135213
}
52145214

52155215
define float @v_exp_f32_undef() {
5216-
; VI-SDAG-LABEL: v_exp_f32_undef:
5217-
; VI-SDAG: ; %bb.0:
5218-
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5219-
; VI-SDAG-NEXT: v_rndne_f32_e32 v0, 0
5220-
; VI-SDAG-NEXT: s_mov_b32 s4, 0x7fc00000
5221-
; VI-SDAG-NEXT: v_add_f32_e64 v1, -v0, s4
5222-
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
5223-
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v0
5224-
; VI-SDAG-NEXT: v_ldexp_f32 v0, v1, v0
5225-
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
5226-
;
5227-
; VI-GISEL-LABEL: v_exp_f32_undef:
5228-
; VI-GISEL: ; %bb.0:
5229-
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5230-
; VI-GISEL-NEXT: v_sub_f32_e64 v0, s4, 0
5231-
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x3fb8a000
5232-
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x39a3b295
5233-
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x39a3b295, v0
5234-
; VI-GISEL-NEXT: v_mul_f32_e32 v0, 0x3fb8a000, v0
5235-
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0, v1
5236-
; VI-GISEL-NEXT: v_add_f32_e32 v0, v0, v3
5237-
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0, v2
5238-
; VI-GISEL-NEXT: v_add_f32_e32 v0, v2, v0
5239-
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v1
5240-
; VI-GISEL-NEXT: v_sub_f32_e32 v1, v1, v2
5241-
; VI-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
5242-
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v2
5243-
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
5244-
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x7f800000
5245-
; VI-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
5246-
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc2ce8ed0
5247-
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v1
5248-
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x42b17218
5249-
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v0, 0, vcc
5250-
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s4, v1
5251-
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
5252-
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
5253-
;
5254-
; GFX900-SDAG-LABEL: v_exp_f32_undef:
5255-
; GFX900-SDAG: ; %bb.0:
5256-
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5257-
; GFX900-SDAG-NEXT: v_mov_b32_e32 v0, 0x3fb8aa3b
5258-
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0xffc00000
5259-
; GFX900-SDAG-NEXT: v_fma_f32 v0, s4, v0, v1
5260-
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0x32a5705f
5261-
; GFX900-SDAG-NEXT: v_fma_f32 v0, s4, v1, v0
5262-
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v1, 0x7fc00000
5263-
; GFX900-SDAG-NEXT: v_sub_f32_e32 v2, 0x7fc00000, v1
5264-
; GFX900-SDAG-NEXT: v_add_f32_e32 v0, v2, v0
5265-
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
5266-
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v1
5267-
; GFX900-SDAG-NEXT: v_ldexp_f32 v0, v0, v1
5268-
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
5269-
;
5270-
; GFX900-GISEL-LABEL: v_exp_f32_undef:
5271-
; GFX900-GISEL: ; %bb.0:
5272-
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5273-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0x3fb8aa3b
5274-
; GFX900-GISEL-NEXT: v_mul_f32_e32 v1, s4, v0
5275-
; GFX900-GISEL-NEXT: v_fma_f32 v0, s4, v0, -v1
5276-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x32a5705f
5277-
; GFX900-GISEL-NEXT: v_fma_f32 v0, s4, v2, v0
5278-
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v2, v1
5279-
; GFX900-GISEL-NEXT: v_sub_f32_e32 v1, v1, v2
5280-
; GFX900-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
5281-
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v2
5282-
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
5283-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x7f800000
5284-
; GFX900-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
5285-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0xc2ce8ed0
5286-
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v1
5287-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x42b17218
5288-
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v0, 0, vcc
5289-
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s4, v1
5290-
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
5291-
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
5292-
;
5293-
; SI-SDAG-LABEL: v_exp_f32_undef:
5294-
; SI-SDAG: ; %bb.0:
5295-
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5296-
; SI-SDAG-NEXT: v_mov_b32_e32 v0, 0x3fb8aa3b
5297-
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0xffc00000
5298-
; SI-SDAG-NEXT: v_fma_f32 v0, s4, v0, v1
5299-
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0x32a5705f
5300-
; SI-SDAG-NEXT: v_fma_f32 v0, s4, v1, v0
5301-
; SI-SDAG-NEXT: v_rndne_f32_e32 v1, 0x7fc00000
5302-
; SI-SDAG-NEXT: v_sub_f32_e32 v2, 0x7fc00000, v1
5303-
; SI-SDAG-NEXT: v_add_f32_e32 v0, v2, v0
5304-
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
5305-
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v1
5306-
; SI-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
5307-
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
5216+
; GCN-LABEL: v_exp_f32_undef:
5217+
; GCN: ; %bb.0:
5218+
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5219+
; GCN-NEXT: s_setpc_b64 s[30:31]
53085220
;
5309-
; SI-GISEL-LABEL: v_exp_f32_undef:
5310-
; SI-GISEL: ; %bb.0:
5311-
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5312-
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0x3fb8aa3b
5313-
; SI-GISEL-NEXT: v_mul_f32_e32 v1, s4, v0
5314-
; SI-GISEL-NEXT: v_fma_f32 v0, s4, v0, -v1
5315-
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x32a5705f
5316-
; SI-GISEL-NEXT: v_fma_f32 v0, s4, v2, v0
5317-
; SI-GISEL-NEXT: v_rndne_f32_e32 v2, v1
5318-
; SI-GISEL-NEXT: v_sub_f32_e32 v1, v1, v2
5319-
; SI-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
5320-
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v2
5321-
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
5322-
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x7f800000
5323-
; SI-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
5324-
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc2ce8ed0
5325-
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v1
5326-
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x42b17218
5327-
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v0, 0, vcc
5328-
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s4, v1
5329-
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
5330-
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
5221+
; SI-LABEL: v_exp_f32_undef:
5222+
; SI: ; %bb.0:
5223+
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5224+
; SI-NEXT: s_setpc_b64 s[30:31]
53315225
;
53325226
; R600-LABEL: v_exp_f32_undef:
53335227
; R600: ; %bb.0:

llvm/test/CodeGen/AMDGPU/llvm.exp10.ll

Lines changed: 8 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -5291,121 +5291,15 @@ define float @v_exp10_f32_dynamic_mode(float %in) #1 {
52915291
}
52925292

52935293
define float @v_exp10_f32_undef() {
5294-
; VI-SDAG-LABEL: v_exp10_f32_undef:
5295-
; VI-SDAG: ; %bb.0:
5296-
; VI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5297-
; VI-SDAG-NEXT: v_rndne_f32_e32 v0, 0
5298-
; VI-SDAG-NEXT: s_mov_b32 s4, 0x7fc00000
5299-
; VI-SDAG-NEXT: v_add_f32_e64 v1, -v0, s4
5300-
; VI-SDAG-NEXT: v_exp_f32_e32 v1, v1
5301-
; VI-SDAG-NEXT: v_cvt_i32_f32_e32 v0, v0
5302-
; VI-SDAG-NEXT: v_ldexp_f32 v0, v1, v0
5303-
; VI-SDAG-NEXT: s_setpc_b64 s[30:31]
5304-
;
5305-
; VI-GISEL-LABEL: v_exp10_f32_undef:
5306-
; VI-GISEL: ; %bb.0:
5307-
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5308-
; VI-GISEL-NEXT: v_sub_f32_e64 v0, s4, 0
5309-
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x40549000
5310-
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x3a2784bc
5311-
; VI-GISEL-NEXT: v_mul_f32_e32 v3, 0x3a2784bc, v0
5312-
; VI-GISEL-NEXT: v_mul_f32_e32 v0, 0x40549000, v0
5313-
; VI-GISEL-NEXT: v_mul_f32_e32 v1, 0, v1
5314-
; VI-GISEL-NEXT: v_add_f32_e32 v0, v0, v3
5315-
; VI-GISEL-NEXT: v_mul_f32_e32 v2, 0, v2
5316-
; VI-GISEL-NEXT: v_add_f32_e32 v0, v2, v0
5317-
; VI-GISEL-NEXT: v_rndne_f32_e32 v2, v1
5318-
; VI-GISEL-NEXT: v_sub_f32_e32 v1, v1, v2
5319-
; VI-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
5320-
; VI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v2
5321-
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
5322-
; VI-GISEL-NEXT: v_mov_b32_e32 v2, 0x7f800000
5323-
; VI-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
5324-
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc23369f4
5325-
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v1
5326-
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x421a209b
5327-
; VI-GISEL-NEXT: v_cndmask_b32_e64 v0, v0, 0, vcc
5328-
; VI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s4, v1
5329-
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
5330-
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
5331-
;
5332-
; GFX900-SDAG-LABEL: v_exp10_f32_undef:
5333-
; GFX900-SDAG: ; %bb.0:
5334-
; GFX900-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5335-
; GFX900-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
5336-
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0xffc00000
5337-
; GFX900-SDAG-NEXT: v_fma_f32 v0, s4, v0, v1
5338-
; GFX900-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
5339-
; GFX900-SDAG-NEXT: v_fma_f32 v0, s4, v1, v0
5340-
; GFX900-SDAG-NEXT: v_rndne_f32_e32 v1, 0x7fc00000
5341-
; GFX900-SDAG-NEXT: v_sub_f32_e32 v2, 0x7fc00000, v1
5342-
; GFX900-SDAG-NEXT: v_add_f32_e32 v0, v2, v0
5343-
; GFX900-SDAG-NEXT: v_exp_f32_e32 v0, v0
5344-
; GFX900-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v1
5345-
; GFX900-SDAG-NEXT: v_ldexp_f32 v0, v0, v1
5346-
; GFX900-SDAG-NEXT: s_setpc_b64 s[30:31]
5347-
;
5348-
; GFX900-GISEL-LABEL: v_exp10_f32_undef:
5349-
; GFX900-GISEL: ; %bb.0:
5350-
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5351-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
5352-
; GFX900-GISEL-NEXT: v_mul_f32_e32 v1, s4, v0
5353-
; GFX900-GISEL-NEXT: v_fma_f32 v0, s4, v0, -v1
5354-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
5355-
; GFX900-GISEL-NEXT: v_fma_f32 v0, s4, v2, v0
5356-
; GFX900-GISEL-NEXT: v_rndne_f32_e32 v2, v1
5357-
; GFX900-GISEL-NEXT: v_sub_f32_e32 v1, v1, v2
5358-
; GFX900-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
5359-
; GFX900-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v2
5360-
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
5361-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v2, 0x7f800000
5362-
; GFX900-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
5363-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0xc23369f4
5364-
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v1
5365-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x421a209b
5366-
; GFX900-GISEL-NEXT: v_cndmask_b32_e64 v0, v0, 0, vcc
5367-
; GFX900-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s4, v1
5368-
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
5369-
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
5370-
;
5371-
; SI-SDAG-LABEL: v_exp10_f32_undef:
5372-
; SI-SDAG: ; %bb.0:
5373-
; SI-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5374-
; SI-SDAG-NEXT: v_mov_b32_e32 v0, 0x40549a78
5375-
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0xffc00000
5376-
; SI-SDAG-NEXT: v_fma_f32 v0, s4, v0, v1
5377-
; SI-SDAG-NEXT: v_mov_b32_e32 v1, 0x33979a37
5378-
; SI-SDAG-NEXT: v_fma_f32 v0, s4, v1, v0
5379-
; SI-SDAG-NEXT: v_rndne_f32_e32 v1, 0x7fc00000
5380-
; SI-SDAG-NEXT: v_sub_f32_e32 v2, 0x7fc00000, v1
5381-
; SI-SDAG-NEXT: v_add_f32_e32 v0, v2, v0
5382-
; SI-SDAG-NEXT: v_exp_f32_e32 v0, v0
5383-
; SI-SDAG-NEXT: v_cvt_i32_f32_e32 v1, v1
5384-
; SI-SDAG-NEXT: v_ldexp_f32_e32 v0, v0, v1
5385-
; SI-SDAG-NEXT: s_setpc_b64 s[30:31]
5294+
; GCN-LABEL: v_exp10_f32_undef:
5295+
; GCN: ; %bb.0:
5296+
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5297+
; GCN-NEXT: s_setpc_b64 s[30:31]
53865298
;
5387-
; SI-GISEL-LABEL: v_exp10_f32_undef:
5388-
; SI-GISEL: ; %bb.0:
5389-
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5390-
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0x40549a78
5391-
; SI-GISEL-NEXT: v_mul_f32_e32 v1, s4, v0
5392-
; SI-GISEL-NEXT: v_fma_f32 v0, s4, v0, -v1
5393-
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x33979a37
5394-
; SI-GISEL-NEXT: v_fma_f32 v0, s4, v2, v0
5395-
; SI-GISEL-NEXT: v_rndne_f32_e32 v2, v1
5396-
; SI-GISEL-NEXT: v_sub_f32_e32 v1, v1, v2
5397-
; SI-GISEL-NEXT: v_add_f32_e32 v0, v1, v0
5398-
; SI-GISEL-NEXT: v_cvt_i32_f32_e32 v1, v2
5399-
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
5400-
; SI-GISEL-NEXT: v_mov_b32_e32 v2, 0x7f800000
5401-
; SI-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
5402-
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0xc23369f4
5403-
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v1
5404-
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x421a209b
5405-
; SI-GISEL-NEXT: v_cndmask_b32_e64 v0, v0, 0, vcc
5406-
; SI-GISEL-NEXT: v_cmp_gt_f32_e32 vcc, s4, v1
5407-
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v0, v2, vcc
5408-
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
5299+
; SI-LABEL: v_exp10_f32_undef:
5300+
; SI: ; %bb.0:
5301+
; SI-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
5302+
; SI-NEXT: s_setpc_b64 s[30:31]
54095303
;
54105304
; R600-LABEL: v_exp10_f32_undef:
54115305
; R600: ; %bb.0:

llvm/test/CodeGen/AMDGPU/llvm.exp2.ll

Lines changed: 5 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2783,56 +2783,10 @@ define float @v_exp2_f32_dynamic_mode(float %in) #1 {
27832783
}
27842784

27852785
define float @v_exp2_f32_undef() {
2786-
; GCN-SDAG-LABEL: v_exp2_f32_undef:
2787-
; GCN-SDAG: ; %bb.0:
2788-
; GCN-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2789-
; GCN-SDAG-NEXT: v_exp_f32_e32 v0, 0x7fc00000
2790-
; GCN-SDAG-NEXT: s_setpc_b64 s[30:31]
2791-
;
2792-
; SI-GISEL-LABEL: v_exp2_f32_undef:
2793-
; SI-GISEL: ; %bb.0:
2794-
; SI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2795-
; SI-GISEL-NEXT: v_mov_b32_e32 v0, 0xc2fc0000
2796-
; SI-GISEL-NEXT: v_mov_b32_e32 v1, 0x42800000
2797-
; SI-GISEL-NEXT: v_add_f32_e32 v1, s4, v1
2798-
; SI-GISEL-NEXT: v_add_f32_e64 v2, s4, 0
2799-
; SI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v0
2800-
; SI-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
2801-
; SI-GISEL-NEXT: v_exp_f32_e32 v0, v0
2802-
; SI-GISEL-NEXT: v_not_b32_e32 v1, 63
2803-
; SI-GISEL-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
2804-
; SI-GISEL-NEXT: v_ldexp_f32_e32 v0, v0, v1
2805-
; SI-GISEL-NEXT: s_setpc_b64 s[30:31]
2806-
;
2807-
; VI-GISEL-LABEL: v_exp2_f32_undef:
2808-
; VI-GISEL: ; %bb.0:
2809-
; VI-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2810-
; VI-GISEL-NEXT: v_mov_b32_e32 v0, 0xc2fc0000
2811-
; VI-GISEL-NEXT: v_mov_b32_e32 v1, 0x42800000
2812-
; VI-GISEL-NEXT: v_add_f32_e32 v1, s4, v1
2813-
; VI-GISEL-NEXT: v_add_f32_e64 v2, s4, 0
2814-
; VI-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v0
2815-
; VI-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
2816-
; VI-GISEL-NEXT: v_exp_f32_e32 v0, v0
2817-
; VI-GISEL-NEXT: v_not_b32_e32 v1, 63
2818-
; VI-GISEL-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
2819-
; VI-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
2820-
; VI-GISEL-NEXT: s_setpc_b64 s[30:31]
2821-
;
2822-
; GFX900-GISEL-LABEL: v_exp2_f32_undef:
2823-
; GFX900-GISEL: ; %bb.0:
2824-
; GFX900-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2825-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v0, 0xc2fc0000
2826-
; GFX900-GISEL-NEXT: v_mov_b32_e32 v1, 0x42800000
2827-
; GFX900-GISEL-NEXT: v_add_f32_e32 v1, s4, v1
2828-
; GFX900-GISEL-NEXT: v_add_f32_e64 v2, s4, 0
2829-
; GFX900-GISEL-NEXT: v_cmp_lt_f32_e32 vcc, s4, v0
2830-
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v0, v2, v1, vcc
2831-
; GFX900-GISEL-NEXT: v_exp_f32_e32 v0, v0
2832-
; GFX900-GISEL-NEXT: v_not_b32_e32 v1, 63
2833-
; GFX900-GISEL-NEXT: v_cndmask_b32_e32 v1, 0, v1, vcc
2834-
; GFX900-GISEL-NEXT: v_ldexp_f32 v0, v0, v1
2835-
; GFX900-GISEL-NEXT: s_setpc_b64 s[30:31]
2786+
; GCN-LABEL: v_exp2_f32_undef:
2787+
; GCN: ; %bb.0:
2788+
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
2789+
; GCN-NEXT: s_setpc_b64 s[30:31]
28362790
;
28372791
; R600-LABEL: v_exp2_f32_undef:
28382792
; R600: ; %bb.0:
@@ -4076,3 +4030,4 @@ attributes #1 = { "denormal-fp-math-f32"="dynamic,dynamic" }
40764030
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
40774031
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
40784032
; GCN-GISEL: {{.*}}
4033+
; GCN-SDAG: {{.*}}

0 commit comments

Comments
 (0)