[llvm] r277434 - AArch64: Assert on branch displacement bits
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 2 01:56:52 PDT 2016
Author: arsenm
Date: Tue Aug 2 03:56:52 2016
New Revision: 277434
URL: http://llvm.org/viewvc/llvm-project?rev=277434&view=rev
Log:
AArch64: Assert on branch displacement bits
Modified:
llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp?rev=277434&r1=277433&r2=277434&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrInfo.cpp Tue Aug 2 03:56:52 2016
@@ -132,6 +132,13 @@ static unsigned getBranchMaxDisplacement
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;
}
More information about the llvm-commits
mailing list