blob: 2fee48570ce1787f19b1c5f128c8baf26e382c3a [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- X86InstrInfo.h - X86 Instruction Information ------------*- C++ -*-===//
Misha Brukmanc88330a2005-04-21 23:38:14 +00002//
John Criswell29265fe2003-10-21 15:17:13 +00003// The LLVM Compiler Infrastructure
4//
Chris Lattnerf3ebc3f2007-12-29 20:36:04 +00005// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
Misha Brukmanc88330a2005-04-21 23:38:14 +00007//
John Criswell29265fe2003-10-21 15:17:13 +00008//===----------------------------------------------------------------------===//
Chris Lattnerd92fb002002-10-25 22:55:53 +00009//
Chris Lattnerb4d58d72003-01-14 22:00:31 +000010// This file contains the X86 implementation of the TargetInstrInfo class.
Chris Lattnerd92fb002002-10-25 22:55:53 +000011//
12//===----------------------------------------------------------------------===//
13
Benjamin Kramera7c40ef2014-08-13 16:26:38 +000014#ifndef LLVM_LIB_TARGET_X86_X86INSTRINFO_H
15#define LLVM_LIB_TARGET_X86_X86INSTRINFO_H
Chris Lattnerd92fb002002-10-25 22:55:53 +000016
Craig Topperc6d4efa2014-03-19 06:53:25 +000017#include "MCTargetDesc/X86BaseInfo.h"
Vyacheslav Klochkov6daefcf2016-08-11 22:07:33 +000018#include "X86InstrFMA3Info.h"
Chris Lattnerd92fb002002-10-25 22:55:53 +000019#include "X86RegisterInfo.h"
Dan Gohman906152a2009-01-05 17:59:02 +000020#include "llvm/ADT/DenseMap.h"
Craig Topperb25fda92012-03-17 18:46:09 +000021#include "llvm/Target/TargetInstrInfo.h"
Chris Lattnerd92fb002002-10-25 22:55:53 +000022
Evan Cheng703a0fb2011-07-01 17:57:27 +000023#define GET_INSTRINFO_HEADER
24#include "X86GenInstrInfo.inc"
25
Brian Gaeke960707c2003-11-11 22:41:34 +000026namespace llvm {
Hans Wennborg4ae51192016-03-25 01:10:56 +000027 class MachineInstrBuilder;
Evan Cheng11b0a5d2006-09-08 06:48:29 +000028 class X86RegisterInfo;
Eric Christopher6c786a12014-06-10 22:34:31 +000029 class X86Subtarget;
Brian Gaeke960707c2003-11-11 22:41:34 +000030
Chris Lattnerc0fb5672006-10-20 17:42:20 +000031namespace X86 {
32 // X86 specific condition code. These correspond to X86_*_COND in
33 // X86InstrInfo.td. They must be kept in synch.
Cong Hou94710842016-03-23 21:45:37 +000034enum CondCode {
35 COND_A = 0,
36 COND_AE = 1,
37 COND_B = 2,
38 COND_BE = 3,
39 COND_E = 4,
40 COND_G = 5,
41 COND_GE = 6,
42 COND_L = 7,
43 COND_LE = 8,
44 COND_NE = 9,
45 COND_NO = 10,
46 COND_NP = 11,
47 COND_NS = 12,
48 COND_O = 13,
49 COND_P = 14,
50 COND_S = 15,
51 LAST_VALID_COND = COND_S,
Dan Gohman97d95d62008-10-21 03:29:32 +000052
Cong Hou94710842016-03-23 21:45:37 +000053 // Artificial condition codes. These are used by AnalyzeBranch
54 // to indicate a block terminated with two conditional branches that together
55 // form a compound condition. They occur in code using FCMP_OEQ or FCMP_UNE,
56 // which can't be represented on x86 with a single condition. These
57 // are never used in MachineInstrs and are inverses of one another.
58 COND_NE_OR_P,
59 COND_E_AND_NP,
Dan Gohman97d95d62008-10-21 03:29:32 +000060
Cong Hou94710842016-03-23 21:45:37 +000061 COND_INVALID
62};
Andrew Trick27c079e2011-03-05 06:31:54 +000063
Cong Hou94710842016-03-23 21:45:37 +000064// Turn condition code into conditional branch opcode.
65unsigned GetCondBranchFromCond(CondCode CC);
Andrew Trick27c079e2011-03-05 06:31:54 +000066
Cong Hou94710842016-03-23 21:45:37 +000067/// \brief Return a set opcode for the given condition and whether it has
68/// a memory operand.
69unsigned getSETFromCond(CondCode CC, bool HasMemoryOperand = false);
Juergen Ributzka2da1bbc2014-06-16 23:58:24 +000070
Cong Hou94710842016-03-23 21:45:37 +000071/// \brief Return a cmov opcode for the given condition, register size in
72/// bytes, and operand type.
73unsigned getCMovFromCond(CondCode CC, unsigned RegBytes,
74 bool HasMemoryOperand = false);
Juergen Ributzka6ef06f92014-06-23 21:55:36 +000075
Cong Hou94710842016-03-23 21:45:37 +000076// Turn CMov opcode into condition code.
77CondCode getCondFromCMovOpc(unsigned Opc);
Michael Liao32376622012-09-20 03:06:15 +000078
Cong Hou94710842016-03-23 21:45:37 +000079/// GetOppositeBranchCondition - Return the inverse of the specified cond,
80/// e.g. turning COND_E to COND_NE.
81CondCode GetOppositeBranchCondition(CondCode CC);
Alexander Kornienkof00654e2015-06-23 09:49:53 +000082} // end namespace X86;
Chris Lattner3a897f32006-10-21 05:52:40 +000083
Chris Lattner377f1d52009-07-10 06:06:17 +000084
Chris Lattnerca9d7842009-07-10 06:29:59 +000085/// isGlobalStubReference - Return true if the specified TargetFlag operand is
Chris Lattner377f1d52009-07-10 06:06:17 +000086/// a reference to a stub for a global, not the global itself.
Chris Lattnerca9d7842009-07-10 06:29:59 +000087inline static bool isGlobalStubReference(unsigned char TargetFlag) {
88 switch (TargetFlag) {
Chris Lattner377f1d52009-07-10 06:06:17 +000089 case X86II::MO_DLLIMPORT: // dllimport stub.
90 case X86II::MO_GOTPCREL: // rip-relative GOT reference.
91 case X86II::MO_GOT: // normal GOT reference.
92 case X86II::MO_DARWIN_NONLAZY_PIC_BASE: // Normal $non_lazy_ptr ref.
93 case X86II::MO_DARWIN_NONLAZY: // Normal $non_lazy_ptr ref.
Chris Lattner377f1d52009-07-10 06:06:17 +000094 return true;
95 default:
96 return false;
97 }
98}
Chris Lattnerd3f32c72009-07-10 07:33:30 +000099
100/// isGlobalRelativeToPICBase - Return true if the specified global value
101/// reference is relative to a 32-bit PIC base (X86ISD::GlobalBaseReg). If this
102/// is true, the addressing mode has the PIC base register added in (e.g. EBX).
103inline static bool isGlobalRelativeToPICBase(unsigned char TargetFlag) {
104 switch (TargetFlag) {
105 case X86II::MO_GOTOFF: // isPICStyleGOT: local global.
106 case X86II::MO_GOT: // isPICStyleGOT: other global.
107 case X86II::MO_PIC_BASE_OFFSET: // Darwin local global.
108 case X86II::MO_DARWIN_NONLAZY_PIC_BASE: // Darwin/32 external global.
Eric Christopherb0e1a452010-06-03 04:07:48 +0000109 case X86II::MO_TLVP: // ??? Pretty sure..
Chris Lattnerd3f32c72009-07-10 07:33:30 +0000110 return true;
111 default:
112 return false;
113 }
114}
Andrew Trick27c079e2011-03-05 06:31:54 +0000115
Anton Korobeynikov4e9dfe82008-06-28 11:07:54 +0000116inline static bool isScale(const MachineOperand &MO) {
Dan Gohman0d1e9a82008-10-03 15:45:36 +0000117 return MO.isImm() &&
Anton Korobeynikov4e9dfe82008-06-28 11:07:54 +0000118 (MO.getImm() == 1 || MO.getImm() == 2 ||
119 MO.getImm() == 4 || MO.getImm() == 8);
120}
121
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000122inline static bool isLeaMem(const MachineInstr &MI, unsigned Op) {
123 if (MI.getOperand(Op).isFI())
124 return true;
125 return Op + X86::AddrSegmentReg <= MI.getNumOperands() &&
126 MI.getOperand(Op + X86::AddrBaseReg).isReg() &&
127 isScale(MI.getOperand(Op + X86::AddrScaleAmt)) &&
128 MI.getOperand(Op + X86::AddrIndexReg).isReg() &&
129 (MI.getOperand(Op + X86::AddrDisp).isImm() ||
130 MI.getOperand(Op + X86::AddrDisp).isGlobal() ||
131 MI.getOperand(Op + X86::AddrDisp).isCPI() ||
132 MI.getOperand(Op + X86::AddrDisp).isJTI());
Anton Korobeynikov4e9dfe82008-06-28 11:07:54 +0000133}
134
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000135inline static bool isMem(const MachineInstr &MI, unsigned Op) {
136 if (MI.getOperand(Op).isFI())
137 return true;
138 return Op + X86::AddrNumOperands <= MI.getNumOperands() &&
139 MI.getOperand(Op + X86::AddrSegmentReg).isReg() && isLeaMem(MI, Op);
Rafael Espindola3b2df102009-04-08 21:14:34 +0000140}
141
Craig Topperec828472014-03-31 06:53:13 +0000142class X86InstrInfo final : public X86GenInstrInfo {
Eric Christopher6c786a12014-06-10 22:34:31 +0000143 X86Subtarget &Subtarget;
Chris Lattnerd92fb002002-10-25 22:55:53 +0000144 const X86RegisterInfo RI;
Andrew Trick27c079e2011-03-05 06:31:54 +0000145
Craig Topper9eadcfd2012-06-01 05:34:01 +0000146 /// RegOp2MemOpTable3Addr, RegOp2MemOpTable0, RegOp2MemOpTable1,
147 /// RegOp2MemOpTable2, RegOp2MemOpTable3 - Load / store folding opcode maps.
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000148 ///
Bruno Cardoso Lopes23eb5262011-09-08 18:35:57 +0000149 typedef DenseMap<unsigned,
Craig Toppere012ede2016-04-30 17:59:49 +0000150 std::pair<uint16_t, uint16_t> > RegOp2MemOpTableType;
Bruno Cardoso Lopes23eb5262011-09-08 18:35:57 +0000151 RegOp2MemOpTableType RegOp2MemOpTable2Addr;
152 RegOp2MemOpTableType RegOp2MemOpTable0;
153 RegOp2MemOpTableType RegOp2MemOpTable1;
154 RegOp2MemOpTableType RegOp2MemOpTable2;
Elena Demikhovsky602f3a22012-05-31 09:20:20 +0000155 RegOp2MemOpTableType RegOp2MemOpTable3;
Robert Khasanov79fb7292014-12-18 12:28:22 +0000156 RegOp2MemOpTableType RegOp2MemOpTable4;
Andrew Trick27c079e2011-03-05 06:31:54 +0000157
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000158 /// MemOp2RegOpTable - Load / store unfolding opcode map.
159 ///
Bruno Cardoso Lopes23eb5262011-09-08 18:35:57 +0000160 typedef DenseMap<unsigned,
Craig Toppere012ede2016-04-30 17:59:49 +0000161 std::pair<uint16_t, uint16_t> > MemOp2RegOpTableType;
Bruno Cardoso Lopes23eb5262011-09-08 18:35:57 +0000162 MemOp2RegOpTableType MemOp2RegOpTable;
163
Craig Topperd9c7d0d2012-06-23 04:58:41 +0000164 static void AddTableEntry(RegOp2MemOpTableType &R2MTable,
165 MemOp2RegOpTableType &M2RTable,
Craig Toppere012ede2016-04-30 17:59:49 +0000166 uint16_t RegOp, uint16_t MemOp, uint16_t Flags);
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000167
Juergen Ributzkad12ccbd2013-11-19 00:57:56 +0000168 virtual void anchor();
169
Sanjoy Das6b34a462015-06-15 18:44:21 +0000170 bool AnalyzeBranchImpl(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
171 MachineBasicBlock *&FBB,
172 SmallVectorImpl<MachineOperand> &Cond,
173 SmallVectorImpl<MachineInstr *> &CondBranches,
174 bool AllowModify) const;
175
Chris Lattnerd92fb002002-10-25 22:55:53 +0000176public:
Eric Christopher6c786a12014-06-10 22:34:31 +0000177 explicit X86InstrInfo(X86Subtarget &STI);
Chris Lattnerd92fb002002-10-25 22:55:53 +0000178
Chris Lattnerb4d58d72003-01-14 22:00:31 +0000179 /// getRegisterInfo - TargetInstrInfo is a superset of MRegister info. As
Chris Lattnerd92fb002002-10-25 22:55:53 +0000180 /// such, whenever a client has an instance of instruction info, it should
181 /// always be able to get register info as well (through this method).
182 ///
Craig Topperf5e3b0b2014-03-09 07:58:15 +0000183 const X86RegisterInfo &getRegisterInfo() const { return RI; }
Chris Lattnerd92fb002002-10-25 22:55:53 +0000184
Serge Pavlov49acf9c2017-04-13 14:10:52 +0000185 /// Returns the stack pointer adjustment that happens inside the frame
186 /// setup..destroy sequence (e.g. by pushes, or inside the callee).
187 int64_t getFrameAdjustment(const MachineInstr &I) const {
188 assert(isFrameInstr(I));
189 return I.getOperand(1).getImm();
190 }
191
192 /// Sets the stack pointer adjustment made inside the frame made up by this
193 /// instruction.
194 void setFrameAdjustment(MachineInstr &I, int64_t V) const {
195 assert(isFrameInstr(I));
196 I.getOperand(1).setImm(V);
197 }
198
Michael Kuperstein13fbd452015-02-01 16:56:04 +0000199 /// getSPAdjust - This returns the stack pointer adjustment made by
200 /// this instruction. For x86, we need to handle more complex call
201 /// sequences involving PUSHes.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000202 int getSPAdjust(const MachineInstr &MI) const override;
Michael Kuperstein13fbd452015-02-01 16:56:04 +0000203
Evan Cheng30bebff2010-01-13 00:30:23 +0000204 /// isCoalescableExtInstr - Return true if the instruction is a "coalescable"
205 /// extension instruction. That is, it's like a copy where it's legal for the
206 /// source to overlap the destination. e.g. X86::MOVSX64rr32. If this returns
207 /// true, then it's expected the pre-extension value is available as a subreg
208 /// of the result register. This also returns the sub-register index in
209 /// SubIdx.
Craig Topper2d9361e2014-03-09 07:44:38 +0000210 bool isCoalescableExtInstr(const MachineInstr &MI,
211 unsigned &SrcReg, unsigned &DstReg,
212 unsigned &SubIdx) const override;
Evan Cheng42166152010-01-12 00:09:37 +0000213
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000214 unsigned isLoadFromStackSlot(const MachineInstr &MI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000215 int &FrameIndex) const override;
David Greene2f4c3742009-11-13 00:29:53 +0000216 /// isLoadFromStackSlotPostFE - Check for post-frame ptr elimination
217 /// stack locations as well. This uses a heuristic so it isn't
218 /// reliable for correctness.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000219 unsigned isLoadFromStackSlotPostFE(const MachineInstr &MI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000220 int &FrameIndex) const override;
David Greene70fdd572009-11-12 20:55:29 +0000221
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000222 unsigned isStoreToStackSlot(const MachineInstr &MI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000223 int &FrameIndex) const override;
David Greene2f4c3742009-11-13 00:29:53 +0000224 /// isStoreToStackSlotPostFE - Check for post-frame ptr elimination
225 /// stack locations as well. This uses a heuristic so it isn't
226 /// reliable for correctness.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000227 unsigned isStoreToStackSlotPostFE(const MachineInstr &MI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000228 int &FrameIndex) const override;
Evan Chenged6e34f2008-03-31 20:40:39 +0000229
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000230 bool isReallyTriviallyReMaterializable(const MachineInstr &MI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000231 AliasAnalysis *AA) const override;
Evan Chenged6e34f2008-03-31 20:40:39 +0000232 void reMaterialize(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
Evan Cheng84517442009-07-16 09:20:10 +0000233 unsigned DestReg, unsigned SubIdx,
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000234 const MachineInstr &Orig,
Craig Topper2d9361e2014-03-09 07:44:38 +0000235 const TargetRegisterInfo &TRI) const override;
Evan Chenged6e34f2008-03-31 20:40:39 +0000236
Tim Northover6833e3f2013-06-10 20:43:49 +0000237 /// Given an operand within a MachineInstr, insert preceding code to put it
238 /// into the right format for a particular kind of LEA instruction. This may
239 /// involve using an appropriate super-register instead (with an implicit use
240 /// of the original) or creating a new virtual register and inserting COPY
241 /// instructions to get the data into the right class.
242 ///
243 /// Reference parameters are set to indicate how caller should add this
244 /// operand to the LEA instruction.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000245 bool classifyLEAReg(MachineInstr &MI, const MachineOperand &Src,
246 unsigned LEAOpcode, bool AllowSP, unsigned &NewSrc,
247 bool &isKill, bool &isUndef,
Matthias Braun7313ca62016-08-09 01:47:26 +0000248 MachineOperand &ImplicitOp, LiveVariables *LV) const;
Tim Northover6833e3f2013-06-10 20:43:49 +0000249
Chris Lattnerb7782d72005-01-02 02:37:07 +0000250 /// convertToThreeAddress - This method must be implemented by targets that
251 /// set the M_CONVERTIBLE_TO_3_ADDR flag. When this flag is set, the target
252 /// may be able to convert a two-address instruction into a true
253 /// three-address instruction on demand. This allows the X86 target (for
254 /// example) to convert ADD and SHL instructions into LEA instructions if they
255 /// would require register copies due to two-addressness.
256 ///
257 /// This method returns a null pointer if the transformation cannot be
258 /// performed, otherwise it returns the new instruction.
259 ///
Craig Topper2d9361e2014-03-09 07:44:38 +0000260 MachineInstr *convertToThreeAddress(MachineFunction::iterator &MFI,
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000261 MachineInstr &MI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000262 LiveVariables *LV) const override;
Chris Lattnerb7782d72005-01-02 02:37:07 +0000263
Andrew Kaylor16c4da02015-09-28 20:33:22 +0000264 /// Returns true iff the routine could find two commutable operands in the
265 /// given machine instruction.
266 /// The 'SrcOpIdx1' and 'SrcOpIdx2' are INPUT and OUTPUT arguments. Their
267 /// input values can be re-defined in this method only if the input values
268 /// are not pre-defined, which is designated by the special value
269 /// 'CommuteAnyOperandIndex' assigned to it.
270 /// If both of indices are pre-defined and refer to some operands, then the
271 /// method simply returns true if the corresponding operands are commutable
272 /// and returns false otherwise.
Chris Lattner29478012005-01-19 07:11:01 +0000273 ///
Andrew Kaylor16c4da02015-09-28 20:33:22 +0000274 /// For example, calling this method this way:
275 /// unsigned Op1 = 1, Op2 = CommuteAnyOperandIndex;
276 /// findCommutedOpIndices(MI, Op1, Op2);
277 /// can be interpreted as a query asking to find an operand that would be
278 /// commutable with the operand#1.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000279 bool findCommutedOpIndices(MachineInstr &MI, unsigned &SrcOpIdx1,
Lang Hamesc59a2d02014-04-02 23:57:49 +0000280 unsigned &SrcOpIdx2) const override;
281
Andrew Kaylor4731bea2015-11-06 19:47:25 +0000282 /// Returns true if the routine could find two commutable operands
Vyacheslav Klochkov6daefcf2016-08-11 22:07:33 +0000283 /// in the given FMA instruction \p MI. Otherwise, returns false.
Andrew Kaylor4731bea2015-11-06 19:47:25 +0000284 ///
285 /// \p SrcOpIdx1 and \p SrcOpIdx2 are INPUT and OUTPUT arguments.
286 /// The output indices of the commuted operands are returned in these
287 /// arguments. Also, the input values of these arguments may be preset either
288 /// to indices of operands that must be commuted or be equal to a special
289 /// value 'CommuteAnyOperandIndex' which means that the corresponding
290 /// operand index is not set and this method is free to pick any of
291 /// available commutable operands.
Vyacheslav Klochkov6daefcf2016-08-11 22:07:33 +0000292 /// The parameter \p FMA3Group keeps the reference to the group of relative
293 /// FMA3 opcodes including register/memory forms of 132/213/231 opcodes.
Andrew Kaylor4731bea2015-11-06 19:47:25 +0000294 ///
295 /// For example, calling this method this way:
296 /// unsigned Idx1 = 1, Idx2 = CommuteAnyOperandIndex;
Vyacheslav Klochkov6daefcf2016-08-11 22:07:33 +0000297 /// findFMA3CommutedOpIndices(MI, Idx1, Idx2, FMA3Group);
Andrew Kaylor4731bea2015-11-06 19:47:25 +0000298 /// can be interpreted as a query asking if the operand #1 can be swapped
299 /// with any other available operand (e.g. operand #2, operand #3, etc.).
300 ///
301 /// The returned FMA opcode may differ from the opcode in the given MI.
302 /// For example, commuting the operands #1 and #3 in the following FMA
303 /// FMA213 #1, #2, #3
304 /// results into instruction with adjusted opcode:
305 /// FMA231 #3, #2, #1
Vyacheslav Klochkov6daefcf2016-08-11 22:07:33 +0000306 bool findFMA3CommutedOpIndices(const MachineInstr &MI,
Craig Topper6172b0b2016-07-23 07:16:53 +0000307 unsigned &SrcOpIdx1,
Vyacheslav Klochkov6daefcf2016-08-11 22:07:33 +0000308 unsigned &SrcOpIdx2,
309 const X86InstrFMA3Group &FMA3Group) const;
310
311 /// Returns an adjusted FMA opcode that must be used in FMA instruction that
312 /// performs the same computations as the given \p MI but which has the
313 /// operands \p SrcOpIdx1 and \p SrcOpIdx2 commuted.
314 /// It may return 0 if it is unsafe to commute the operands.
315 /// Note that a machine instruction (instead of its opcode) is passed as the
316 /// first parameter to make it possible to analyze the instruction's uses and
317 /// commute the first operand of FMA even when it seems unsafe when you look
318 /// at the opcode. For example, it is Ok to commute the first operand of
319 /// VFMADD*SD_Int, if ONLY the lowest 64-bit element of the result is used.
320 ///
321 /// The returned FMA opcode may differ from the opcode in the given \p MI.
322 /// For example, commuting the operands #1 and #3 in the following FMA
323 /// FMA213 #1, #2, #3
324 /// results into instruction with adjusted opcode:
325 /// FMA231 #3, #2, #1
326 unsigned getFMA3OpcodeToCommuteOperands(const MachineInstr &MI,
327 unsigned SrcOpIdx1,
328 unsigned SrcOpIdx2,
329 const X86InstrFMA3Group &FMA3Group) const;
Andrew Kaylor4731bea2015-11-06 19:47:25 +0000330
Chris Lattnerc0fb5672006-10-20 17:42:20 +0000331 // Branch analysis.
Duncan P. N. Exon Smith6307eb52016-02-23 02:46:52 +0000332 bool isUnpredicatedTerminator(const MachineInstr &MI) const override;
Hans Wennborga4686012017-02-16 00:04:05 +0000333 bool isUnconditionalTailCall(const MachineInstr &MI) const override;
334 bool canMakeTailCallConditional(SmallVectorImpl<MachineOperand> &Cond,
335 const MachineInstr &TailCall) const override;
336 void replaceBranchWithTailCall(MachineBasicBlock &MBB,
337 SmallVectorImpl<MachineOperand> &Cond,
338 const MachineInstr &TailCall) const override;
339
Jacques Pienaar71c30a12016-07-15 14:41:04 +0000340 bool analyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
Craig Topper2d9361e2014-03-09 07:44:38 +0000341 MachineBasicBlock *&FBB,
342 SmallVectorImpl<MachineOperand> &Cond,
343 bool AllowModify) const override;
Sanjoy Dasb666ea32015-06-15 18:44:14 +0000344
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000345 bool getMemOpBaseRegImmOfs(MachineInstr &LdSt, unsigned &BaseReg,
Chad Rosierc27a18f2016-03-09 16:00:35 +0000346 int64_t &Offset,
Sanjoy Dasb666ea32015-06-15 18:44:14 +0000347 const TargetRegisterInfo *TRI) const override;
Jacques Pienaar71c30a12016-07-15 14:41:04 +0000348 bool analyzeBranchPredicate(MachineBasicBlock &MBB,
Sanjoy Das6b34a462015-06-15 18:44:21 +0000349 TargetInstrInfo::MachineBranchPredicate &MBP,
350 bool AllowModify = false) const override;
351
Matt Arsenault1b9fc8e2016-09-14 20:43:16 +0000352 unsigned removeBranch(MachineBasicBlock &MBB,
Matt Arsenaulta2b036e2016-09-14 17:23:48 +0000353 int *BytesRemoved = nullptr) const override;
Matt Arsenaulte8e0f5c2016-09-14 17:24:15 +0000354 unsigned insertBranch(MachineBasicBlock &MBB, MachineBasicBlock *TBB,
Ahmed Bougachac88bf542015-06-11 19:30:37 +0000355 MachineBasicBlock *FBB, ArrayRef<MachineOperand> Cond,
Matt Arsenaulta2b036e2016-09-14 17:23:48 +0000356 const DebugLoc &DL,
357 int *BytesAdded = nullptr) const override;
Ahmed Bougachac88bf542015-06-11 19:30:37 +0000358 bool canInsertSelect(const MachineBasicBlock&, ArrayRef<MachineOperand> Cond,
Craig Topper2d9361e2014-03-09 07:44:38 +0000359 unsigned, unsigned, int&, int&, int&) const override;
Benjamin Kramerbdc49562016-06-12 15:39:02 +0000360 void insertSelect(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
361 const DebugLoc &DL, unsigned DstReg,
362 ArrayRef<MachineOperand> Cond, unsigned TrueReg,
363 unsigned FalseReg) const override;
364 void copyPhysReg(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI,
365 const DebugLoc &DL, unsigned DestReg, unsigned SrcReg,
Craig Topper2d9361e2014-03-09 07:44:38 +0000366 bool KillSrc) const override;
367 void storeRegToStackSlot(MachineBasicBlock &MBB,
368 MachineBasicBlock::iterator MI,
369 unsigned SrcReg, bool isKill, int FrameIndex,
370 const TargetRegisterClass *RC,
371 const TargetRegisterInfo *TRI) const override;
Owen Andersoneee14602008-01-01 21:11:32 +0000372
Craig Topperf5e3b0b2014-03-09 07:58:15 +0000373 void storeRegToAddr(MachineFunction &MF, unsigned SrcReg, bool isKill,
374 SmallVectorImpl<MachineOperand> &Addr,
375 const TargetRegisterClass *RC,
376 MachineInstr::mmo_iterator MMOBegin,
377 MachineInstr::mmo_iterator MMOEnd,
378 SmallVectorImpl<MachineInstr*> &NewMIs) const;
Owen Andersoneee14602008-01-01 21:11:32 +0000379
Craig Topper2d9361e2014-03-09 07:44:38 +0000380 void loadRegFromStackSlot(MachineBasicBlock &MBB,
381 MachineBasicBlock::iterator MI,
382 unsigned DestReg, int FrameIndex,
383 const TargetRegisterClass *RC,
384 const TargetRegisterInfo *TRI) const override;
Owen Andersoneee14602008-01-01 21:11:32 +0000385
Craig Topperf5e3b0b2014-03-09 07:58:15 +0000386 void loadRegFromAddr(MachineFunction &MF, unsigned DestReg,
387 SmallVectorImpl<MachineOperand> &Addr,
388 const TargetRegisterClass *RC,
389 MachineInstr::mmo_iterator MMOBegin,
390 MachineInstr::mmo_iterator MMOEnd,
391 SmallVectorImpl<MachineInstr*> &NewMIs) const;
Jakob Stoklund Olesendd1904e2011-09-29 05:10:54 +0000392
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000393 bool expandPostRAPseudo(MachineInstr &MI) const override;
Jakob Stoklund Olesendd1904e2011-09-29 05:10:54 +0000394
Michael Kuperstein47eb85a2016-11-23 18:33:49 +0000395 /// Check whether the target can fold a load that feeds a subreg operand
396 /// (or a subreg operand that feeds a store).
397 bool isSubregFoldable() const override { return true; }
398
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000399 /// foldMemoryOperand - If this target supports it, fold a load or store of
400 /// the specified stack slot into the specified machine instruction for the
401 /// specified operand(s). If this is possible, the target should perform the
402 /// folding and return true, otherwise it should return false. If it folds
403 /// the instruction, it is likely that the MachineInstruction the iterator
404 /// references has been changed.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000405 MachineInstr *
406 foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI,
407 ArrayRef<unsigned> Ops,
408 MachineBasicBlock::iterator InsertPt, int FrameIndex,
409 LiveIntervals *LIS = nullptr) const override;
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000410
411 /// foldMemoryOperand - Same as the previous version except it allows folding
412 /// of any load and store from / to any address, not just from a specific
413 /// stack slot.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000414 MachineInstr *foldMemoryOperandImpl(
415 MachineFunction &MF, MachineInstr &MI, ArrayRef<unsigned> Ops,
416 MachineBasicBlock::iterator InsertPt, MachineInstr &LoadMI,
417 LiveIntervals *LIS = nullptr) const override;
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000418
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000419 /// unfoldMemoryOperand - Separate a single instruction which folded a load or
420 /// a store or a load and a store into two or more instruction. If this is
421 /// possible, returns true as well as the new instructions by reference.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000422 bool
423 unfoldMemoryOperand(MachineFunction &MF, MachineInstr &MI, unsigned Reg,
424 bool UnfoldLoad, bool UnfoldStore,
425 SmallVectorImpl<MachineInstr *> &NewMIs) const override;
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000426
Craig Topper2d9361e2014-03-09 07:44:38 +0000427 bool unfoldMemoryOperand(SelectionDAG &DAG, SDNode *N,
428 SmallVectorImpl<SDNode*> &NewNodes) const override;
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000429
430 /// getOpcodeAfterMemoryUnfold - Returns the opcode of the would be new
431 /// instruction after load / store are unfolded from an instruction of the
432 /// specified opcode. It returns zero if the specified unfolding is not
Dan Gohman49fa51d2009-10-30 22:18:41 +0000433 /// possible. If LoadRegIndex is non-null, it is filled in with the operand
434 /// index of the operand which will hold the register holding the loaded
435 /// value.
Craig Topper2d9361e2014-03-09 07:44:38 +0000436 unsigned getOpcodeAfterMemoryUnfold(unsigned Opc,
437 bool UnfoldLoad, bool UnfoldStore,
Craig Toppere73658d2014-04-28 04:05:08 +0000438 unsigned *LoadRegIndex = nullptr) const override;
Andrew Trick27c079e2011-03-05 06:31:54 +0000439
Evan Cheng4f026f32010-01-22 03:34:51 +0000440 /// areLoadsFromSameBasePtr - This is used by the pre-regalloc scheduler
441 /// to determine if two loads are loading from the same base address. It
442 /// should only return true if the base pointers are the same and the
443 /// only differences between the two addresses are the offset. It also returns
444 /// the offsets by reference.
Craig Topper2d9361e2014-03-09 07:44:38 +0000445 bool areLoadsFromSameBasePtr(SDNode *Load1, SDNode *Load2, int64_t &Offset1,
446 int64_t &Offset2) const override;
Evan Cheng4f026f32010-01-22 03:34:51 +0000447
448 /// shouldScheduleLoadsNear - This is a used by the pre-regalloc scheduler to
Chris Lattner0ab5e2c2011-04-15 05:18:47 +0000449 /// determine (in conjunction with areLoadsFromSameBasePtr) if two loads should
Evan Cheng4f026f32010-01-22 03:34:51 +0000450 /// be scheduled togther. On some targets if two loads are loading from
451 /// addresses in the same cache line, it's better if they are scheduled
452 /// together. This function takes two integers that represent the load offsets
453 /// from the common base address. It returns true if it decides it's desirable
454 /// to schedule the two loads together. "NumLoads" is the number of loads that
455 /// have already been scheduled after Load1.
Craig Topper2d9361e2014-03-09 07:44:38 +0000456 bool shouldScheduleLoadsNear(SDNode *Load1, SDNode *Load2,
457 int64_t Offset1, int64_t Offset2,
458 unsigned NumLoads) const override;
Evan Cheng4f026f32010-01-22 03:34:51 +0000459
Craig Topper2d9361e2014-03-09 07:44:38 +0000460 void getNoopForMachoTarget(MCInst &NopInst) const override;
Chris Lattner6a5e7062010-04-26 23:37:21 +0000461
Craig Topper2d9361e2014-03-09 07:44:38 +0000462 bool
Matt Arsenault1b9fc8e2016-09-14 20:43:16 +0000463 reverseBranchCondition(SmallVectorImpl<MachineOperand> &Cond) const override;
Chris Lattner29478012005-01-19 07:11:01 +0000464
Evan Chengb5f0ec32009-02-06 17:17:30 +0000465 /// isSafeToMoveRegClassDefs - Return true if it's safe to move a machine
466 /// instruction that defines the specified register class.
Craig Topper2d9361e2014-03-09 07:44:38 +0000467 bool isSafeToMoveRegClassDefs(const TargetRegisterClass *RC) const override;
Evan Chengf7137222008-10-27 07:14:50 +0000468
Alexey Volkov6226de62014-05-20 08:55:50 +0000469 /// isSafeToClobberEFLAGS - Return true if it's safe insert an instruction tha
470 /// would clobber the EFLAGS condition register. Note the result may be
471 /// conservative. If it cannot definitely determine the safety after visiting
472 /// a few instructions in each direction it assumes it's not safe.
473 bool isSafeToClobberEFLAGS(MachineBasicBlock &MBB,
474 MachineBasicBlock::iterator I) const;
475
Andrew Kayloraf083d42015-08-26 20:36:52 +0000476 /// True if MI has a condition code def, e.g. EFLAGS, that is
477 /// not marked dead.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000478 bool hasLiveCondCodeDef(MachineInstr &MI) const;
Andrew Kayloraf083d42015-08-26 20:36:52 +0000479
Dan Gohman6ebe7342008-09-30 00:58:23 +0000480 /// getGlobalBaseReg - Return a virtual register initialized with the
481 /// the global base register value. Output instructions required to
482 /// initialize the register in the function entry block, if necessary.
Dan Gohman24300732008-09-23 18:22:58 +0000483 ///
Dan Gohman6ebe7342008-09-30 00:58:23 +0000484 unsigned getGlobalBaseReg(MachineFunction *MF) const;
Dan Gohman24300732008-09-23 18:22:58 +0000485
Jakob Stoklund Olesenb48c9942011-09-27 22:57:18 +0000486 std::pair<uint16_t, uint16_t>
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000487 getExecutionDomain(const MachineInstr &MI) const override;
Jakob Stoklund Olesenb551aa42010-03-29 23:24:21 +0000488
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000489 void setExecutionDomain(MachineInstr &MI, unsigned Domain) const override;
Jakob Stoklund Olesen49e121d2010-03-25 17:25:00 +0000490
Craig Topper2d9361e2014-03-09 07:44:38 +0000491 unsigned
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000492 getPartialRegUpdateClearance(const MachineInstr &MI, unsigned OpNum,
493 const TargetRegisterInfo *TRI) const override;
494 unsigned getUndefRegClearance(const MachineInstr &MI, unsigned &OpNum,
Craig Topper2d9361e2014-03-09 07:44:38 +0000495 const TargetRegisterInfo *TRI) const override;
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000496 void breakPartialRegDependency(MachineInstr &MI, unsigned OpNum,
Craig Topper2d9361e2014-03-09 07:44:38 +0000497 const TargetRegisterInfo *TRI) const override;
Jakob Stoklund Olesenf8ad3362011-11-15 01:15:30 +0000498
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000499 MachineInstr *foldMemoryOperandImpl(MachineFunction &MF, MachineInstr &MI,
Chris Lattnereeba0c72010-09-05 02:18:34 +0000500 unsigned OpNum,
Benjamin Kramerf1362f62015-02-28 12:04:00 +0000501 ArrayRef<MachineOperand> MOs,
Keno Fischere70b31f2015-06-08 20:09:58 +0000502 MachineBasicBlock::iterator InsertPt,
Simon Pilgrim2f9548a2014-10-20 22:14:22 +0000503 unsigned Size, unsigned Alignment,
504 bool AllowCommute) const;
Evan Cheng63c76082010-10-19 18:58:51 +0000505
Craig Topper2d9361e2014-03-09 07:44:38 +0000506 bool isHighLatencyDef(int opc) const override;
Andrew Trick641e2d42011-03-05 08:00:22 +0000507
Matthias Braun88e21312015-06-13 03:42:11 +0000508 bool hasHighOperandLatency(const TargetSchedModel &SchedModel,
Evan Cheng63c76082010-10-19 18:58:51 +0000509 const MachineRegisterInfo *MRI,
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000510 const MachineInstr &DefMI, unsigned DefIdx,
511 const MachineInstr &UseMI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000512 unsigned UseIdx) const override;
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000513
Sanjay Patel08829ba2015-06-10 20:32:21 +0000514 bool useMachineCombiner() const override {
515 return true;
516 }
Chad Rosier03a47302015-09-21 15:09:11 +0000517
518 bool isAssociativeAndCommutative(const MachineInstr &Inst) const override;
519
520 bool hasReassociableOperands(const MachineInstr &Inst,
521 const MachineBasicBlock *MBB) const override;
522
523 void setSpecialOperandAttr(MachineInstr &OldMI1, MachineInstr &OldMI2,
524 MachineInstr &NewMI1,
525 MachineInstr &NewMI2) const override;
Sanjay Patel08829ba2015-06-10 20:32:21 +0000526
Manman Renc9656732012-07-06 17:36:20 +0000527 /// analyzeCompare - For a comparison instruction, return the source registers
528 /// in SrcReg and SrcReg2 if having two register operands, and the value it
529 /// compares against in CmpValue. Return true if the comparison instruction
530 /// can be analyzed.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000531 bool analyzeCompare(const MachineInstr &MI, unsigned &SrcReg,
Craig Topper2d9361e2014-03-09 07:44:38 +0000532 unsigned &SrcReg2, int &CmpMask,
533 int &CmpValue) const override;
Manman Renc9656732012-07-06 17:36:20 +0000534
535 /// optimizeCompareInstr - Check if there exists an earlier instruction that
536 /// operates on the same source operands and sets flags in the same way as
537 /// Compare; remove Compare if possible.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000538 bool optimizeCompareInstr(MachineInstr &CmpInstr, unsigned SrcReg,
Craig Topper2d9361e2014-03-09 07:44:38 +0000539 unsigned SrcReg2, int CmpMask, int CmpValue,
540 const MachineRegisterInfo *MRI) const override;
Manman Renc9656732012-07-06 17:36:20 +0000541
Manman Ren5759d012012-08-02 00:56:42 +0000542 /// optimizeLoadInstr - Try to remove the load by folding it to a register
543 /// operand at the use. We fold the load instructions if and only if the
Manman Renba8122c2012-08-02 19:37:32 +0000544 /// def and use are in the same BB. We only look at one load and see
545 /// whether it can be folded into MI. FoldAsLoadDefReg is the virtual register
546 /// defined by the load we are trying to fold. DefMI returns the machine
547 /// instruction that defines FoldAsLoadDefReg, and the function returns
548 /// the machine instruction generated due to folding.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000549 MachineInstr *optimizeLoadInstr(MachineInstr &MI,
Craig Topper2d9361e2014-03-09 07:44:38 +0000550 const MachineRegisterInfo *MRI,
551 unsigned &FoldAsLoadDefReg,
552 MachineInstr *&DefMI) const override;
Manman Ren5759d012012-08-02 00:56:42 +0000553
Alex Lorenz49873a82015-08-06 00:44:07 +0000554 std::pair<unsigned, unsigned>
555 decomposeMachineOperandsTargetFlags(unsigned TF) const override;
556
557 ArrayRef<std::pair<unsigned, const char *>>
558 getSerializableDirectMachineOperandTargetFlags() const override;
559
Jessica Paquette596f4832017-03-06 21:31:18 +0000560 unsigned getOutliningBenefit(size_t SequenceSize,
Jessica Paquettec984e212017-03-13 18:39:33 +0000561 size_t Occurrences,
562 bool CanBeTailCall) const override;
Jessica Paquette596f4832017-03-06 21:31:18 +0000563
564 bool isFunctionSafeToOutlineFrom(MachineFunction &MF) const override;
565
566 llvm::X86GenInstrInfo::MachineOutlinerInstrType
567 getOutliningType(MachineInstr &MI) const override;
568
569 void insertOutlinerEpilogue(MachineBasicBlock &MBB,
Jessica Paquettec984e212017-03-13 18:39:33 +0000570 MachineFunction &MF,
571 bool IsTailCall) const override;
Jessica Paquette596f4832017-03-06 21:31:18 +0000572
573 void insertOutlinerPrologue(MachineBasicBlock &MBB,
Jessica Paquettec984e212017-03-13 18:39:33 +0000574 MachineFunction &MF,
575 bool isTailCall) const override;
Jessica Paquette596f4832017-03-06 21:31:18 +0000576
577 MachineBasicBlock::iterator
578 insertOutlinedCall(Module &M, MachineBasicBlock &MBB,
579 MachineBasicBlock::iterator &It,
Jessica Paquettec984e212017-03-13 18:39:33 +0000580 MachineFunction &MF,
581 bool IsTailCall) const override;
Andrew Kaylor16c4da02015-09-28 20:33:22 +0000582protected:
583 /// Commutes the operands in the given instruction by changing the operands
584 /// order and/or changing the instruction's opcode and/or the immediate value
585 /// operand.
586 ///
587 /// The arguments 'CommuteOpIdx1' and 'CommuteOpIdx2' specify the operands
588 /// to be commuted.
589 ///
590 /// Do not call this method for a non-commutable instruction or
591 /// non-commutable operands.
592 /// Even though the instruction is commutable, the method may still
593 /// fail to commute the operands, null pointer is returned in such cases.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000594 MachineInstr *commuteInstructionImpl(MachineInstr &MI, bool NewMI,
Andrew Kaylor16c4da02015-09-28 20:33:22 +0000595 unsigned CommuteOpIdx1,
596 unsigned CommuteOpIdx2) const override;
597
Owen Anderson2a3be7b2008-01-07 01:35:02 +0000598private:
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000599 MachineInstr *convertToThreeAddressWithLEA(unsigned MIOpc,
600 MachineFunction::iterator &MFI,
601 MachineInstr &MI,
602 LiveVariables *LV) const;
Evan Cheng766a73f2009-12-11 06:01:48 +0000603
Simon Pilgrim7e6606f2015-11-04 20:48:09 +0000604 /// Handles memory folding for special case instructions, for instance those
605 /// requiring custom manipulation of the address.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000606 MachineInstr *foldMemoryOperandCustom(MachineFunction &MF, MachineInstr &MI,
Simon Pilgrim7e6606f2015-11-04 20:48:09 +0000607 unsigned OpNum,
608 ArrayRef<MachineOperand> MOs,
609 MachineBasicBlock::iterator InsertPt,
610 unsigned Size, unsigned Align) const;
611
David Greene70fdd572009-11-12 20:55:29 +0000612 /// isFrameOperand - Return true and the FrameIndex if the specified
613 /// operand and follow operands form a reference to the stack frame.
Duncan P. N. Exon Smith9cfc75c2016-06-30 00:01:54 +0000614 bool isFrameOperand(const MachineInstr &MI, unsigned int Op,
David Greene70fdd572009-11-12 20:55:29 +0000615 int &FrameIndex) const;
Craig Topper202b4532016-09-22 03:00:50 +0000616
617 /// Returns true iff the routine could find two commutable operands in the
618 /// given machine instruction with 3 vector inputs.
619 /// The 'SrcOpIdx1' and 'SrcOpIdx2' are INPUT and OUTPUT arguments. Their
620 /// input values can be re-defined in this method only if the input values
621 /// are not pre-defined, which is designated by the special value
622 /// 'CommuteAnyOperandIndex' assigned to it.
623 /// If both of indices are pre-defined and refer to some operands, then the
624 /// method simply returns true if the corresponding operands are commutable
625 /// and returns false otherwise.
626 ///
627 /// For example, calling this method this way:
628 /// unsigned Op1 = 1, Op2 = CommuteAnyOperandIndex;
629 /// findThreeSrcCommutedOpIndices(MI, Op1, Op2);
630 /// can be interpreted as a query asking to find an operand that would be
631 /// commutable with the operand#1.
632 bool findThreeSrcCommutedOpIndices(const MachineInstr &MI,
633 unsigned &SrcOpIdx1,
634 unsigned &SrcOpIdx2) const;
Chris Lattnerd92fb002002-10-25 22:55:53 +0000635};
636
Alexander Kornienkof00654e2015-06-23 09:49:53 +0000637} // End llvm namespace
Brian Gaeke960707c2003-11-11 22:41:34 +0000638
Chris Lattnerd92fb002002-10-25 22:55:53 +0000639#endif