[PATCH] D116728: [LICM] Check for noalias call instead of alloc like fn

Alexandre Ganea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 18 13:32:04 PST 2022


aganea added a comment.

Hello @nikic! It seems that rG3cef3cf02f09e397c471cf008060c89b34951959 <https://reviews.llvm.org/rG3cef3cf02f09e397c471cf008060c89b34951959> is breaking some usages. While trying to land D108850 <https://reviews.llvm.org/D108850>, it was breaking on a two stage bot: https://lab.llvm.org/buildbot/#/builders/123/builds/8383
I managed to create a reproducer (to be applied on ToT): F21706403: lldCommon_bug.patch <https://reviews.llvm.org/F21706403> 
The issue can be seen is in `lld/COFF/DriverUtils_test.cpp`, essentially the pointer is moved out of `mb` but it is not copied in the buffer created by the placement new in `make<std::unique_ptr<MemoryBuffer>>`. The target buffer pointed by `getSpecificAllocSingleton<T>().Allocate()` is left untouched, which later fails on deletion.

To repro:

  > cd ~/llvm-project/
  > git checkout 3cef3cf02f09e397c471cf008060c89b34951959
  ...
  > mkdir stage1 && cd stage1
  > cmake ../llvm -GNinja -DLLVM_ENABLE_PROJECTS='llvm;lld;clang' -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/bin/clang-13 -DCMAKE_CXX_COMPILER=/usr/bin/clang++-13 -DCMAKE_LINKER=/usr/bin/ld.lld-13
  ...
  > ninja
  ...

and then:

  > cd ~/llvm-project/
  > git checkout main && git pull && git checkout -b test_bug
  ...
  > git apply lldCommon_bug.patch
  ...
  > mkdir stage2 && cd stage2
  > cmake ../llvm -GNinja -DLLVM_ENABLE_PROJECTS='llvm;lld' -DLLVM_ENABLE_ASSERTIONS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/home/ubuntu/llvm-project/stage1/bin/clang -DCMAKE_CXX_COMPILER=/home/ubuntu/llvm-project/stage1/bin/clang++ -DCMAKE_LINKER=/home/ubuntu/llvm-project/stage1/bin/ld.lld
  ...
  > ninja check-lld-coff
  ...
  Testing Time: 7.67s
    Unsupported:   8
    Passed     :  13
    Failed     : 372
  FAILED: tools/lld/test/CMakeFiles/check-lld-coff
  cd /home/ubuntu/llvm-project/stage2/tools/lld/test && /usr/bin/python3.8 /home/ubuntu/llvm-project/stage2/./bin/llvm-lit -sv /home/ubuntu/llvm-project/lld/test/COFF
  ninja: build stopped: subcommand failed.

Would you have a chance to look into it please?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116728/new/

https://reviews.llvm.org/D116728



More information about the llvm-commits mailing list