Skip to content

Commit 0bf179d

Browse files
SC llvm teamSC llvm team
authored andcommitted
Merged main:33b02d766eb8 into amd-gfx:dce9ce0015f4
Local branch amd-gfx dce9ce0 Merged main:5bff905c0de5 into amd-gfx:edb7917766d3 Remote branch main 33b02d7 [NFC][Clang] Fix static code analyzer concern about null value dereference
2 parents dce9ce0 + 33b02d7 commit 0bf179d

File tree

30 files changed

+593
-394
lines changed

30 files changed

+593
-394
lines changed

.github/workflows/new-prs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ jobs:
1313
- uses: actions/labeler@v4
1414
with:
1515
configuration-path: .github/new-prs-labeler.yml
16-
sync-labels: false
16+
# workaround for https://github.com/actions/labeler/issues/112
17+
sync-labels: ''

clang/include/clang/Format/Format.h

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4050,43 +4050,43 @@ struct FormatStyle {
40504050
/// true: false:
40514051
/// if (...) {} vs. if(...) {}
40524052
/// \endcode
4053-
bool AfterControlStatements = false;
4053+
bool AfterControlStatements;
40544054
/// If ``true``, put space between foreach macros and opening parentheses.
40554055
/// \code
40564056
/// true: false:
40574057
/// FOREACH (...) vs. FOREACH(...)
40584058
/// <loop-body> <loop-body>
40594059
/// \endcode
4060-
bool AfterForeachMacros = false;
4060+
bool AfterForeachMacros;
40614061
/// If ``true``, put a space between function declaration name and opening
40624062
/// parentheses.
40634063
/// \code
40644064
/// true: false:
40654065
/// void f (); vs. void f();
40664066
/// \endcode
4067-
bool AfterFunctionDeclarationName = false;
4067+
bool AfterFunctionDeclarationName;
40684068
/// If ``true``, put a space between function definition name and opening
40694069
/// parentheses.
40704070
/// \code
40714071
/// true: false:
40724072
/// void f () {} vs. void f() {}
40734073
/// \endcode
4074-
bool AfterFunctionDefinitionName = false;
4074+
bool AfterFunctionDefinitionName;
40754075
/// If ``true``, put space between if macros and opening parentheses.
40764076
/// \code
40774077
/// true: false:
40784078
/// IF (...) vs. IF(...)
40794079
/// <conditional-body> <conditional-body>
40804080
/// \endcode
4081-
bool AfterIfMacros = false;
4081+
bool AfterIfMacros;
40824082
/// If ``true``, put a space between operator overloading and opening
40834083
/// parentheses.
40844084
/// \code
40854085
/// true: false:
40864086
/// void operator++ (int a); vs. void operator++(int a);
40874087
/// object.operator++ (10); object.operator++(10);
40884088
/// \endcode
4089-
bool AfterOverloadedOperator = false;
4089+
bool AfterOverloadedOperator;
40904090
/// If ``true``, put space between requires keyword in a requires clause and
40914091
/// opening parentheses, if there is one.
40924092
/// \code
@@ -4095,7 +4095,7 @@ struct FormatStyle {
40954095
/// requires (A<T> && B<T>) requires(A<T> && B<T>)
40964096
/// ... ...
40974097
/// \endcode
4098-
bool AfterRequiresInClause = false;
4098+
bool AfterRequiresInClause;
40994099
/// If ``true``, put space between requires keyword in a requires expression
41004100
/// and opening parentheses.
41014101
/// \code
@@ -4105,17 +4105,22 @@ struct FormatStyle {
41054105
/// ... ...
41064106
/// } }
41074107
/// \endcode
4108-
bool AfterRequiresInExpression = false;
4108+
bool AfterRequiresInExpression;
41094109
/// If ``true``, put a space before opening parentheses only if the
41104110
/// parentheses are not empty.
41114111
/// \code
41124112
/// true: false:
41134113
/// void f (int a); vs. void f();
41144114
/// f (a); f();
41154115
/// \endcode
4116-
bool BeforeNonEmptyParentheses = false;
4116+
bool BeforeNonEmptyParentheses;
41174117

4118-
SpaceBeforeParensCustom() = default;
4118+
SpaceBeforeParensCustom()
4119+
: AfterControlStatements(false), AfterForeachMacros(false),
4120+
AfterFunctionDeclarationName(false),
4121+
AfterFunctionDefinitionName(false), AfterIfMacros(false),
4122+
AfterOverloadedOperator(false), AfterRequiresInClause(false),
4123+
AfterRequiresInExpression(false), BeforeNonEmptyParentheses(false) {}
41194124

41204125
bool operator==(const SpaceBeforeParensCustom &Other) const {
41214126
return AfterControlStatements == Other.AfterControlStatements &&

clang/lib/Format/UnwrappedLineFormatter.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,14 @@ class LineJoiner {
386386
// Reduce indent level for bodies of namespaces which were compacted,
387387
// but only if their content was indented in the first place.
388388
auto *ClosingLine = AnnotatedLines.begin() + ClosingLineIndex + 1;
389-
auto OutdentBy = I[J]->Level - TheLine->Level;
389+
const int OutdentBy = I[J]->Level - TheLine->Level;
390+
assert(OutdentBy >= 0);
390391
for (auto *CompactedLine = I + J; CompactedLine <= ClosingLine;
391392
++CompactedLine) {
392-
if (!(*CompactedLine)->InPPDirective)
393-
(*CompactedLine)->Level -= OutdentBy;
393+
if (!(*CompactedLine)->InPPDirective) {
394+
const int Level = (*CompactedLine)->Level;
395+
(*CompactedLine)->Level = std::max(Level - OutdentBy, 0);
396+
}
394397
}
395398
}
396399
return J - 1;

clang/lib/Lex/PPDirectives.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,9 @@ void Preprocessor::SkipExcludedConditionalBlock(SourceLocation HashTokenLoc,
491491
llvm::SaveAndRestore SARSkipping(SkippingExcludedConditionalBlock, true);
492492

493493
++NumSkipped;
494-
assert(!CurTokenLexer && CurPPLexer && "Lexing a macro, not a file?");
494+
assert(!CurTokenLexer && "Conditional PP block cannot appear in a macro!");
495+
assert(CurPPLexer && "Conditional PP block must be in a file!");
496+
assert(CurLexer && "Conditional PP block but no current lexer set!");
495497

496498
if (PreambleConditionalStack.reachedEOFWhileSkipping())
497499
PreambleConditionalStack.clearSkipInfo();

clang/test/CodeGen/ffp-model.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ float mymuladd(float x, float y, float z) {
4949

5050
typedef float __attribute__((ext_vector_type(2))) v2f;
5151

52-
v2f my_vec_muladd(v2f x, float y, v2f z) {
53-
// CHECK: define{{.*}} @my_vec_muladd
54-
return x * y + z;
52+
void my_vec_muladd(v2f x, float y, v2f z, v2f *res) {
53+
// CHECK: define{{.*}}@my_vec_muladd
54+
*res = x * y + z;
5555

5656
// CHECK-FAST: fmul fast <2 x float>
5757
// CHECK-FAST: load <2 x float>, ptr
@@ -83,9 +83,9 @@ v2f my_vec_muladd(v2f x, float y, v2f z) {
8383

8484
typedef float __attribute__((matrix_type(2, 1))) m21f;
8585

86-
m21f my_m21_muladd(m21f x, float y, m21f z) {
87-
// CHECK: define{{.*}} <2 x float> @my_m21_muladd
88-
return x * y + z;
86+
void my_m21_muladd(m21f x, float y, m21f z, m21f *res) {
87+
// CHECK: define{{.*}}@my_m21_muladd
88+
*res = x * y + z;
8989

9090
// CHECK-FAST: fmul fast <2 x float>
9191
// CHECK-FAST: load <2 x float>, ptr
@@ -117,9 +117,9 @@ m21f my_m21_muladd(m21f x, float y, m21f z) {
117117

118118
typedef float __attribute__((matrix_type(2, 2))) m22f;
119119

120-
m22f my_m22_muladd(m22f x, float y, m22f z) {
121-
// CHECK: define{{.*}} <4 x float> @my_m22_muladd
122-
return x * y + z;
120+
void my_m22_muladd(m22f x, float y, m22f z, m22f *res) {
121+
// CHECK: define{{.*}}@my_m22_muladd
122+
*res = x * y + z;
123123

124124
// CHECK-FAST: fmul fast <4 x float>
125125
// CHECK-FAST: load <4 x float>, ptr

clang/unittests/Format/FormatTest.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4180,6 +4180,16 @@ TEST_F(FormatTest, FormatsNamespaces) {
41804180
"void foo() {}\n"
41814181
"} // namespace ns",
41824182
Style);
4183+
4184+
FormatStyle LLVMWithCompactInnerNamespace = getLLVMStyle();
4185+
LLVMWithCompactInnerNamespace.CompactNamespaces = true;
4186+
LLVMWithCompactInnerNamespace.NamespaceIndentation = FormatStyle::NI_Inner;
4187+
verifyFormat("namespace ns1 { namespace ns2 { namespace ns3 {\n"
4188+
"// block for debug mode\n"
4189+
"#ifndef NDEBUG\n"
4190+
"#endif\n"
4191+
"}}} // namespace ns1::ns2::ns3",
4192+
LLVMWithCompactInnerNamespace);
41834193
}
41844194

41854195
TEST_F(FormatTest, NamespaceMacros) {

compiler-rt/lib/scudo/standalone/report.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ void NORETURN reportAllocationSizeTooBig(uptr UserSize, uptr TotalSize,
3434
uptr MaxSize);
3535
void NORETURN reportOutOfBatchClass();
3636
void NORETURN reportOutOfMemory(uptr RequestedSize);
37-
void NORETURN reportSoftRSSLimit(uptr RssLimitMb);
38-
void NORETURN reportHardRSSLimit(uptr RssLimitMb);
3937
enum class AllocatorAction : u8 {
4038
Recycling,
4139
Deallocating,

llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,10 +453,14 @@ class CombinerHelper {
453453
/// equivalent instructions.
454454
bool matchEqualDefs(const MachineOperand &MOP1, const MachineOperand &MOP2);
455455

456-
/// Return true if \p MOP is defined by a G_CONSTANT with a value equal to
456+
/// Return true if \p MOP is defined by a G_CONSTANT or splat with a value equal to
457457
/// \p C.
458458
bool matchConstantOp(const MachineOperand &MOP, int64_t C);
459459

460+
/// Return true if \p MOP is defined by a G_FCONSTANT or splat with a value exactly
461+
/// equal to \p C.
462+
bool matchConstantFPOp(const MachineOperand &MOP, double C);
463+
460464
/// Optimize (cond ? x : x) -> x
461465
bool matchSelectSameVal(MachineInstr &MI);
462466

llvm/include/llvm/Config/llvm-config.h.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
/* Indicate that this is LLVM compiled from the amd-gfx branch. */
1818
#define LLVM_HAVE_BRANCH_AMD_GFX
19-
#define LLVM_MAIN_REVISION 473632
19+
#define LLVM_MAIN_REVISION 473645
2020

2121
/* Define if LLVM_ENABLE_DUMP is enabled */
2222
#cmakedefine LLVM_ENABLE_DUMP

llvm/include/llvm/Target/GlobalISel/Combine.td

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,12 +429,21 @@ def right_identity_zero: GICombineRule<
429429
>;
430430

431431
// Fold x op 1 -> x
432-
def right_identity_one: GICombineRule<
432+
def right_identity_one_int: GICombineRule<
433433
(defs root:$dst),
434434
(match (G_MUL $dst, $x, 1)),
435435
(apply (GIReplaceReg $dst, $x))
436436
>;
437437

438+
def right_identity_one_fp: GICombineRule<
439+
(defs root:$dst),
440+
(match (G_FMUL $dst, $x, $y):$root,
441+
[{ return Helper.matchConstantFPOp(${y}, 1.0); }]),
442+
(apply (GIReplaceReg $dst, $x))
443+
>;
444+
445+
def right_identity_one : GICombineGroup<[right_identity_one_int, right_identity_one_fp]>;
446+
438447
// Fold (x op x) - > x
439448
def binop_same_val_frags : GICombinePatFrag<
440449
(outs root:$dst), (ins $x),

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,6 +2563,16 @@ bool CombinerHelper::matchConstantOp(const MachineOperand &MOP, int64_t C) {
25632563
MaybeCst->getSExtValue() == C;
25642564
}
25652565

2566+
bool CombinerHelper::matchConstantFPOp(const MachineOperand &MOP, double C) {
2567+
if (!MOP.isReg())
2568+
return false;
2569+
std::optional<FPValueAndVReg> MaybeCst;
2570+
if (!mi_match(MOP.getReg(), MRI, m_GFCstOrSplat(MaybeCst)))
2571+
return false;
2572+
2573+
return MaybeCst->Value.isExactlyValue(C);
2574+
}
2575+
25662576
void CombinerHelper::replaceSingleDefInstWithOperand(MachineInstr &MI,
25672577
unsigned OpIdx) {
25682578
assert(MI.getNumExplicitDefs() == 1 && "Expected one explicit def?");

llvm/test/CodeGen/AArch64/GlobalISel/combine-mul.mir

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,43 @@ body: |
6464
$x0 = COPY %2(s64)
6565
...
6666
---
67+
name: fmul_by_one
68+
tracksRegLiveness: true
69+
body: |
70+
bb.0:
71+
liveins: $d0
72+
; CHECK-LABEL: name: fmul_by_one
73+
; CHECK: liveins: $d0
74+
; CHECK-NEXT: {{ $}}
75+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $d0
76+
; CHECK-NEXT: $d0 = COPY [[COPY]](s64)
77+
%0:_(s64) = COPY $d0
78+
%1:_(s64) = G_FCONSTANT double 1.000000e+00
79+
%2:_(s64) = G_FMUL %0, %1(s64)
80+
$d0 = COPY %2(s64)
81+
...
82+
---
83+
name: fmul_vector_by_one
84+
alignment: 4
85+
tracksRegLiveness: true
86+
frameInfo:
87+
maxAlignment: 1
88+
machineFunctionInfo: {}
89+
body: |
90+
bb.0:
91+
liveins: $q0
92+
; CHECK-LABEL: name: fmul_vector_by_one
93+
; CHECK: liveins: $q0
94+
; CHECK-NEXT: {{ $}}
95+
; CHECK-NEXT: [[COPY:%[0-9]+]]:_(<4 x s32>) = COPY $q0
96+
; CHECK-NEXT: $q0 = COPY [[COPY]](<4 x s32>)
97+
%0:_(<4 x s32>) = COPY $q0
98+
%1:_(s32) = G_FCONSTANT float 1.0
99+
%2:_(<4 x s32>) = G_BUILD_VECTOR %1(s32), %1(s32), %1(s32), %1(s32)
100+
%3:_(<4 x s32>) = G_FMUL %0, %2(<4 x s32>)
101+
$q0 = COPY %3(<4 x s32>)
102+
...
103+
---
67104
name: mul_vector_by_one
68105
alignment: 4
69106
tracksRegLiveness: true

llvm/test/CodeGen/AMDGPU/GlobalISel/fdiv.f16.ll

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,10 +1725,7 @@ define <2 x half> @v_rcp_v2f16_arcp(<2 x half> %x) {
17251725
; GFX8: ; %bb.0:
17261726
; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
17271727
; GFX8-NEXT: v_rcp_f16_e32 v1, v0
1728-
; GFX8-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
1729-
; GFX8-NEXT: v_mov_b32_e32 v2, 0x3c00
1730-
; GFX8-NEXT: v_mul_f16_e32 v1, 1.0, v1
1731-
; GFX8-NEXT: v_mul_f16_sdwa v0, v0, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
1728+
; GFX8-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1
17321729
; GFX8-NEXT: v_or_b32_e32 v0, v1, v0
17331730
; GFX8-NEXT: s_setpc_b64 s[30:31]
17341731
;
@@ -1737,8 +1734,6 @@ define <2 x half> @v_rcp_v2f16_arcp(<2 x half> %x) {
17371734
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
17381735
; GFX9-NEXT: v_rcp_f16_e32 v1, v0
17391736
; GFX9-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
1740-
; GFX9-NEXT: v_mul_f16_e32 v1, 1.0, v1
1741-
; GFX9-NEXT: v_mul_f16_e32 v0, 1.0, v0
17421737
; GFX9-NEXT: v_pack_b32_f16 v0, v1, v0
17431738
; GFX9-NEXT: s_setpc_b64 s[30:31]
17441739
;
@@ -1747,8 +1742,6 @@ define <2 x half> @v_rcp_v2f16_arcp(<2 x half> %x) {
17471742
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
17481743
; GFX10-NEXT: v_rcp_f16_e32 v1, v0
17491744
; GFX10-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
1750-
; GFX10-NEXT: v_mul_f16_e32 v1, 1.0, v1
1751-
; GFX10-NEXT: v_mul_f16_e32 v0, 1.0, v0
17521745
; GFX10-NEXT: v_pack_b32_f16 v0, v1, v0
17531746
; GFX10-NEXT: s_setpc_b64 s[30:31]
17541747
;
@@ -1759,8 +1752,6 @@ define <2 x half> @v_rcp_v2f16_arcp(<2 x half> %x) {
17591752
; GFX11-NEXT: v_rcp_f16_e32 v0, v0
17601753
; GFX11-NEXT: v_rcp_f16_e32 v1, v1
17611754
; GFX11-NEXT: s_waitcnt_depctr 0xfff
1762-
; GFX11-NEXT: v_mul_f16_e32 v0, 1.0, v0
1763-
; GFX11-NEXT: v_mul_f16_e32 v1, 1.0, v1
17641755
; GFX11-NEXT: v_pack_b32_f16 v0, v0, v1
17651756
; GFX11-NEXT: s_setpc_b64 s[30:31]
17661757
%fdiv = fdiv arcp <2 x half> <half 1.0, half 1.0>, %x
@@ -1786,10 +1777,7 @@ define <2 x half> @v_rcp_v2f16_arcp_afn(<2 x half> %x) {
17861777
; GFX8: ; %bb.0:
17871778
; GFX8-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
17881779
; GFX8-NEXT: v_rcp_f16_e32 v1, v0
1789-
; GFX8-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
1790-
; GFX8-NEXT: v_mov_b32_e32 v2, 0x3c00
1791-
; GFX8-NEXT: v_mul_f16_e32 v1, 1.0, v1
1792-
; GFX8-NEXT: v_mul_f16_sdwa v0, v0, v2 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:DWORD src1_sel:DWORD
1780+
; GFX8-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:WORD_1 dst_unused:UNUSED_PAD src0_sel:WORD_1
17931781
; GFX8-NEXT: v_or_b32_e32 v0, v1, v0
17941782
; GFX8-NEXT: s_setpc_b64 s[30:31]
17951783
;
@@ -1798,8 +1786,6 @@ define <2 x half> @v_rcp_v2f16_arcp_afn(<2 x half> %x) {
17981786
; GFX9-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
17991787
; GFX9-NEXT: v_rcp_f16_e32 v1, v0
18001788
; GFX9-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
1801-
; GFX9-NEXT: v_mul_f16_e32 v1, 1.0, v1
1802-
; GFX9-NEXT: v_mul_f16_e32 v0, 1.0, v0
18031789
; GFX9-NEXT: v_pack_b32_f16 v0, v1, v0
18041790
; GFX9-NEXT: s_setpc_b64 s[30:31]
18051791
;
@@ -1808,8 +1794,6 @@ define <2 x half> @v_rcp_v2f16_arcp_afn(<2 x half> %x) {
18081794
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
18091795
; GFX10-NEXT: v_rcp_f16_e32 v1, v0
18101796
; GFX10-NEXT: v_rcp_f16_sdwa v0, v0 dst_sel:DWORD dst_unused:UNUSED_PAD src0_sel:WORD_1
1811-
; GFX10-NEXT: v_mul_f16_e32 v1, 1.0, v1
1812-
; GFX10-NEXT: v_mul_f16_e32 v0, 1.0, v0
18131797
; GFX10-NEXT: v_pack_b32_f16 v0, v1, v0
18141798
; GFX10-NEXT: s_setpc_b64 s[30:31]
18151799
;
@@ -1820,8 +1804,6 @@ define <2 x half> @v_rcp_v2f16_arcp_afn(<2 x half> %x) {
18201804
; GFX11-NEXT: v_rcp_f16_e32 v0, v0
18211805
; GFX11-NEXT: v_rcp_f16_e32 v1, v1
18221806
; GFX11-NEXT: s_waitcnt_depctr 0xfff
1823-
; GFX11-NEXT: v_mul_f16_e32 v0, 1.0, v0
1824-
; GFX11-NEXT: v_mul_f16_e32 v1, 1.0, v1
18251807
; GFX11-NEXT: v_pack_b32_f16 v0, v0, v1
18261808
; GFX11-NEXT: s_setpc_b64 s[30:31]
18271809
%fdiv = fdiv arcp afn <2 x half> <half 1.0, half 1.0>, %x

llvm/test/CodeGen/AMDGPU/GlobalISel/fdiv.f32.ll

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1971,26 +1971,20 @@ define <2 x float> @v_rcp_v2f32_arcp_afn(<2 x float> %x) {
19711971
; GCN-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
19721972
; GCN-NEXT: v_rcp_f32_e32 v0, v0
19731973
; GCN-NEXT: v_rcp_f32_e32 v1, v1
1974-
; GCN-NEXT: v_mul_f32_e32 v0, 1.0, v0
1975-
; GCN-NEXT: v_mul_f32_e32 v1, 1.0, v1
19761974
; GCN-NEXT: s_setpc_b64 s[30:31]
19771975
;
19781976
; GFX10-LABEL: v_rcp_v2f32_arcp_afn:
19791977
; GFX10: ; %bb.0:
19801978
; GFX10-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
19811979
; GFX10-NEXT: v_rcp_f32_e32 v0, v0
19821980
; GFX10-NEXT: v_rcp_f32_e32 v1, v1
1983-
; GFX10-NEXT: v_mul_f32_e32 v0, 1.0, v0
1984-
; GFX10-NEXT: v_mul_f32_e32 v1, 1.0, v1
19851981
; GFX10-NEXT: s_setpc_b64 s[30:31]
19861982
;
19871983
; GFX11-LABEL: v_rcp_v2f32_arcp_afn:
19881984
; GFX11: ; %bb.0:
19891985
; GFX11-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
19901986
; GFX11-NEXT: v_rcp_f32_e32 v0, v0
19911987
; GFX11-NEXT: v_rcp_f32_e32 v1, v1
1992-
; GFX11-NEXT: s_waitcnt_depctr 0xfff
1993-
; GFX11-NEXT: v_dual_mul_f32 v0, 1.0, v0 :: v_dual_mul_f32 v1, 1.0, v1
19941988
; GFX11-NEXT: s_setpc_b64 s[30:31]
19951989
%fdiv = fdiv arcp afn <2 x float> <float 1.0, float 1.0>, %x
19961990
ret <2 x float> %fdiv

0 commit comments

Comments
 (0)