[llvm] r229140 - [mips] Refactor and simplify MipsSEDAGToDAGISel::selectIntAddrLSL2MM(). NFC.
Vasileios Kalintiris
Vasileios.Kalintiris at imgtec.com
Fri Feb 13 11:14:22 PST 2015
Author: vkalintiris
Date: Fri Feb 13 13:14:22 2015
New Revision: 229140
URL: http://llvm.org/viewvc/llvm-project?rev=229140&view=rev
Log:
[mips] Refactor and simplify MipsSEDAGToDAGISel::selectIntAddrLSL2MM(). NFC.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D7618
Modified:
llvm/trunk/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsSEISelDAGToDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsSEISelDAGToDAG.cpp?rev=229140&r1=229139&r2=229140&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsSEISelDAGToDAG.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsSEISelDAGToDAG.cpp Fri Feb 13 13:14:22 2015
@@ -410,18 +410,15 @@ bool MipsSEDAGToDAGISel::selectIntAddrMM
bool MipsSEDAGToDAGISel::selectIntAddrLSL2MM(SDValue Addr, SDValue &Base,
SDValue &Offset) const {
if (selectAddrFrameIndexOffset(Addr, Base, Offset, 7)) {
- if (dyn_cast<FrameIndexSDNode>(Base))
+ if (isa<FrameIndexSDNode>(Base))
return false;
- else {
- ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Offset);
- if (CN) {
- unsigned CnstOff = CN->getZExtValue();
- if (CnstOff == (CnstOff & 0x3c))
- return true;
- }
- return false;
+ if (ConstantSDNode *CN = dyn_cast<ConstantSDNode>(Offset)) {
+ unsigned CnstOff = CN->getZExtValue();
+ return (CnstOff == (CnstOff & 0x3c));
}
+
+ return false;
}
// For all other cases where "lw" would be selected, don't select "lw16"
More information about the llvm-commits
mailing list