GBE: add legalize pass to handle wide integers

Graphics / Beignet - Ruiling Song [intel.com] - 11 October 2014 03:39 UTC

This legalize pass will break wider integers like i128/i256/... into shorter ones. The problem is how to choose the shorter type? From my observation, wide integer type always comes from shorter ones through 'zext' on small type or 'bitcast' on vectors, so we simply choose the type where it comes from. Then we can split wide integer operations into operations on shorter interger.

v2: add an assert on the wide integer bit-width, should be power of 2. use rpo_iterator to make sure traverse Value def before its use.

v3: drop all references before erase processed instruction.

270ac05 GBE: add legalize pass to handle wide integers
backend/src/CMakeLists.txt | 1 +
backend/src/llvm/llvm_gen_backend.hpp | 3 +
backend/src/llvm/llvm_legalize.cpp | 571 +++++++++++++++++++++++++++++++++
backend/src/llvm/llvm_to_gen.cpp | 1 +
4 files changed, 576 insertions(+)

Upstream: cgit.freedesktop.org


  • Share