Reland 692143cd869f2fa1501edb1db76fb452b85ac914 that is temporarily reverted in https://github.com/intel/intel-xpu-backend-for-triton/pull/2543 by 7f80413d5b497e4171beb79c0d97edd2198c85c3.