Skip to content

[CodeLayout] Fix X1_Y_X2 and Y_X2_X1 testing for jumps from Y #66592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion llvm/lib/Transforms/Utils/CodeLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ class ExtTSPImpl {

// Attach (a part of) ChainPred after the last node of ChainSucc.
for (JumpT *Jump : ChainSucc->Nodes.back()->OutJumps) {
const NodeT *DstBlock = Jump->Source;
const NodeT *DstBlock = Jump->Target;
if (DstBlock->CurChain != ChainPred)
continue;
size_t Offset = DstBlock->CurIndex;
Expand Down
7 changes: 3 additions & 4 deletions llvm/test/CodeGen/X86/code_placement_ext_tsp_large.ll
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,18 @@ define void @func_large() !prof !0 {
; CHECK: b7
; CHECK: b9
;
; An expected output with chain-split-threshold=1 (disabling splitting) -- the
; increase of the layout score is smaller, ~7%:
; An expected output with chain-split-threshold=1 (disabling split point enumeration)
;
; CHECK2-LABEL: Applying ext-tsp layout
; CHECK2: original layout score: 9171074274.27
; CHECK2: optimized layout score: 9810644873.57
; CHECK2: optimized layout score: 10844307310.87
; CHECK2: b0
; CHECK2: b2
; CHECK2: b3
; CHECK2: b4
; CHECK2: b5
; CHECK2: b1
; CHECK2: b8
; CHECK2: b1
; CHECK2: b6
; CHECK2: b7
; CHECK2: b9
Expand Down