diff options
| author | Chris Lattner <sabre@nondot.org> | 2010-09-21 20:31:19 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2010-09-21 20:31:19 +0000 |
| commit | 52a261b3c1391c5fec399ddeb3fc6ee9541e8790 (patch) | |
| tree | 800a9930728ffcc9d6f9a371dce4420ba7828c8c /lib/Target/Mips | |
| parent | 7c727072168c55493ec362e254af1cd740d7eaf2 (diff) | |
| download | external_llvm-52a261b3c1391c5fec399ddeb3fc6ee9541e8790.zip external_llvm-52a261b3c1391c5fec399ddeb3fc6ee9541e8790.tar.gz external_llvm-52a261b3c1391c5fec399ddeb3fc6ee9541e8790.tar.bz2 | |
fix a long standing wart: all the ComplexPattern's were being
passed the root of the match, even though only a few patterns
actually needed this (one in X86, several in ARM [which should
be refactored anyway], and some in CellSPU that I don't feel
like detangling). Instead of requiring all ComplexPatterns to
take the dead root, have targets opt into getting the root by
putting SDNPWantRoot on the ComplexPattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114471 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/Mips')
| -rw-r--r-- | lib/Target/Mips/MipsISelDAGToDAG.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/Target/Mips/MipsISelDAGToDAG.cpp b/lib/Target/Mips/MipsISelDAGToDAG.cpp index a47cf7b..b4fd49d 100644 --- a/lib/Target/Mips/MipsISelDAGToDAG.cpp +++ b/lib/Target/Mips/MipsISelDAGToDAG.cpp @@ -84,8 +84,7 @@ private: SDNode *Select(SDNode *N); // Complex Pattern. - bool SelectAddr(SDNode *Op, SDValue N, - SDValue &Base, SDValue &Offset); + bool SelectAddr(SDValue N, SDValue &Base, SDValue &Offset); SDNode *SelectLoadFp64(SDNode *N); SDNode *SelectStoreFp64(SDNode *N); @@ -110,8 +109,7 @@ SDNode *MipsDAGToDAGISel::getGlobalBaseReg() { /// ComplexPattern used on MipsInstrInfo /// Used on Mips Load/Store instructions bool MipsDAGToDAGISel:: -SelectAddr(SDNode *Op, SDValue Addr, SDValue &Offset, SDValue &Base) -{ +SelectAddr(SDValue Addr, SDValue &Offset, SDValue &Base) { // if Address is FI, get the TargetFrameIndex. if (FrameIndexSDNode *FIN = dyn_cast<FrameIndexSDNode>(Addr)) { Base = CurDAG->getTargetFrameIndex(FIN->getIndex(), MVT::i32); @@ -193,7 +191,7 @@ SDNode *MipsDAGToDAGISel::SelectLoadFp64(SDNode *N) { SDValue N1 = N->getOperand(1); SDValue Offset0, Offset1, Base; - if (!SelectAddr(N, N1, Offset0, Base) || + if (!SelectAddr(N1, Offset0, Base) || N1.getValueType() != MVT::i32) return NULL; @@ -257,7 +255,7 @@ SDNode *MipsDAGToDAGISel::SelectStoreFp64(SDNode *N) { SDValue N2 = N->getOperand(2); SDValue Offset0, Offset1, Base; - if (!SelectAddr(N, N2, Offset0, Base) || + if (!SelectAddr(N2, Offset0, Base) || N1.getValueType() != MVT::f64 || N2.getValueType() != MVT::i32) return NULL; |
