[Beignet] [PATCH 0/3] Fix large ifendif block issue.

Zhigang Gong zhigang.gong at intel.com
Sun Apr 27 18:00:41 PDT 2014


When some case has code like long16/ulong16, the final code size will be very
large then the GEN IR instruction count and may exceed the limitation of if/endif's
offset range which is a S15 integer.

We found that case in some test suite indeed. There are two solutions:
1. switch back to the unstructured style of BB encoding.
2. insert multiple endif/if pair to short the block size.

The solution 1 is not as easy as it looks like. As switch back to unstructured style
means all the instructions in that BB need to fall back to the previous style as well.
This method will bring too much complexity for all instuctions encoding.

So I choose to take the option 2. Insert multiple endif/if pair to short the BB size.
To implement this method. Need to fix the hard coded endif offset firstly which introduce
auxilary labels to record each endif's location. Then insertion endif/if if we encounter
the eaxct large if/endif problem.

Zhigang Gong (3):
  GBE: fix the hard coded endif offset calculation.
  GBE: fix the large if/endif block issue.
  GBE: reserve flag0.0 for large basic block.

 backend/src/backend/gen_context.cpp        | 27 ++++++++++++-------
 backend/src/backend/gen_context.hpp        | 23 +++++++++++-----
 backend/src/backend/gen_insn_selection.cpp | 42 ++++++++++++++++++++++--------
 backend/src/backend/gen_insn_selection.hpp |  6 ++---
 backend/src/backend/gen_program.cpp        |  8 ++++++
 backend/src/backend/gen_reg_allocation.cpp | 24 ++++++++++++-----
 6 files changed, 93 insertions(+), 37 deletions(-)

-- 
1.8.3.2



More information about the Beignet mailing list