commit | 281028e37ca6c97c62ba68cd43eda2ff95bc70c4 | [log] [tgz] |
---|---|---|
author | Ryotaro Kasuga <kasuga.ryotaro@fujitsu.com> | Fri Mar 21 12:42:49 2025 |
committer | GitHub <noreply@github.com> | Fri Mar 21 12:42:49 2025 |
tree | 03830d3586dabda28a7c315cc625126eb93aead0 | |
parent | ea03bdee7081f25c652d581e274b10cb7c552357 [diff] |
[LoopInterchange] Prevent from undoing its own transformation (#127473) LoopInterchange uses the bubble-sort fashion algorithm to sort the loops in a loop nest. For two loops `A` and `B`, it calls `isProfitable(A, B)` to determine whether these loops should be exchanged. The result of `isProfitable(A, B)` should be conservative, that is, it should return true only when we are sure exchanging `A` and `B` will improve performance. If it's not conservative enough, it's possible that a subsequent `isProfitable(B, A)` will also return true, in which case LoopInterchange will undo its previous transformation. To avoid such cases, `isProfitable(B, A)` must not return true if `isProfitable(A, B)` returned true in the past. However, the current implementation can be in such a situation. This patch resolves it by correcting the handling of two loops that have the same cache cost. This resolve the problem mentioned in https://github.com/llvm/llvm-project/pull/118267#issuecomment-2510759354.
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.