Hi Clemens, in the example, the conditional branch is 50/50 true/false (per iteration) and hence a worst-case for branch prediction. Therefore, it seams reasonable that the machine code with a conditional branch is so much slower than the code with predication.
Since we produce the WASM code ourselves we can fully trust it. So I disabled boundary checks with --no-wasm-bounds-checks and the check in the hot loop disappeard but this had no performance impact. As you already said, this branch is perfectly predictable. If there is an optimization pass that can perform predication, how would I instruct TurboFan to run it? In fact, in our system we know whether a branch will be predictable. So it would be great if we could opt-in to an optimization pass to perform predication if we deem it worthwhile. Directly generating predicated code is hypothetically possible, but a considerable development effort on our side and has the potential for code duplication. (This needs further investigation on my side.) Thanks a lot, Clemens :) Regards, Immanuel -- -- v8-dev mailing list v8-dev@googlegroups.com http://groups.google.com/group/v8-dev --- You received this message because you are subscribed to the Google Groups "v8-dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to v8-dev+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/v8-dev/449743d7-f969-4d65-a1ab-a8b3aaa4ba1f%40googlegroups.com.