intel / llvm

Intel staging area for llvm.org contribution. Home for Intel LLVM-based projects.
Other
1.26k stars 740 forks source link

[SYCL] "Assuming SYCL queries fit in int" feature is broken for -O1 #3263

Open vmaksimo opened 3 years ago

vmaksimo commented 3 years ago

Describe the bug https://github.com/intel/llvm/blob/sycl/sycl/test/check_device_code/id_queries_fit_int.cpp test fails after community changes (https://github.com/intel/llvm/pull/3233/). "llvm.assume" intrinsic is not generated with O1 optimization level as it expected from test checks. I temporarily disabled optimizations to unlock pulldown https://github.com/intel/llvm/pull/3233/commits/18b3ac2e317696c066744981d719f4268674365c

To Reproduce

# If the https://github.com/intel/llvm/pull/3233 is not merged yet, fetch the PR:
git fetch origin pull/3233/head:pr_3233
git checkout pr_3233

# Then revert the commit that disables the test
git revert 18b3ac2e317696c066744981d719f4268674365c 

# Then build with the normal procedure https://github.com/intel/llvm/blob/sycl/sycl/doc/GetStartedGuide.md#build-dpc-toolchain
python $DPCPP_HOME/llvm/buildbot/configure.py
python $DPCPP_HOME/llvm/buildbot/compile.py

# And run the tests
python $DPCPP_HOME/llvm/buildbot/check.py
AlexeySachkov commented 7 months ago

The test has been refactored since then and the most notable change is complete disabling of FE optimizations done in #3751

The test should work in any optimization level - if I remember correctly, those hints were important for backend optimizations, so the lack of them when optimizations are enabled means that the whole feature doesn't work.

I think that this may still be an actual issue and we need to at least extend the test to run in all possible optimization levels to be sure that everything works as expected.