[all-commits] [llvm/llvm-project] 22c8b1: [BranchRelaxation] Remove quadratic behavior in re...
Daniel Hoekwater via All-commits
all-commits at lists.llvm.org
Fri Sep 27 06:57:31 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 22c8b1d853dfde925eb63c4907332c596048c631
https://github.com/llvm/llvm-project/commit/22c8b1d853dfde925eb63c4907332c596048c631
Author: Daniel Hoekwater <hoekwater at google.com>
Date: 2024-09-27 (Fri, 27 Sep 2024)
Changed paths:
M llvm/lib/CodeGen/BranchRelaxation.cpp
Log Message:
-----------
[BranchRelaxation] Remove quadratic behavior in relaxation pass (#96250)
Currently, we recompute block offsets after each relaxation. This causes
the complexity to be O(n^2) in the number of instructions, inflating
compile
time.
If we instead recompute block offsets after each iteration of the outer
loop, the complexity is O(n). Recomputing offsets in the outer loop will
cause some out-of-range branches to be missed in the inner loop, but
they will be relaxed in the next iteration of the outer loop.
This change may introduce unnecessary relaxations for an architecture
where the relaxed branch is smaller than the unrelaxed branch, but AFAIK
there is no such architecture.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list