Reland 9e900890fcda9c017cbc731768de4c9e1044f017 that is temporarily reverted in https://github.com/intel/intel-xpu-backend-for-triton/pull/2523 by a626ab85bf2d09a0c385ced9ca50171a1fc3166c.