C1 may generate wrong code during the phase of EdgeMoveOptimizer::optimize()
傅杰
fujie at loongson.cn
Fri Jun 8 03:19:29 UTC 2018
Hi all,
I'm porting OpenJDK to mips.
I found that the C1 compiler may generate wrong code for mips during the phase of EdgeMoveOptimizer::optimize().
I think the reason is that EdgeMoveOptimizer::optimize_moves_at_block_begin(BlockBegin* block) doesn't consider the case of branch instructions with operands.
Some platforms, such as mips, s390 and aarch64, the branch instruction may contain register operands.
If the move instruction would change the branch instruction's operand after EdgeMoveOptimizer::optimize_moves_at_block_begin(...), we can't apply it.
I made a patch based on http://hg.openjdk.java.net/jdk/jdk/rev/538dd69b60c0.
Please see the attachment for that patch.
I think s390 and aarch64 will come across the same problem if they optimize the code generation of C1 using branch instructions with operands.
Thanks.
Fu Jie
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20180608/951a3fd8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EdgeMoveOptimizer.patch
Type: application/octet-stream
Size: 3221 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20180608/951a3fd8/EdgeMoveOptimizer.patch>
More information about the hotspot-compiler-dev
mailing list