summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2016-02-24 07:58:02 +0000
committerJustin Bogner <mail@justinbogner.com>2016-02-24 07:58:02 +0000
commit38e5217b1e6ce543fcc3c15c1ee463c5e78fa81f (patch)
tree992ec2c6c9bc2357437e3508e25dd14c585f9c32
parent28bb3d9046fb93bc062a6d0bc514d757e0e352bd (diff)
downloadbcm5719-llvm-38e5217b1e6ce543fcc3c15c1ee463c5e78fa81f.tar.gz
bcm5719-llvm-38e5217b1e6ce543fcc3c15c1ee463c5e78fa81f.zip
X86: Wrap a helper for an assert in #ifndef NDEBUG
This function is used in exactly one place, and only in asserts builds. Move it a few lines up before the use and only define it when asserts are enabled. Fixes the release build under -Werror. Also remove the forward declaration and commentary that was basically identical to the code itself. llvm-svn: 261722
-rw-r--r--llvm/lib/Target/X86/X86OptimizeLEAs.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp
index 1114acbc3c7..5a7b562cb1d 100644
--- a/llvm/lib/Target/X86/X86OptimizeLEAs.cpp
+++ b/llvm/lib/Target/X86/X86OptimizeLEAs.cpp
@@ -60,12 +60,6 @@ static inline bool isIdenticalOp(const MachineOperand &MO1,
static bool isSimilarDispOp(const MachineOperand &MO1,
const MachineOperand &MO2);
-/// \brief Returns true if the type of \p MO is valid for address displacement
-/// operand. According to X86DAGToDAGISel::getAddressOperands allowed types are:
-/// MO_Immediate, MO_ConstantPoolIndex, MO_JumpTableIndex, MO_ExternalSymbol,
-/// MO_GlobalAddress, MO_BlockAddress or MO_MCSymbol.
-static inline bool isValidDispOp(const MachineOperand &MO);
-
/// \brief Returns true if the instruction is LEA.
static inline bool isLEA(const MachineInstr &MI);
@@ -188,6 +182,13 @@ static inline bool isIdenticalOp(const MachineOperand &MO1,
!TargetRegisterInfo::isPhysicalRegister(MO1.getReg()));
}
+#ifndef NDEBUG
+static bool isValidDispOp(const MachineOperand &MO) {
+ return MO.isImm() || MO.isCPI() || MO.isJTI() || MO.isSymbol() ||
+ MO.isGlobal() || MO.isBlockAddress() || MO.isMCSymbol();
+}
+#endif
+
static bool isSimilarDispOp(const MachineOperand &MO1,
const MachineOperand &MO2) {
assert(isValidDispOp(MO1) && isValidDispOp(MO2) &&
@@ -205,11 +206,6 @@ static bool isSimilarDispOp(const MachineOperand &MO1,
MO1.getMCSymbol() == MO2.getMCSymbol());
}
-static inline bool isValidDispOp(const MachineOperand &MO) {
- return MO.isImm() || MO.isCPI() || MO.isJTI() || MO.isSymbol() ||
- MO.isGlobal() || MO.isBlockAddress() || MO.isMCSymbol();
-}
-
static inline bool isLEA(const MachineInstr &MI) {
unsigned Opcode = MI.getOpcode();
return Opcode == X86::LEA16r || Opcode == X86::LEA32r ||
OpenPOWER on IntegriCloud