-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
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
Remove redundant instructions for checking for-loop-exit-condition #22
Comments
These two lines calculate the condition (
These two lines are generated by the phi-node for
This instruction is required by the subsequent conditional branches to set the flags correctly. This could be removed, if the last instruction before setting flags already sets the flags for the same source value (and for all SIMD elements!!), which is the case here. To sum it up:
|
The output of
One to one translation is a little bit hard to do such optimization. We have two choice:
Peephole optimization might be general (it can be used for other bit-operation optimization), but latter is easier. |
One more thing: to jump neightbor basic_block, this cod output jump instruction. |
Scratch that. According to here, we cannot set flags on both ALUs depending on the condition of their execution, thus |
@doe300 you already done it? If so, let's close the issue. |
No, I haven't found a fitting optimization yet. |
The for-loop creates redundant instructions in the instructions of checking exit condition.
ex)
To me, above instructions (specifying
///
) can be expressed asisub.setf -, r1, ra1
.Then, if the condition is negative, jump to the head of loop. Otherwise go through.
The text was updated successfully, but these errors were encountered: