intel / intel-graphics-compiler

Other
596 stars 155 forks source link

Semantically different code when `noinline` is applied to functions #287

Open victor-eds opened 1 year ago

victor-eds commented 1 year ago

When running this intel/llvm-test-suite test passing -O0 on OpenCL/L0 GPU platforms (driver versions tested: 22.28.23726.1 and 22.53.25242.13 on Ubuntu Linux 22.10), we found that the test was failing due to wrong computation being performed. After debugging, we think this might be in fact an IGC bug (or missing metadata you might be expecting to perform further transformations on the module).

This test is passing with the same options on OpenCL CPU and, when modifying the output module generated by DPC++'s sycl-fusion JIT compiler replacing noinline attributes with alwaysinline, it is also passing on GPU platforms. You can find the IGC dump for both runs attached (original.zip, alwaysinline.zip).

When debugging, we saw the codegen dump in original.zip had some calls to the following builtin, which we assume should've been handled by one of IGC's passes and replaced by additional arguments in calling functions:

declare <8 x i32> @llvm.genx.GenISA.getPayloadHeader.v8i32() #9
amielcza commented 1 year ago

Hello,

I am currently trying to reproduce your problem, however I ran into some problems in the process. I cannot seem to recreate the error on my machine - on both drivers (22.28.23726.1 and 22.53.25242.13). Could you please provide some additional information regarding reproduction of the error you seem to be having:

 - The version of DPC++

 - The platform you are using

 - Full IGC dumps (IGC_ShaderDumpEnable=1)

amielcza commented 1 year ago

Hello, could you please provide the information I asked for in the message above? @victor-eds

pszymich commented 1 year ago

Closing as inactive.

victor-eds commented 1 year ago

Sorry, I missed the first message and was off on holidays for the past couple of weeks. DPC++ version: clang version 17.0.0 (git@github.com:intel/llvm.git 1404ff1dec552053b49cdf8d6fdab72f42f8beb6) Platform: Ubuntu 20.04.6 LTS (GNU/Linux 5.15.0-71-generic x86_64) complete_fusio_768621.tar.gz