This fixes issue #56103.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
thanks for root cause and quick fix! lgtm after resolving others' comments.
As mentioned in issue 56103[1], a diff of codegen in 14.0.0 and truck proves D124118 exposes the SF usage issue, so this patch is reasonable.
Besides, D124118 could update ClearsOverflowFlag; and the OF bit usage is already properly handled [2] so no other EFLAGS usage to worry about (otherwise I'd be glad to send a similar patch to this).
[1] https://github.com/llvm/llvm-project/issues/56103#issuecomment-1159575344
[2] according to the table http://unixwiz.net/techtips/x86-jumps.html
llvm/lib/Target/X86/X86InstrInfo.cpp | ||
---|---|---|
4463–4464 | (Just to add some reference, no action items) According to the table [1], JL JLE, JG and JGE uses SF bit, besides JS and JNS. JS and JNS are handled around line 4478, so this should handle all jump instructions. [1] http://unixwiz.net/techtips/x86-jumps.html and https://en.wikibooks.org/wiki/X86_Assembly/Control_Flow#Unconditional_Jumps | |
llvm/test/CodeGen/X86/pr56103.ll | ||
3 | nit pick: Do we want to use utils/update_llc_test_checks.py to generate (more) assertions automatically? |
(Just to add some reference, no action items)
According to the table [1], JL JLE, JG and JGE uses SF bit, besides JS and JNS.
JS and JNS are handled around line 4478, so this should handle all jump instructions.
[1] http://unixwiz.net/techtips/x86-jumps.html and https://en.wikibooks.org/wiki/X86_Assembly/Control_Flow#Unconditional_Jumps