Open solbjorn opened 1 year ago
@llvm/issue-subscribers-polly
Thanks for the report and the dump. I tried reproducing the problem but did not succeed:
clang "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-emit-llvm-bc" "-flto=full" "-flto-unit" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "io_uring.c" "-function-alignment" "4" "-falign-loops=1" "-mrelocation-model" "static" "-fno-delete-null-pointer-checks" "-fwarn-stack-size=1024" "-fno-jump-tables" "-mframe-pointer=none" "-relaxed-aliasing" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-mcmodel=kernel" "-target-cpu" "alderlake" "-target-feature" "+retpoline-indirect-calls" "-target-feature" "+retpoline-indirect-branches" "-target-feature" "-sse" "-target-feature" "-mmx" "-target-feature" "-sse2" "-target-feature" "-3dnow" "-target-feature" "-avx" "-target-feature" "-x87" "-target-feature" "+retpoline-external-thunk" "-target-feature" "+harden-sls-ijmp" "-target-feature" "+harden-sls-ret" "-disable-red-zone" "-mskip-rax-setup" "-mllvm" "-treat-scalable-fixed-error-as-warning" "-debug-info-kind=constructor" "-dwarf-version=5" "-debugger-tuning=gdb" "--compress-debug-sections=zstd" "-ffunction-sections" "-fdata-sections" "-fcoverage-compilation-dir=/mnt/home/xander/Dokumenty/aur/linux-gfy/src/linux-gfy" "-nostdsysteminc" "-nobuiltininc" "-D" "__KERNEL__" "-D" "RANDSTRUCT" "-D" "KBUILD_MODFILE=\"io_uring/io_uring\"" "-D" "KBUILD_BASENAME=\"io_uring\"" "-D" "KBUILD_MODNAME=\"io_uring\"" "-D" "__KBUILD_MODNAME=kmod_io_uring" "-fmacro-prefix-map=./=" "-source-date-epoch" "1678546806" "-O3" "-Werror" "-Wall" "-Wundef" "-Werror=strict-prototypes" "-Wno-trigraphs" "-Werror=implicit-function-declaration" "-Werror=implicit-int" "-Werror=return-type" "-Wno-format-security" "-Werror=unknown-warning-option" "-Werror=ignored-optimization-argument" "-Werror=option-ignored" "-Werror=unused-command-line-argument" "-Wno-sign-compare" "-Wno-frame-address" "-Wno-address-of-packed-member" "-Wframe-larger-than=1024" "-Wno-gnu" "-Wno-unused-but-set-variable" "-Wno-unused-const-variable" "-Wdeclaration-after-statement" "-Wvla" "-Wno-pointer-sign" "-Wcast-function-type" "-Wimplicit-fallthrough" "-Werror=date-time" "-Werror=incompatible-pointer-types" "-Wno-initializer-overrides" "-Wno-sign-compare" "-Wno-pointer-to-enum-cast" "-Wno-tautological-constant-out-of-range-compare" "-Wno-unaligned-access" "-Wno-cast-function-type-strict" "-std=gnu11" "-fdebug-compilation-dir=/mnt/home/xander/Dokumenty/aur/linux-gfy/src/linux-gfy" "-ferror-limit" "19" "-fvisibility=hidden" "-fzero-call-used-regs=used-gpr" "-fsanitize=kcfi" "-fsanitize-recover=kcfi" "-fno-sanitize-memory-param-retval" "-fno-sanitize-address-use-odr-indicator" "-fpatchable-function-entry=11" "-fpatchable-function-entry-offset=11" "-fwrapv" "-stack-protector" "2" "-stack-protector-buffer-size" "4" "-ftrivial-auto-var-init=pattern" "-mstack-alignment=8" "-fcf-protection=branch" "-mfunction-return=thunk-extern" "-mindirect-branch-cs-prefix" "-fno-signed-char" "-fwchar-type=short" "-fno-signed-wchar" "-fgnuc-version=4.2.1" "-fcolor-diagnostics" "-vectorize-loops" "-vectorize-slp" "-mllvm" "-polly" "-mllvm" "-polly-ast-use-context" "-mllvm" "-polly-invariant-load-hoisting" "-mllvm" "-polly-loopfusion-greedy" "-mllvm" "-polly-run-inliner" "-mllvm" "-polly-vectorizer=stripmine" "-mllvm" "-polly-run-dce" "-mllvm" "-inline-threshold=600" "-mllvm" "-inlinehint-threshold=750" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c" io_uring-d21ef5.c
(I had to remove "-frandomize-layout-seed-file=./scripts/basic/randstruct.seed"
because it does not exist on my computer)
I tried with the most recent version of clang and a749e09e184b2b0b6dde71af01c82dd427b3e3e2.
Generally, I recommend against using Polly to optimize the Linux kernel, it's not the kind of code it is intended for, but also should not crash.
Compiling https://github.com/solbjorn/linux/tree/gfy emits the following:
Full log, as well as
/tmp/io_uring*
mentioned there: polly-dump.zipRewinding the repo back to the subject commit ~1 makes that disappear.
git bisect
led to the same commit. I've been compiling this kernel with Polly for almost two years already and it's been compiling (and working) successfully on Clang 13-16.My blind guess is that
isl-noexceptions.h
must be regenerated? Or some upstream ISL fixes pulled? I tried regenerating it, but IIUC LLVM's version is heavily modified.