[IPRA] IPRA Partially Clobbers FP/ST Registers, Breaking X86Stackifier Assumptions
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
IPRA currently updates the clobbered registers of a call instruction by limiting them to the registers explicitly used by the corresponding callee functions.
For FP and ST registers, IPRA marks only the individually used registers as clobbered instead of marking the entire register group. This behavior is inconsistent with x86 ABI conventions, where FP and ST registers are treated as all-or-nothing clobber groups.
PASS: clang -c -O1 -mllvm -enable-ipra=false test.ll
FAIL: clang -c -O1 -mllvm -enable-ipra=true test.ll
test.ll
define internal x86_fp80 @callee(x86_fp80 %a) #0 {
entry:
%mul = fmul x86_fp80 %a, %a
ret x86_fp80 %mul
}
define x86_fp80 @caller(x86_fp80 %x) {
entry:
%pre = fadd x86_fp80 %x, 0xK4000C90FDAA22168C235
%call = call x86_fp80 @callee(x86_fp80 %pre)
%post = fsub x86_fp80 %call, %x
ret x86_fp80 %post
}
attributes #0 = { noinline }
Contributor guide
Assessment
This issue has not been assessed yet.