llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.03k stars 11.58k forks source link

Many Clang tests are failing when experimental pass manager is enabled by default #40070

Open petrhosek opened 5 years ago

petrhosek commented 5 years ago
Bugzilla Link 40724
Version trunk
OS Linux
CC @zygoloid

Extended Description

Most of these errors seem to be the instance of:

No available targets are compatible with triple 'foo'

I've attached a complete output from llvm-lit.

petrhosek commented 5 years ago

Seems like there are two issues going on here.

  1. Unlike the legacy pass manager, the new pass manager always makes the target machine available to passes so we have to always instantiate it even when we're only emitting bitcode, see https://github.com/llvm/llvm-project/blob/master/clang/lib/CodeGen/BackendUtil.cpp#L952. This breaks when some targets tested by Clang don't match targets built by LLVM.

  2. Some Clang tests match the bitcode that's being emitted, but the emitted sometimes differs between the legacy and new pass manager.

petrhosek commented 5 years ago

Output from llvm-lit for check-clang

petrhosek commented 5 years ago

I used -DENABLE_EXPERIMENTAL_NEW_PASS_MANAGER=ON CMake option to enable the new pass manager by default which should be equivalent to always passing -fexperimental-new-pass-manager.