checker,transformer: add always true false branch detect#25674
Merged
spytheman merged 16 commits intoNov 9, 2025
Merged
Conversation
StunxFS
reviewed
Nov 5, 2025
spytheman
reviewed
Nov 7, 2025
spytheman
reviewed
Nov 7, 2025
Contributor
Author
|
CI fail is because in ASMInstr{
sym: u16(Tcc_token.tok_asm_shldw)
opcode: (u16((if (((4005) & 65280) == 3840) {
((((4005) >> 8) & ~255) | ((4005) & 255))
} else {
(4005)
})))
instr_type: u16(((8 | 4096) | ((0) << 13) | (if (((4005) & 65280) == 3840) { 256 } else { 0 })))
nb_ops: 3
op_type: [u8(opt_cl), opt_regw, opt_ea | opt_regw]!
},and |
Contributor
|
What is the performance impact of the additional checks? |
Contributor
Author
It need more optimization. :) |
Contributor
Author
|
Is this acceptable ? |
Contributor
Yes, 1-2% hit is a lot more palatable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feature request by #23404
This will warn on always true cond, such as
a == a, and always false cond, such as1==2.Fix
transformersupportast.CharLiteralexpr, support general var such asstruct.f != struct.f