Only compare tied variants that share a runtime condition Each tied variant was compared with every other tied variant until a strict superset was found, trying the supersets found so far first. When each superset has a different runtime condition, the cache never hits, so a selection is quadratic in the number of tied variants, and Flang selects repeatedly to build the ELSE chain. With 160 TASKYIELD clauses with conditions `x(i)` followed by 160 TASKWAIT clauses with the same conditions and `kind(cpu)`, MLIR generation took 3.3s instead of 0.5s before this PR. A variant with a runtime condition can only be a strict subset of one with the same condition, so group the tied variants by condition and scan only that group, keeping the cache per group. A variant without a runtime condition still scans every tied variant. The example now takes 0.64s. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Welcome to the LLVM project!
This repository contains the source code for LLVM, a toolkit for the construction of highly optimized compilers, optimizers, and run-time environments.
The LLVM project has multiple components. The core of the project is itself called “LLVM”. This contains all of the tools, libraries, and header files needed to process intermediate representations and convert them into object files. Tools include an assembler, disassembler, bitcode analyzer, and bitcode optimizer.
C-like languages use the Clang frontend. This component compiles C, C++, Objective-C, and Objective-C++ code into LLVM bitcode -- and from there into object files, using LLVM.
Other components include: the libc++ C++ standard library, the LLD linker, and more.
Consult the Getting Started with LLVM page for information on building and running LLVM.
For information on how to contribute to the LLVM project, please take a look at the Contributing to LLVM guide.
Join the LLVM Discourse forums, Discord chat, LLVM Office Hours or Regular sync-ups.
The LLVM project has adopted a code of conduct for participants to all modes of communication within the project.