Skip to content

Commit e6e857c

Browse files
authored
[GISel] Use Function::getFunctionType() instead of getType() in some remarks. (#107651)
getType() on a Function is always 'ptr'. We should use getFunctionType() so we get the function signature.
1 parent 9a84afe commit e6e857c

File tree

4 files changed

+17
-15
lines changed

4 files changed

+17
-15
lines changed

llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3943,7 +3943,8 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
39433943
if (CLI->fallBackToDAGISel(*MF)) {
39443944
OptimizationRemarkMissed R("gisel-irtranslator", "GISelFailure",
39453945
F.getSubprogram(), &F.getEntryBlock());
3946-
R << "unable to lower function: " << ore::NV("Prototype", F.getType());
3946+
R << "unable to lower function: "
3947+
<< ore::NV("Prototype", F.getFunctionType());
39473948
reportTranslationError(*MF, *TPC, *ORE, R);
39483949
return false;
39493950
}
@@ -3965,7 +3966,8 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
39653966
if (!CLI->lowerFormalArguments(*EntryBuilder, F, VRegArgs, FuncInfo)) {
39663967
OptimizationRemarkMissed R("gisel-irtranslator", "GISelFailure",
39673968
F.getSubprogram(), &F.getEntryBlock());
3968-
R << "unable to lower arguments: " << ore::NV("Prototype", F.getType());
3969+
R << "unable to lower arguments: "
3970+
<< ore::NV("Prototype", F.getFunctionType());
39693971
reportTranslationError(*MF, *TPC, *ORE, R);
39703972
return false;
39713973
}

llvm/test/CodeGen/ARM/GlobalISel/arm-unsupported.ll

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,41 +8,41 @@
88
; be unsupported on the ARM target. It should progressively shrink in size.
99

1010
define <4 x i32> @test_int_vectors(<4 x i32> %a, <4 x i32> %b) {
11-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
11+
; CHECK: remark: {{.*}} unable to lower arguments: <4 x i32> (<4 x i32>, <4 x i32>)
1212
; CHECK-LABEL: warning: Instruction selection used fallback path for test_int_vectors
1313
%res = add <4 x i32> %a, %b
1414
ret <4 x i32> %res
1515
}
1616

1717
define <4 x float> @test_float_vectors(<4 x float> %a, <4 x float> %b) {
18-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
18+
; CHECK: remark: {{.*}} unable to lower arguments: <4 x float> (<4 x float>, <4 x float>)
1919
; CHECK-LABEL: warning: Instruction selection used fallback path for test_float_vectors
2020
%res = fadd <4 x float> %a, %b
2121
ret <4 x float> %res
2222
}
2323

2424
define i64 @test_i64(i64 %a, i64 %b) {
25-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
25+
; CHECK: remark: {{.*}} unable to lower arguments: i64 (i64, i64)
2626
; CHECK-LABEL: warning: Instruction selection used fallback path for test_i64
2727
%res = add i64 %a, %b
2828
ret i64 %res
2929
}
3030

3131
define void @test_i64_arr([1 x i64] %a) {
32-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
32+
; CHECK: remark: {{.*}} unable to lower arguments: void ([1 x i64])
3333
; CHECK-LABEL: warning: Instruction selection used fallback path for test_i64_arr
3434
ret void
3535
}
3636

3737
define i128 @test_i128(i128 %a, i128 %b) {
38-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
38+
; CHECK: remark: {{.*}} unable to lower arguments: i128 (i128, i128)
3939
; CHECK-LABEL: warning: Instruction selection used fallback path for test_i128
4040
%res = add i128 %a, %b
4141
ret i128 %res
4242
}
4343

4444
define i17 @test_funny_ints(i17 %a, i17 %b) {
45-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
45+
; CHECK: remark: {{.*}} unable to lower arguments: i17 (i17, i17)
4646
; CHECK-LABEL: warning: Instruction selection used fallback path for test_funny_ints
4747
%res = add i17 %a, %b
4848
ret i17 %res
@@ -78,27 +78,27 @@ define %large.struct @test_large_struct_return() {
7878
%mixed.struct = type {ptr, float, i32}
7979

8080
define %mixed.struct @test_mixed_struct(%mixed.struct %x) {
81-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
81+
; CHECK: remark: {{.*}} unable to lower arguments: %mixed.struct (%mixed.struct)
8282
; CHECK-LABEL: warning: Instruction selection used fallback path for test_mixed_struct
8383
ret %mixed.struct %x
8484
}
8585

8686
%bad.element.type = type {i24, i24}
8787

8888
define void @test_bad_element_struct(%bad.element.type %x) {
89-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
89+
; CHECK: remark: {{.*}} unable to lower arguments: void (%bad.element.type)
9090
; CHECK-LABEL: warning: Instruction selection used fallback path for test_bad_element_struct
9191
ret void
9292
}
9393

9494
define void @test_vararg_definition(i32 %a, ...) {
95-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
95+
; CHECK: remark: {{.*}} unable to lower arguments: void (i32, ...)
9696
; CHECK-LABEL: warning: Instruction selection used fallback path for test_vararg_definition
9797
ret void
9898
}
9999

100100
define i32 @test_thumb(i32 %a) #0 {
101-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
101+
; CHECK: remark: {{.*}} unable to lower arguments: i32 (i32)
102102
; CHECK-LABEL: warning: Instruction selection used fallback path for test_thumb
103103
ret i32 %a
104104
}
@@ -123,7 +123,7 @@ define i32 @test_thread_local_global() {
123123
%byval.class = type { i32 }
124124

125125
define void @test_byval_arg(ptr byval(%byval.class) %x) {
126-
; CHECK: remark: {{.*}} unable to lower arguments: ptr
126+
; CHECK: remark: {{.*}} unable to lower arguments: void (ptr)
127127
; CHECK-LABEL: warning: Instruction selection used fallback path for test_byval
128128
ret void
129129
}

llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/vec-args-bf16-err.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ entry:
1111
ret void
1212
}
1313

14-
; CHECK: LLVM ERROR: unable to lower arguments: ptr (in function: test_args_nxv1bf16)
14+
; CHECK: LLVM ERROR: unable to lower arguments: void (<vscale x 1 x bfloat>) (in function: test_args_nxv1bf16)
1515

1616

llvm/test/CodeGen/RISCV/GlobalISel/irtranslator/vec-args-f16-err.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ entry:
1111
ret void
1212
}
1313

14-
; CHECK: LLVM ERROR: unable to lower arguments: ptr (in function: test_args_nxv1f16)
14+
; CHECK: LLVM ERROR: unable to lower arguments: void (<vscale x 1 x half>) (in function: test_args_nxv1f16)
1515

1616

0 commit comments

Comments
 (0)