[PATCH] D99149: [LoopUnrollAndJam] Change LoopUnrollAndJamPass to LoopNest pass

Harald van Dijk via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 6 07:01:01 PDT 2021


hvdijk added a comment.

I'm seeing test failures now that this has been committed. These tests pass again after reverting this. (Tested on 21653600 <https://reviews.llvm.org/rG21653600034084e8335374ddc1eb8d362158d9a8> directly and re-tested on 12f53e53 <https://reviews.llvm.org/rG12f53e5392d699dbba564de3f2dff4802680f261>, and tested the revert on top of the latter.) However, I have not found the same errors in the CI results, https://lab.llvm.org/buildbot/#/changes/22300 shows these tests as passing even in configurations that enable assertions. Is it possible that something in here, or something relied upon by something in here, is not fully deterministic and produces different results in different build configurations? I will try different build configurations to see if I can find one where the tests pass, and compare just what the two different builds do, but if you can spot a potential problem straightaway and suggest something to try that would be very helpful.

  LLVM :: Transforms/LoopUnrollAndJam/dependencies.ll
  LLVM :: Transforms/LoopUnrollAndJam/dependencies_multidims.ll
  LLVM :: Transforms/LoopUnrollAndJam/disable.ll
  LLVM :: Transforms/LoopUnrollAndJam/pragma-explicit.ll
  LLVM :: Transforms/LoopUnrollAndJam/unroll-and-jam.ll

Of these, the unroll-and-jam failure looks the most interesting. The others have wrong output, but this one hard-fails with an assertion failure for me:

  FAIL: LLVM :: Transforms/LoopUnrollAndJam/unroll-and-jam.ll (1 of 1)
  ******************** TEST 'LLVM :: Transforms/LoopUnrollAndJam/unroll-and-jam.ll' FAILED ********************
  Script:
  --
  : 'RUN: at line 2';   /home/harald/llvm-project/build/bin/opt -basic-aa -tbaa -loop-unroll-and-jam -allow-unroll-and-jam -unroll-and-jam-count=4 -unroll-remainder < /home/harald/llvm-project/llvm/test/Transforms/LoopUnrollAndJam/unroll-and-jam.ll -S | /home/harald/llvm-project/build/bin/FileCheck /home/harald/llvm-project/llvm/test/Transforms/LoopUnrollAndJam/unroll-and-jam.ll
  : 'RUN: at line 3';   /home/harald/llvm-project/build/bin/opt -aa-pipeline=tbaa,basic-aa -passes='loop-unroll-and-jam' -allow-unroll-and-jam -unroll-and-jam-count=4 -unroll-remainder < /home/harald/llvm-project/llvm/test/Transforms/LoopUnrollAndJam/unroll-and-jam.ll -S | /home/harald/llvm-project/build/bin/FileCheck /home/harald/llvm-project/llvm/test/Transforms/LoopUnrollAndJam/unroll-and-jam.ll
  --
  Exit Code: 2
  
  Command Output (stderr):
  --
  opt: /home/harald/llvm-project/llvm/lib/Transforms/Utils/LoopSimplify.cpp:731: bool llvm::simplifyLoop(llvm::Loop *, llvm::DominatorTree *, llvm::LoopInfo *, llvm::ScalarEvolution *, llvm::AssumptionCache *, llvm::MemorySSAUpdater *, bool): Assertion `L->isRecursivelyLCSSAForm(*DT, *LI) && "Requested to preserve LCSSA, but it's already broken."' failed.
  PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
  Stack dump:
  0.	Program arguments: /home/harald/llvm-project/build/bin/opt -basic-aa -tbaa -loop-unroll-and-jam -allow-unroll-and-jam -unroll-and-jam-count=4 -unroll-remainder -S
  1.	Running pass 'Function Pass Manager' on module '<stdin>'.
  2.	Running pass 'Loop Pass Manager' on function '@test8'
  3.	Running pass 'Unroll and Jam loops' on basic block '%for.outer'
   #0 0x0000000001b4abf3 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/harald/llvm-project/build/bin/opt+0x1b4abf3)
   #1 0x0000000001b4898e llvm::sys::RunSignalHandlers() (/home/harald/llvm-project/build/bin/opt+0x1b4898e)
   #2 0x0000000001b4b0ba SignalHandler(int) Signals.cpp:0:0
   #3 0x00007ffa3a712d00 __restore_rt sigaction.c:0:0
   #4 0x00007ffa3a269d4d raise (/lib64/libc.so.6+0x37d4d)
   #5 0x00007ffa3a254526 abort (/lib64/libc.so.6+0x22526)
   #6 0x00007ffa3a25441f _nl_load_domain.cold loadmsgcat.c:0:0
   #7 0x00007ffa3a262ac2 (/lib64/libc.so.6+0x30ac2)
   #8 0x0000000001bf538f (/home/harald/llvm-project/build/bin/opt+0x1bf538f)
   #9 0x0000000001bffba3 llvm::UnrollLoop(llvm::Loop*, llvm::UnrollLoopOptions, llvm::LoopInfo*, llvm::ScalarEvolution*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::TargetTransformInfo const*, llvm::OptimizationRemarkEmitter*, bool, llvm::Loop**) (/home/harald/llvm-project/build/bin/opt+0x1bffba3)
  #10 0x0000000001c0ed22 llvm::UnrollRuntimeLoopRemainder(llvm::Loop*, unsigned int, bool, bool, bool, bool, llvm::LoopInfo*, llvm::ScalarEvolution*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::TargetTransformInfo const*, bool, llvm::Loop**) (/home/harald/llvm-project/build/bin/opt+0x1c0ed22)
  #11 0x0000000001c01c65 llvm::UnrollAndJamLoop(llvm::Loop*, unsigned int, unsigned int, unsigned int, bool, llvm::LoopInfo*, llvm::ScalarEvolution*, llvm::DominatorTree*, llvm::AssumptionCache*, llvm::TargetTransformInfo const*, llvm::OptimizationRemarkEmitter*, llvm::Loop**) (/home/harald/llvm-project/build/bin/opt+0x1c01c65)
  #12 0x000000000194f77a tryToUnrollAndJamLoop(llvm::Loop*, llvm::DominatorTree&, llvm::LoopInfo*, llvm::ScalarEvolution&, llvm::TargetTransformInfo const&, llvm::AssumptionCache&, llvm::DependenceInfo&, llvm::OptimizationRemarkEmitter&, int) LoopUnrollAndJamPass.cpp:0:0
  #13 0x000000000194e6e7 (anonymous namespace)::LoopUnrollAndJam::runOnLoop(llvm::Loop*, llvm::LPPassManager&) LoopUnrollAndJamPass.cpp:0:0
  #14 0x0000000000b6a8c5 llvm::LPPassManager::runOnFunction(llvm::Function&) (/home/harald/llvm-project/build/bin/opt+0xb6a8c5)
  #15 0x0000000001362558 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/harald/llvm-project/build/bin/opt+0x1362558)
  #16 0x0000000001368eb1 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/harald/llvm-project/build/bin/opt+0x1368eb1)
  #17 0x0000000001362c16 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/harald/llvm-project/build/bin/opt+0x1362c16)
  #18 0x000000000072c858 main (/home/harald/llvm-project/build/bin/opt+0x72c858)
  #19 0x00007ffa3a2557dd __libc_start_main (/lib64/libc.so.6+0x237dd)
  #20 0x00000000007158aa _start (/home/harald/llvm-project/build/bin/opt+0x7158aa)
  FileCheck error: '<stdin>' is empty.
  FileCheck command line:  /home/harald/llvm-project/build/bin/FileCheck /home/harald/llvm-project/llvm/test/Transforms/LoopUnrollAndJam/unroll-and-jam.ll


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99149



More information about the llvm-commits mailing list