[PATCH] D40146: [JumpThreading] Preservation of DT and LVI across the pass

Brian Rzycki via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 14 15:39:04 PST 2017


brzycki added a comment.

In https://reviews.llvm.org/D40146#955920, @kuhar wrote:

> Which files and includes formed the cycle? There are a lot of files that require dominators.h, and I'm not convinced adding a new class to is a good idea, given that it currently has just one user.


Hi @kuhar , this started with a BuildBot failure <http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/14434/steps/compile.llvm.stage2/logs/stdio>. After investigating further I recreated the problem locally and found the following error message:

  [291/1841] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o
  FAILED: lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o
  /work/brzycki/tip1/install/bin/clang++  -DGTEST_HAS_RTTI=0 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/IR -I/work/brzycki/stage1/llvm-project/llvm/lib/IR -I/usr/include/libxml2 -Iinclude -I/work/brzycki/stage1/llvm-project/llvm/include -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -fmodules -fmodules-cache-path=/work/brzycki/stage1/build/module.cache -Xclang -fmodules-local-submodule-visibility -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wcovered-switch-default -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fcolor-diagnostics -ffunction-sections -fdata-sections -O3 -DNDEBUG    -fno-exceptions -fno-rtti -MD -MT lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o -MF lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o.d -o lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o -c /work/brzycki/stage1/llvm-project/llvm/lib/IR/IRBuilder.cpp
  While building module 'LLVM_intrinsic_gen' imported from /work/brzycki/stage1/llvm-project/llvm/lib/IR/IRBuilder.cpp:15:
  While building module 'LLVM_IR' imported from /work/brzycki/stage1/llvm-project/llvm/include/llvm/IR/Argument.h:20:
  In file included from <module-includes>:30:
  /work/brzycki/stage1/llvm-project/llvm/include/llvm/IR/DeferredDominance.h:20:10: fatal error: cyclic dependency in module 'LLVM_intrinsic_gen': LLVM_intrinsic_gen -> LLVM_IR -> LLVM_intrinsic_gen
  #include "llvm/IR/Dominators.h"
           ^
  While building module 'LLVM_intrinsic_gen' imported from /work/brzycki/stage1/llvm-project/llvm/lib/IR/IRBuilder.cpp:15:
  In file included from <module-includes>:1:
  /work/brzycki/stage1/llvm-project/llvm/include/llvm/IR/Argument.h:20:10: fatal error: could not build module 'LLVM_IR'
  #include "llvm/IR/Value.h"
   ~~~~~~~~^~~~~~~~~~~~~~~~~
  /work/brzycki/stage1/llvm-project/llvm/lib/IR/IRBuilder.cpp:15:10: fatal error: could not build module 'LLVM_intrinsic_gen'
  #include "llvm/IR/IRBuilder.h"
   ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
  3 errors generated.

This is the first of many showing the circular problem.  What's worse is if I move only the offending method (delBB) into Dominators.cpp I start to get another set of cyclic errors due to the relatopnship between DeferredDominance.h and Dominators.h. I tried to keep DeferredDominance.h but could not find a way that satisfied -fmodules.


https://reviews.llvm.org/D40146





More information about the llvm-commits mailing list