summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/Alpha
diff options
context:
space:
mode:
authorAndrew Lenharth <andrewl@lenharth.org>2006-02-03 03:07:37 +0000
committerAndrew Lenharth <andrewl@lenharth.org>2006-02-03 03:07:37 +0000
commit1318240fd0dad4ab4dd3d6cf55ca050112810060 (patch)
tree64e5f39c2573867b74de5275920e102d0a85e8a3 /llvm/lib/Target/Alpha
parent774d4a190b710a0e238abcd223993656c8b7b120 (diff)
downloadbcm5719-llvm-1318240fd0dad4ab4dd3d6cf55ca050112810060.tar.gz
bcm5719-llvm-1318240fd0dad4ab4dd3d6cf55ca050112810060.zip
isStoreToStackSlot
llvm-svn: 25925
Diffstat (limited to 'llvm/lib/Target/Alpha')
-rw-r--r--llvm/lib/Target/Alpha/AlphaInstrInfo.cpp18
-rw-r--r--llvm/lib/Target/Alpha/AlphaInstrInfo.h1
-rw-r--r--llvm/lib/Target/Alpha/AlphaInstrInfo.td4
3 files changed, 20 insertions, 3 deletions
diff --git a/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp b/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp
index c64fe3bee94..7089f52e487 100644
--- a/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp
+++ b/llvm/lib/Target/Alpha/AlphaInstrInfo.cpp
@@ -61,3 +61,21 @@ AlphaInstrInfo::isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const {
return 0;
}
+unsigned
+AlphaInstrInfo::isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const {
+ switch (MI->getOpcode()) {
+ case Alpha::STL:
+ case Alpha::STQ:
+ case Alpha::STB:
+ case Alpha::STW:
+ case Alpha::STS:
+ case Alpha::STT:
+ if (MI->getOperand(1).isFrameIndex()) {
+ FrameIndex = MI->getOperand(1).getFrameIndex();
+ return MI->getOperand(0).getReg();
+ }
+ break;
+ }
+ return 0;
+}
+
diff --git a/llvm/lib/Target/Alpha/AlphaInstrInfo.h b/llvm/lib/Target/Alpha/AlphaInstrInfo.h
index 5211e6fcf57..7eed9effbf1 100644
--- a/llvm/lib/Target/Alpha/AlphaInstrInfo.h
+++ b/llvm/lib/Target/Alpha/AlphaInstrInfo.h
@@ -37,6 +37,7 @@ public:
unsigned &SrcReg, unsigned &DstReg) const;
virtual unsigned isLoadFromStackSlot(MachineInstr *MI, int &FrameIndex) const;
+ virtual unsigned isStoreToStackSlot(MachineInstr *MI, int &FrameIndex) const;
};
}
diff --git a/llvm/lib/Target/Alpha/AlphaInstrInfo.td b/llvm/lib/Target/Alpha/AlphaInstrInfo.td
index 1d86462cd57..26891bc1713 100644
--- a/llvm/lib/Target/Alpha/AlphaInstrInfo.td
+++ b/llvm/lib/Target/Alpha/AlphaInstrInfo.td
@@ -177,9 +177,7 @@ def CMOVLBSi : OForm4L< 0x11, 0x14, "cmovlbs $RCOND,$RTRUE,$RDEST",
[(set GPRC:$RDEST, (select (xor GPRC:$RCOND, 1), GPRC:$RFALSE, immUExt8:$RTRUE))]>;
-//FIXME: fold setcc with select for all cases. clearly I need patterns for inverted conditions
-// and constants (which require inverted conditions as legalize puts the constant in the
-// wrong field for the instruction definition
+//General pattern for cmov
def : Pat<(select GPRC:$which, GPRC:$src1, GPRC:$src2),
(CMOVNE GPRC:$src2, GPRC:$src1, GPRC:$which)>;
def : Pat<(select GPRC:$which, GPRC:$src1, immUExt8:$src2),
OpenPOWER on IntegriCloud