18653 Commits

Author SHA1 Message Date
3a51b5f55c Update IGC flag documentation.
Update IGC flag documentation.
2025-09-25 12:25:19 +02:00
e1a182f183 Minor fixes and refactors.
Change dyn_cast to cast where it's clear cast was intended.

- Change dyn_cast to cast where it's clear cast was intended.

- Fix lock scope in Dump.cpp.

- Pass sectName by ref in RelocSection constructor.
2025-09-25 11:53:53 +02:00
fa94ba32c9 Minor fixes and refactors.
- Apply rule-of-three by explicitly deleting copy constructors.

- Fix memory leak in DbgDecoder in case of error by moving fopen to
  constructor and fclose to destructor.
2025-09-25 11:07:10 +02:00
7d3adc7d3e [Autobackout][FunctionalRegression]Revert of change: f6f28a79b7: Another pattern match for packing <4 x i8> values.
This PR add detection for one more pattern that packs 4 8-bit integer values
    into a single 32-bit value.
2025-09-25 06:48:51 +02:00
2c42b1b758 Skip SOA promotion for variable i8 GEPs
Add a bail out in SOALayoutChecker::MismatchDetected to treat i8-based
GEPs with non-constant byte indices as a mismatch and disable SOA
promotion for those allocas. This avoids incorrect results produced by the
legacy scalarization path when byte-wise addressing is used and the
offsets are not multiples of the lane size.
2025-09-25 03:46:09 +02:00
f5bd985f04 Revert "Revisit MismatchDetected for LowerGEPForPrivMem"
Reverts a previous change which created a regression on LLVM 16 + Opaque
Pointers in the following test case:
SYCL_CTS-math_builtin_float_double_1_ocl
2025-09-25 03:09:54 +02:00
8e65535c8c Add DPAS SBID.dst for any instruction which uses the architecture register
During the exeuction of dpas instruction, the architecture registers cannot be updated
2025-09-25 01:57:43 +02:00
7a2a2c2e94 Modify Integer MAD Pattern Matching
Modify Integer MAD pattern matching to catch more cases.
2025-09-25 01:10:57 +02:00
355ba8fec6 Remove PreserveNames IRBuilder parameter
Remove PreserveNames IRBuilder parameter
2025-09-24 22:48:05 +02:00
ed2cc0ee09 Adjust LIT/ocloc tests for LLVM16 + opaque and typed pointers
Adjust LIT/ocloc tests for LLVM16 + opaque and typed pointers
2025-09-24 17:17:06 +02:00
3fb0247b37 [LLVM16][SinkCommonOffsetFromGEP] Detect type mismatch when grouping GEPs
On opaque pointers we could end up with such group:

    %C  = getelementptr inbounds %class.MC_Vector, %class.MC_Vector* %.privateBuffer, i64 0, i32 1
    %C2 = getelementptr inbounds %class.MC_Vector, %class.MC_Vector* %.privateBuffer, i64 0, i32 1
    %A  = getelementptr inbounds %class.MC_Particle, %class.MC_Particle* %.privateBuffer, i64 0, i32 4
    %A2 = getelementptr inbounds %class.MC_Particle, %class.MC_Particle* %.privateBuffer, i64 0, i32 4

The problem is that we have type mismatch here, and later, when such group is being processed it tries
to access indices that aren't available in given type e.g 8th index of 3 element struct.

Such problematic group should be splitted into two different groups and it solves that problem.

    %C  = getelementptr inbounds %class.MC_Vector, %class.MC_Vector* %.privateBuffer, i64 0, i32 1
    %C2 = getelementptr inbounds %class.MC_Vector, %class.MC_Vector* %.privateBuffer, i64 0, i32 1

    %A  = getelementptr inbounds %class.MC_Particle, %class.MC_Particle* %.privateBuffer, i64 0, i32 4
    %A2 = getelementptr inbounds %class.MC_Particle, %class.MC_Particle* %.privateBuffer, i64 0, i32 4

This PR adds check which should result in creation of new group
instead of the merge with existing group that'd result in mismatched types.
2025-09-24 17:12:01 +02:00
edcf21d1b3 Add AddVISADumpDeclarationsToEnd flag
Add a IGC flag that adds a comment with
.decl section at the end of VISAASM console dump.
2025-09-23 16:14:11 +02:00
ff57226791 [LLVM16] Removal of Reapply_hasSetOpaquePointersValue.patch
In order to reduce the amount of patches this PR moves
check whether pointers mode was already set from LLVM to IGC

More details in comments
2025-09-23 11:08:26 +02:00
16311e17f1 [Autobackout][FunctionalRegression]Revert of change: 70aa3f3f05: Allow spills to spill again in fail safe iteration
Due to constraints, spilled variables may spill again in fail safe
    iteration. This generates extra code but it guarantees completion of
    compilation.
2025-09-23 09:39:58 +02:00
f6f28a79b7 Another pattern match for packing <4 x i8> values.
This PR add detection for one more pattern that packs 4 8-bit integer values
into a single 32-bit value.
2025-09-23 09:17:24 +02:00
67faf6c1d4 Enable has_printf_calls zeinfo field
This commit enables previously added has_printf_calls field and test for it.
2025-09-23 08:58:00 +02:00
17c1de9abc Remove igc metrics
Remove igc metrics
2025-09-22 20:11:41 +02:00
61f6fdee59 Make regkey OverrideCsTileLayout Integer
there're 3 enum associated with the regkey so using bool is incorrect
2025-09-22 19:08:53 +02:00
70aa3f3f05 Allow spills to spill again in fail safe iteration
Due to constraints, spilled variables may spill again in fail safe
iteration. This generates extra code but it guarantees completion of
compilation.
2025-09-22 17:45:51 +02:00
035b1f3d39 Minor fixes and refactors.
Change args to const ref where makes sense.

Put std::move where makes sense

Apply rule of three

Change usage of unique_ptr and ptrs to unique_ptr to use just shared_ptr

Update comment in CodeSinking

Use saved boolean value instead of calling method over and over.
2025-09-22 15:49:55 +02:00
2b1b9333bf Changes in code. 2025-09-22 14:56:47 +02:00
e64fdad3ab Handle missing single quotes for -igc_opts.
In igc_ocl_tranlation_ctx_impl there is handling of -igc_opts passed to
ocloc. The implementation however doesn't handle improper format, which
results in an infinite loop in case no single quotes were provided, or
the second single quote is missing.

This commit adds handling of these cases.
2025-09-22 12:33:22 +02:00
6d3f69e4ab [Autobackout][FunctionalRegression]Revert of change: 6cdb2a96a3: Universally run GVN, even when there aren't multiple basic blocks
Universally run GVN, even when there aren't multiple basic blocks
2025-09-20 09:11:05 +02:00
6cdb2a96a3 Universally run GVN, even when there aren't multiple basic blocks
Universally run GVN, even when there aren't multiple basic blocks
2025-09-20 01:31:16 +02:00
43c78c9ebb Minor improvements to SetDebugReg
Minor improvements to SetDebugReg
2025-09-19 23:52:48 +02:00
e02a9666f6 Support opaque pointers in PromoteBools pass
PromoteBools was wrongly skipping RAUW operation on ptr function calls
after promoting their signature and adding their users to promotion
queue which lead to cleaning those users and creating undef values in
subsequent users, which then in turn created dead code which was
eliminated and caused wrong test results. Essentially this pass was
wrongly skipping RAUW when neccessary.

In cases like these:
```llvm
  @call = call ptr @some-function(i1 true)
  @bitcast = bitcast ptr @call to ptr
  @ptrtoint = ptrtoint ptr @bitcast to i64
```

After pass pre fix:
```llvm
  @0 = call ptr @some-function(i8 1)
  @ptrtoint = ptrtoint ptr undef to i64
```

Proper pass behaviour:
```llvm
  @0 = call ptr @some-function(i8 1)
  @bitcast = bitcast ptr @0 to ptr
  @ptrtoin = ptrtoint ptr @bitcast to i64
```
v2.20.0
2025-09-19 12:25:46 +02:00
8ee863263b JointMatrix canonicalized GEP patching for opaque pointers
This commit revisits functionality introduced by b74e645.
Previous solution didn't work on llvm16 + opaque pointers.
Additionally it assumed specific bitcast -> GEP pattern which wasn't
guaranteed to work in the future if SYCL codegen changed.
New algorithm does recursive search on users of AllocaInst
to find GEP and lifetime instructions that need fixing.
2025-09-19 10:37:19 +02:00
d775e45795 Revisit MismatchDetected for LowerGEPForPrivMem
MismatchDetected solved assert in the PrivateMemoryResolution pass
caused by mismatched widths. LowerGEPForPrivMem solves that case
but in case of alloca over the allowed size it will leave mismatched
widths for the later PrivateMemoryResolution causing the assert to
fail. Extended mismatch detection for cases with struct of array/struct
of vector.
2025-09-19 10:20:57 +02:00
2ff5130361 Handle inline asm in vector alias
1. Improve vector alias optim to handle inline asm
 2. Allow constant insert elements
2025-09-19 00:07:58 +02:00
09c26bd480 [LLVM16][PrivateMemoryResolution] Adding another case of mismatch detection
Current implementation of MismatchDetection was skipping cases due to algorithm version check.
It prevented mismatched cases to be detected, so I'm removing that check.
2025-09-18 13:05:38 +02:00
bad3bca08b simplify insertelement for large vectors
LLVM's instcombine pass (method
InstCombinerImpl::SimplifyDemandedVectorElts) is able to set input on
first insertelement to poison if all indices in vector are inserted (all
indices are overwritten). This optimization has a hardcoded limit on
vector size in LLVM 15 and 16, which is too short for compute workloads.
Manually optimize such cases in IGC.
2025-09-18 09:14:14 +02:00
78e8d97831 Add subtree selection heuristic to preRA scheduler
When choosing between 2 nodes with same SU number, allow breaking tie
based on subtree selection heuristic. Pick a node if it's direct
predecessor of last scheduled node. This allows us to retire the busy
GRF faster and reduce register pressure quickly.

Currently this feature is disabled and must be enabled by setting a bit
in pre-sched ctrl.
2025-09-18 07:11:17 +02:00
1512e188ce Fix some issue with RT API UnorderedMap
Fix some issue with RT API UnorderedMap
2025-09-18 01:42:26 +02:00
5a47189bc3 [Autobackout][FunctionalRegression]Revert of change: 78fcf82381: Revisit MismatchDetected for LowerGEPForPrivMem
MismatchDetected solved assert in the PrivateMemoryResolution pass
    caused by mismatched widths. LowerGEPForPrivMem solves that case
    but in case of alloca over the allowed size it will leave mismatched
    widths for the later PrivateMemoryResolution causing the assert to
    fail. Extended mismatch detection for cases with struct of array/struct
    of vector.
2025-09-17 23:38:03 +02:00
7b02f68a86 Update bfloat lits 2025-09-17 20:40:06 +02:00
ea015d44a9 Improve register estimation for CodeScheduling
- Fix the incorrect estimation of the initial register pressure
- Support more special cases for code with various casts in the
CodeScheduling's RegisterPressureTracker
2025-09-17 15:08:54 +02:00
c700d6b3c9 [IGC Core] Fix ICmp instruction promotion during type legalization
Fix mask creation when promoting icmp instruction during type
legalization
2025-09-17 12:19:29 +02:00
69c79ca67b Update ZEBinary version
For internal feature.
2025-09-16 23:36:08 +02:00
0ebbf1266f Small spill threshold condition update 2025-09-16 17:11:15 +02:00
8a939cf174 Fix coverity issue in VC
.
2025-09-16 16:10:19 +02:00
299ebdbaee [Autobackout][FunctionalRegression]Revert of change: 009c253d4f: Internal performance refinements
Improvements to internal analysis and data handling to reduce overhead.
2025-09-16 14:46:45 +02:00
78fcf82381 Revisit MismatchDetected for LowerGEPForPrivMem
MismatchDetected solved assert in the PrivateMemoryResolution pass
caused by mismatched widths. LowerGEPForPrivMem solves that case
but in case of alloca over the allowed size it will leave mismatched
widths for the later PrivateMemoryResolution causing the assert to
fail. Extended mismatch detection for cases with struct of array/struct
of vector.
2025-09-16 14:26:27 +02:00
009c253d4f Internal performance refinements
Improvements to internal analysis and data handling to reduce overhead.
2025-09-15 23:07:17 +02:00
7ad819c853 Disable Loop unrolling protmotion for Alloc
Disable Loop unrolling protmotion for Alloc
2025-09-15 22:06:34 +02:00
ff9e975de4 Internal metadata changes
Internal metadata changes
2025-09-15 20:14:06 +02:00
a60bdf9722 [Autobackout][FunctionalRegression]Revert of change: 6caf55dfb4: Another pattern match for packing <4 x i8> values.
This PR add detection for one more pattern that packs 4 8-bit integer values
    into a single 32-bit value.
2025-09-15 18:17:25 +02:00
f15a9b2451 [LLVM16][StatelessToStateful] Case where BUFFER_OFFSET doesn't seem to be 0
There's this assumption: "If m_hasPositivePointerOffset is true, BUFFER_OFFSET are assumed to be **zero**"
But I've found a case on LLVM 16 + Opaques where such transformation causes this test to fail:
https://github.com/intel/llvm/  => DeviceLib/string_test.cpp

This:

	%15 = add i32 %bufferOffset1, 1
	%16 = getelementptr inbounds i8, ptr addrspace(1) %1, i64 1 // unused
	%17 = inttoptr i32 %bindlessOffset2 to ptr addrspace(2490368)   //
2025-09-15 17:47:56 +02:00
dbae9c5304 Support stateless atomic predication
Support stateless atomics predication for performance experiments.
2025-09-15 13:45:47 +02:00
6caf55dfb4 Another pattern match for packing <4 x i8> values.
This PR add detection for one more pattern that packs 4 8-bit integer values
into a single 32-bit value.
2025-09-15 12:53:39 +02:00
b37c5cd01c Revert "Extending the application of the multiplication pattern in GEP LSR pass."
This reverts commit 9c27763536.
2025-09-15 10:31:17 +02:00