aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/BranchRelaxation.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2023-01-27 11:52:22 -0800
committerPhilip Reames <listmail@philipreames.com>2023-01-27 11:52:22 -0800
commit36244914b42e9ec6b9f01d95efe17c693ae950bc (patch)
tree9d77dbe699e37e6a26b03880de37e861146eab27 /llvm/lib/CodeGen/BranchRelaxation.cpp
parentd199bf98229229d5ebd3c0999cc68d0d72558d83 (diff)
downloadllvm-36244914b42e9ec6b9f01d95efe17c693ae950bc.zip
llvm-36244914b42e9ec6b9f01d95efe17c693ae950bc.tar.gz
llvm-36244914b42e9ec6b9f01d95efe17c693ae950bc.tar.bz2
Revert "[BranchRelaxation] Move faulting_op check into callee [nfc]"
This reverts commit c549da959b81902789a17918c5b95d4449e6fdfa. Per buildbots, this was not NFC.
Diffstat (limited to 'llvm/lib/CodeGen/BranchRelaxation.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchRelaxation.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/BranchRelaxation.cpp b/llvm/lib/CodeGen/BranchRelaxation.cpp
index 81d1361..016c81d 100644
--- a/llvm/lib/CodeGen/BranchRelaxation.cpp
+++ b/llvm/lib/CodeGen/BranchRelaxation.cpp
@@ -284,12 +284,6 @@ MachineBasicBlock *BranchRelaxation::splitBlockBeforeInstr(MachineInstr &MI,
/// specific BB can fit in MI's displacement field.
bool BranchRelaxation::isBlockInRange(
const MachineInstr &MI, const MachineBasicBlock &DestBB) const {
-
- // FAULTING_OP's destination is not encoded in the instruction stream
- // and thus always in range.
- if (MI.getOpcode() == TargetOpcode::FAULTING_OP)
- return true;
-
int64_t BrOffset = getInstrOffset(MI);
int64_t DestOffset = BlockInfo[DestBB.getNumber()].Offset;
@@ -564,6 +558,11 @@ bool BranchRelaxation::relaxBranchInstructions() {
if (!MI.isConditionalBranch())
continue;
+ if (MI.getOpcode() == TargetOpcode::FAULTING_OP)
+ // FAULTING_OP's destination is not encoded in the instruction stream
+ // and thus never needs relaxed.
+ continue;
+
MachineBasicBlock *DestBB = TII->getBranchDestBlock(MI);
if (!isBlockInRange(MI, *DestBB)) {
if (Next != MBB.end() && Next->isConditionalBranch()) {