https://llvm.org/bugs/show_bug.cgi?id=28569
Bug ID: 28569 Summary: [IPRA] Failed to mark return address register as clobbered Product: libraries Version: trunk Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Register Allocator Assignee: unassignedb...@nondot.org Reporter: zyfw...@gmail.com CC: llvm-bugs@lists.llvm.org Classification: Unclassified === ipra-call.c === __attribute__((noinline)) int foo2(int b) { return b + 2; } __attribute__((noinline)) int bar2(int b) { return b + foo2(b); } $ clang -target arm -Oz -emit-llvm -S ipra-call.c -o ipra-call.ll $ llc -march=arm ipra-call.ll -enable-ipra=true -print-regusage bar2 Clobbered Registers: SP R0 R1 R2 R3 R12 R12_SP R0_R1 R2_R3 foo2 Clobbered Registers: R0 R1 R0_R1 ===== ipra-call.s ===== foo2: @ @foo2 add r0, r0, #2 mov pc, lr bar2: @ @bar2 push {r11, lr} mov r11, sp mov r2, r0 bl foo2 add r0, r0, r2 pop {r11, lr} mov pc, lr I think bar2 should mark LR as Clobbered. Current implementation thinks that a `call foo' instruction only clobbers registers that clobbers by function `foo', but it's not true: `call foo' will clobbers both registers clobbers by function `foo' and other physical registers , in this case, LR. -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs