diff options
Diffstat (limited to 'llvm/lib/Target/AArch64/AArch64InstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index 05bc1cbead2..d3599537a9d 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -132,6 +132,13 @@ static unsigned getBranchMaxDisplacementBytes(unsigned Opc) { unsigned Bits = getBranchDisplacementBits(Opc); unsigned MaxOffs = ((1 << (Bits - 1)) - 1) << 2; + + // Verify the displacement bits options have sane values. + // XXX: Is there a better place for this? + assert(MaxOffs >= 8 && + "max branch displacement must be enough to jump" + "over conditional branch expansion"); + return MaxOffs; } |