Michal Paszkowski aefd0097e6 Handle single-index GEPs into flat aggregates in SimplifyConstant
In opaque pointer mode, GEPs that index into globals often have a
different shape. SimplifyConstant pass assumed two-index GEPs (0, index)
and directly used the second operand as an element index. However, it is
possible to address flat aggregates using single-index GEPs.

See the two examples below from SYCL_CTS-math_builtin_float_double_1_ocl
run in typed and opaque pointer mode.

Two-index GEP example:
%130 = getelementptr inbounds [2 x i32], [2 x i32] addrspace(2)* @__stgamma_ep_nofp64__ones, i64 0, i64 %129
%131 = bitcast i32 addrspace(2)* %130 to float addrspace(2)*
%132 = load float, float addrspace(2)* %131, align 4, !tbaa !5163, !noalias !5409

Single-index GEP example:
%103 = getelementptr inbounds float, ptr addrspace(2) @__stgamma_ep_nofp64__ones, i64 %102
%104 = load float, ptr addrspace(2) %103, align 4, !tbaa !5163, !noalias !5409

This patch changes the pass to always use the last GEP index as the
element selector. This works because the pass only transforms top-level
arrays of scalars/vectors. In these cases, the element being loaded is
always designated by the final GEP index (whether there are earlier
indices selecting the actual aggregate or single index in opaque pointer
mode).
2025-08-19 21:52:02 +02:00
2025-04-23 00:20:02 +02:00
2025-08-08 11:01:43 +02:00
2025-06-30 13:41:06 +02:00
2025-06-30 13:41:06 +02:00
2021-09-07 08:13:39 +02:00
2022-10-19 20:14:02 +02:00
2021-11-29 14:22:02 +01:00
2024-03-11 09:08:17 +01:00
2025-05-12 10:57:52 +02:00
2023-04-11 10:21:29 +02:00

Intel® Graphics Compiler for OpenCL™

GitHub release (latest by date)

Introduction

The Intel® Graphics Compiler for OpenCL™ is an LLVM-based compiler for OpenCL™ targeting Intel® graphics hardware architecture.

Please visit the compute Intel® Graphics Compute Runtime repository for more information about the Intel® open-source compute stack: https://github.com/intel/compute-runtime

License

The Intel® Graphics Compute Runtime for OpenCL™ is distributed under the MIT License.

For detailed terms, you can access the full License at:

https://opensource.org/licenses/MIT

Dependencies

Supported Linux versions

IGC is continuously built and tested on the following 64-bit Linux operating systems:

  • Ubuntu 24.04
  • Ubuntu 22.04

Documentation

More documentation is available in the documentation directory.

Supported Platforms

  • Intel® Xe2
  • Intel® Xe
  • Intel® Gen12 graphics
  • Intel® Gen11 graphics
  • Intel® Gen9 graphics

No code changes may be introduced that would regress support for any currently supported hardware. All contributions must ensure continued compatibility and functionality across all supported hardware platforms. Failure to maintain hardware compatibility may result in the rejection or reversion of the contribution.

Any deliberate modifications or removal of hardware support will be transparently communicated in the release notes.

API options are solely considered as a stable interface. Any debug parameters, environmental variables, and internal data structures, are not considered as an interface and may be changed or removed at any time.

How to provide feedback

If you have any feedback or questions, please open an issue through the native github.com interface: https://github.com/intel/intel-graphics-compiler/issues.

How to contribute

Create a pull request on github.com with your changes. Ensure that your modifications build without errors. A maintainer will get in touch with you if there are any inquiries or concerns.

Description
No description provided
Readme 158 MiB
Languages
C++ 58.2%
C 22.1%
LLVM 18.4%
CMake 0.7%
Python 0.3%
Other 0.2%