mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 05:24:01 +00:00
These are legal for tail calls
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21723 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -65,10 +65,13 @@ static Function *CreateFibFunction(Module *M) {
|
||||
// create fib(x-1)
|
||||
Value *Sub = BinaryOperator::createSub(ArgX, One, "arg", RecurseBB);
|
||||
Value *CallFibX1 = new CallInst(FibF, Sub, "fibx1", RecurseBB);
|
||||
CallFibX1->setTailCall(true);
|
||||
|
||||
// create fib(x-2)
|
||||
Sub = BinaryOperator::createSub(ArgX, Two, "arg", RecurseBB);
|
||||
Value *CallFibX2 = new CallInst(FibF, Sub, "fibx2", RecurseBB);
|
||||
CallFibX2->setTailCall(true);
|
||||
|
||||
|
||||
// fib(x-1)+fib(x-2)
|
||||
Value *Sum = BinaryOperator::createAdd(CallFibX1, CallFibX2,
|
||||
|
Reference in New Issue
Block a user