mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2026-08-25 14:10:28 -04:00
[PR #11] [MERGED] Fix GHC tail calls for arm64 #14
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/RPCS3/llvm-mirror/pull/11
Author: @sguo35
Created: 4/28/2022
Status: ✅ Merged
Merged: 5/5/2022
Merged by: @undefined
Base:
master← Head:master📝 Commits (1)
94c3e89Fix tail call guarantee setting for GHC on arm64 backend📊 Changes
1 file changed (+2 additions, -1 deletions)
View changed files
📝
lib/Target/AArch64/AArch64ISelLowering.cpp(+2 -1)📄 Description
ELF breaks on arm64 macOS due to some relocation issue and errors out in LLVM backend. Using MachO fails to generate trampolines. COFF seems to work if we remove the checks that limit it to Windows targets.GHC tail call is also broken on arm64. No idea why this isn't an issue in GHC upstream but both
mayTailCallThisCCandcanGuaranteeTCOwere returning false for GHC because GHC wasn't set as a case. This led to tail call returns silently failing because LLVM in arm64 is set to ignore prologue/epilogue for GHC but because LLVM thinks tail calls are disabled for GHC it uses branch and link to call functions leading to infinite loop on function return asrettries to jump tolrbutlris the address ofret. I fixed this to match the x86 backend which does mark GHC as guaranteed TCO.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.