LU-JOHN wrote:

> It is not obvious to judge whether this patch is profitable. Can you share 
> some performance data on SPEC/LLVM test-suite/your motivating case?

This PR was inspired by code generated for Triton.  A reduced example can be 
found in function testA in jump-threading-live-on-exit.ll.

I've changed the block searching to go backward from uses to the def instead of 
forward from the def.   This is more efficient since a forward search is not 
guaranteed to hit a use, but a backward search must hit the def.  I've also 
added a limit to ensure that the search gives up if too many blocks are 
searched.

I tested this with a 3-stage build of LLVM.  This change increased the number 
of threaded branches from` 186726 to 197086, +10360.  The number of blocks that 
could be threaded and required backward searches from the uses was 331442. The 
number of blocks searched from the uses ranged from 0 to 25 (the search limit). 
 The average of number of blocks searched was 5.21.

https://github.com/llvm/llvm-project/pull/135079
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to