We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When building attached llvm IR the eflags used by liveins: $edi, $eflags, $esi renamable $r15b = SETCCr 8, implicit $eflags
are clobbered after prologue insertion: $rsp = frame-setup SUB64ri8 $rsp(tied-def 0), 8, implicit-def dead $eflags renamable $r15b = SETCCr 8, implicit $eflags
Before Prologue/Epilogue Insertion & Frame Finalization (prologepilog)
bb.4.bb16.i: ; predecessors: %bb.2 successors: %bb.8(0x40000000), %bb.5(0x40000000); %bb.8(50.00%), %bb.5(50.00%) liveins: $edi, $eflags, $esi renamable $r15b = SETCCr 8, implicit $eflags TEST32rr renamable $esi, renamable $esi, implicit-def $eflags renamable $r14b = SETCCr 8, implicit $eflags renamable $edx = COPY renamable $edi, implicit-def $rdx renamable $edx = NEG32r renamable $edx(tied-def 0), implicit-def $eflags, implicit killed $rdx, implicit-def $rdx renamable $edx = CMOV32rr renamable $edx(tied-def 0), killed renamable $edi, 12, implicit $eflags, implicit killed $rdx, implicit-def $rdx renamable $eax = COPY renamable $esi, implicit-def $rax renamable $eax = NEG32r renamable $eax(tied-def 0), implicit-def $eflags, implicit killed $rax, implicit-def $rax renamable $eax = CMOV32rr renamable $eax(tied-def 0), killed renamable $esi, 12, implicit $eflags, implicit killed $rax, implicit-def $rax renamable $ecx = LEA64_32r $noreg, 4, renamable $rdx, 0, $noreg, implicit-def $rcx TEST32ri renamable $edx, 1073741824, implicit-def $eflags, implicit killed $rdx JCC_1 %bb.8, 4, implicit $eflags JMP_1 %bb.5
After Prologue/Epilogue Insertion & Frame Finalization (prologepilog):
bb.4.bb16.i: ; predecessors: %bb.2 successors: %bb.8(0x40000000), %bb.5(0x40000000); %bb.8(50.00%), %bb.5(50.00%) liveins: $edi, $eflags, $esi, $rbp, $r15, $r14, $rbx frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp $rsp = frame-setup SUB64ri8 $rsp(tied-def 0), 8, implicit-def dead $eflags renamable $r15b = SETCCr 8, implicit $eflags TEST32rr renamable $esi, renamable $esi, implicit-def $eflags renamable $r14b = SETCCr 8, implicit $eflags renamable $edx = COPY renamable $edi, implicit-def $rdx renamable $edx = NEG32r renamable $edx(tied-def 0), implicit-def $eflags, implicit killed $rdx, implicit-def $rdx renamable $edx = CMOV32rr renamable $edx(tied-def 0), killed renamable $edi, 12, implicit $eflags, implicit killed $rdx, implicit-def $rdx renamable $eax = COPY renamable $esi, implicit-def $rax renamable $eax = NEG32r renamable $eax(tied-def 0), implicit-def $eflags, implicit killed $rax, implicit-def $rax renamable $eax = CMOV32rr renamable $eax(tied-def 0), killed renamable $esi, 12, implicit $eflags, implicit killed $rax, implicit-def $rax renamable $ecx = LEA64_32r $noreg, 4, renamable $rdx, 0, $noreg, implicit-def $rcx TEST32ri renamable $edx, 1073741824, implicit-def $eflags, implicit killed $rdx JCC_1 %bb.8, 4, implicit $eflags JMP_1 %bb.5
Originally reported in rust-lang/rust#84667
The text was updated successfully, but these errors were encountered:
Godbolt: https://godbolt.org/z/ns7xKjq8e
Sorry, something went wrong.
probe-stack=inline-asm
Here's a minimization from llvm-reduce: reduced.ll
llvm-reduce
The clobbering can be seen here, subq followed by sets that wanted the previous flags:
subq
sets
# %bb.0: # %bb13.i testl %edi, %edi je .LBB0_1 # %bb.2: # %bb16.i pushq %rbp pushq %rbx subq $8, %rsp sets %bl
I'm working on a patch for canUseAsPrologue to return false for blocks with live EFLAGS when stack probes are enabled.
canUseAsPrologue
false
26c37b4
[X86] Don't allow prologue stack probing with live EFLAGS
e85fffd
Fixes llvm/llvm-project#49509 Differential Revision: https://reviews.llvm.org/D134494
No branches or pull requests
Extended Description
When building attached llvm IR the eflags used by
liveins: $edi, $eflags, $esi
renamable $r15b = SETCCr 8, implicit $eflags
are clobbered after prologue insertion:
$rsp = frame-setup SUB64ri8 $rsp(tied-def 0), 8, implicit-def dead $eflags
renamable $r15b = SETCCr 8, implicit $eflags
Before Prologue/Epilogue Insertion & Frame Finalization (prologepilog)
bb.4.bb16.i:
; predecessors: %bb.2
successors: %bb.8(0x40000000), %bb.5(0x40000000); %bb.8(50.00%), %bb.5(50.00%)
liveins: $edi, $eflags, $esi
renamable $r15b = SETCCr 8, implicit $eflags
TEST32rr renamable $esi, renamable $esi, implicit-def $eflags
renamable $r14b = SETCCr 8, implicit $eflags
renamable $edx = COPY renamable $edi, implicit-def $rdx
renamable $edx = NEG32r renamable $edx(tied-def 0), implicit-def $eflags, implicit killed $rdx, implicit-def $rdx
renamable $edx = CMOV32rr renamable $edx(tied-def 0), killed renamable $edi, 12, implicit $eflags, implicit killed $rdx, implicit-def $rdx
renamable $eax = COPY renamable $esi, implicit-def $rax
renamable $eax = NEG32r renamable $eax(tied-def 0), implicit-def $eflags, implicit killed $rax, implicit-def $rax
renamable $eax = CMOV32rr renamable $eax(tied-def 0), killed renamable $esi, 12, implicit $eflags, implicit killed $rax, implicit-def $rax
renamable $ecx = LEA64_32r $noreg, 4, renamable $rdx, 0, $noreg, implicit-def $rcx
TEST32ri renamable $edx, 1073741824, implicit-def $eflags, implicit killed $rdx
JCC_1 %bb.8, 4, implicit $eflags
JMP_1 %bb.5
After Prologue/Epilogue Insertion & Frame Finalization (prologepilog):
bb.4.bb16.i:
; predecessors: %bb.2
successors: %bb.8(0x40000000), %bb.5(0x40000000); %bb.8(50.00%), %bb.5(50.00%)
liveins: $edi, $eflags, $esi, $rbp, $r15, $r14, $rbx
frame-setup PUSH64r killed $rbp, implicit-def $rsp, implicit $rsp
frame-setup PUSH64r killed $r15, implicit-def $rsp, implicit $rsp
frame-setup PUSH64r killed $r14, implicit-def $rsp, implicit $rsp
frame-setup PUSH64r killed $rbx, implicit-def $rsp, implicit $rsp
$rsp = frame-setup SUB64ri8 $rsp(tied-def 0), 8, implicit-def dead $eflags
renamable $r15b = SETCCr 8, implicit $eflags
TEST32rr renamable $esi, renamable $esi, implicit-def $eflags
renamable $r14b = SETCCr 8, implicit $eflags
renamable $edx = COPY renamable $edi, implicit-def $rdx
renamable $edx = NEG32r renamable $edx(tied-def 0), implicit-def $eflags, implicit killed $rdx, implicit-def $rdx
renamable $edx = CMOV32rr renamable $edx(tied-def 0), killed renamable $edi, 12, implicit $eflags, implicit killed $rdx, implicit-def $rdx
renamable $eax = COPY renamable $esi, implicit-def $rax
renamable $eax = NEG32r renamable $eax(tied-def 0), implicit-def $eflags, implicit killed $rax, implicit-def $rax
renamable $eax = CMOV32rr renamable $eax(tied-def 0), killed renamable $esi, 12, implicit $eflags, implicit killed $rax, implicit-def $rax
renamable $ecx = LEA64_32r $noreg, 4, renamable $rdx, 0, $noreg, implicit-def $rcx
TEST32ri renamable $edx, 1073741824, implicit-def $eflags, implicit killed $rdx
JCC_1 %bb.8, 4, implicit $eflags
JMP_1 %bb.5
Originally reported in rust-lang/rust#84667
The text was updated successfully, but these errors were encountered: