File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -570,6 +570,10 @@ void RISCVPassConfig::addPreEmitPass() {
570
570
addPass (createMachineCopyPropagationPass (true ));
571
571
if (TM->getOptLevel () >= CodeGenOptLevel::Default)
572
572
addPass (createRISCVLateBranchOptPass ());
573
+ // The IndirectBranchTrackingPass inserts lpad and could have changed the
574
+ // basic block alignment. It must be done before Branch Relaxation to
575
+ // prevent the adjusted offset exceeding the branch range.
576
+ addPass (createRISCVIndirectBranchTrackingPass ());
573
577
addPass (&BranchRelaxationPassID);
574
578
addPass (createRISCVMakeCompressibleOptPass ());
575
579
}
@@ -581,7 +585,6 @@ void RISCVPassConfig::addPreEmitPass2() {
581
585
// ensuring return instruction is detected correctly.
582
586
addPass (createRISCVPushPopOptimizationPass ());
583
587
}
584
- addPass (createRISCVIndirectBranchTrackingPass ());
585
588
addPass (createRISCVExpandPseudoPass ());
586
589
587
590
// Schedule the expansion of AMOs at the last possible moment, avoiding the
Original file line number Diff line number Diff line change 62
62
; CHECK-NEXT: Insert fentry calls
63
63
; CHECK-NEXT: Insert XRay ops
64
64
; CHECK-NEXT: Implement the 'patchable-function' attribute
65
+ ; CHECK-NEXT: RISC-V Indirect Branch Tracking
65
66
; CHECK-NEXT: Branch relaxation pass
66
67
; CHECK-NEXT: RISC-V Make Compressible
67
68
; CHECK-NEXT: Contiguously Lay Out Funclets
73
74
; CHECK-NEXT: Lazy Machine Block Frequency Analysis
74
75
; CHECK-NEXT: Machine Optimization Remark Emitter
75
76
; CHECK-NEXT: Stack Frame Layout Analysis
76
- ; CHECK-NEXT: RISC-V Indirect Branch Tracking
77
77
; CHECK-NEXT: RISC-V pseudo instruction expansion pass
78
78
; CHECK-NEXT: RISC-V atomic pseudo instruction expansion pass
79
79
; CHECK-NEXT: Unpack machine instruction bundles
Original file line number Diff line number Diff line change 195
195
; CHECK-NEXT: Implement the 'patchable-function' attribute
196
196
; CHECK-NEXT: Machine Copy Propagation Pass
197
197
; CHECK-NEXT: RISC-V Late Branch Optimisation Pass
198
+ ; CHECK-NEXT: RISC-V Indirect Branch Tracking
198
199
; CHECK-NEXT: Branch relaxation pass
199
200
; CHECK-NEXT: RISC-V Make Compressible
200
201
; CHECK-NEXT: Contiguously Lay Out Funclets
210
211
; CHECK-NEXT: Stack Frame Layout Analysis
211
212
; CHECK-NEXT: RISC-V Zcmp move merging pass
212
213
; CHECK-NEXT: RISC-V Zcmp Push/Pop optimization pass
213
- ; CHECK-NEXT: RISC-V Indirect Branch Tracking
214
214
; CHECK-NEXT: RISC-V pseudo instruction expansion pass
215
215
; CHECK-NEXT: RISC-V atomic pseudo instruction expansion pass
216
216
; CHECK-NEXT: Unpack machine instruction bundles
You can’t perform that action at this time.
0 commit comments