<html>
<head>
<base href="https://llvm.org/bugs/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - ppc backend tail call optimization is not enabled"
href="https://llvm.org/bugs/show_bug.cgi?id=25617">25617</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ppc backend tail call optimization is not enabled
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: PowerPC
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>carrot@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Compile the following code with command line
~/llvm/obj/bin/clang++ --target=powerpc64le-grtev4-linux-gnu -c -o t2.o -O2
-m64 -mvsx -mcpu=power8 t2.cpp -save-temps
extern void bar();
void fint()
{
bar();
}
I got:
_Z4fintv: # @_Z4fintv
.Lfunc_begin0:
.cfi_startproc
.Ltmp0:
addis 2, 12, .TOC.-.Ltmp0@ha
addi 2, 2, .TOC.-.Ltmp0@l
.Ltmp1:
.localentry _Z4fintv, .Ltmp1-.Ltmp0
# BB#0: # %entry
mflr 0
std 31, -8(1)
std 0, 16(1)
stdu 1, -112(1)
.Ltmp2:
.cfi_def_cfa_offset 112
.Ltmp3:
.cfi_offset r31, -8
.Ltmp4:
.cfi_offset lr, 16
mr 31, 1
.Ltmp5:
.cfi_def_cfa_register r31
bl _Z3barv
nop
addi 1, 1, 112
ld 0, 16(1)
ld 31, -8(1)
mtlr 0
blr
It is actually marked as tail call in the tail call optimization pass, but
later it is lowered to normal function call
*** IR Dump After Module Verifier ***
define void @_Z4fintv() #0 {
entry:
tail call void @_Z3barv()
ret void
}
# *** IR Dump After PowerPC DAG->DAG Pattern Instruction Selection ***:
# Machine code for function _Z4fintv: SSA
BB#0: derived from LLVM BB %entry
ADJCALLSTACKDOWN 96, %R1<imp-def,dead>, %R1<imp-use>
BL8_NOP <ga:@_Z3barv>, <regmask %CR2 %CR3 %CR4 %F14 %F15 %F16 %F17 %F18
%F19 %F20 %F21 %F22 %F23 %F24 %F25 %F26 %F27 %F28 %F29 %F30 %F31 %R14 %R15 %R16
%R17 %R18 %R19 %R20 %R21 %R22 %R23 %R24 %R25 %R26 %R27 %R28 %R29 %R30 %R31 %V20
%V21 %V22 %V23 %V24 %V25 %V26 %V27 %V28 %V29 %V30 %V31 %VF20 %VF21 %VF22 %VF23
%VF24 %VF25 %VF26 %VF27 %VF28 %VF29 %VF30 %VF31 %X14 %X15 %X16 %X17 %X18 %X19
%X20 %X21 %X22 %X23 %X24 %X25 %X26 %X27 %X28 %X29 %X30 %X31 %CR2EQ %CR3EQ
%CR4EQ %CR2GT %CR3GT %CR4GT %CR2LT %CR3LT %CR4LT %CR2UN %CR3UN %CR4UN>,
%LR8<imp-def,dead>, %RM<imp-use>, %X2<imp-use>, %R1<imp-def>
ADJCALLSTACKUP 96, 0, %R1<imp-def,dead>, %R1<imp-use>
BLR8 %LR8<imp-use>, %RM<imp-use>
# End machine code for function _Z4fintv.
It turns out that option getTargetMachine().Options.GuaranteedTailCallOpt is
false.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>