blob: cd847bfba802cc75bfc50d8b79912d51d615a0c4 [file] [log] [blame]
Chris Lattner1c809c52004-02-29 00:27:00 +00001//===-- InstSelectSimple.cpp - A simple instruction selector for SparcV8 --===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file was developed by the LLVM research group and is distributed under
6// the University of Illinois Open Source License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10// This file defines a simple peephole instruction selector for the V8 target
11//
12//===----------------------------------------------------------------------===//
13
14#include "SparcV8.h"
Brian Gaekebc1d27a2004-03-03 23:03:14 +000015#include "SparcV8InstrInfo.h"
Chris Lattner1c809c52004-02-29 00:27:00 +000016#include "llvm/Instructions.h"
17#include "llvm/IntrinsicLowering.h"
18#include "llvm/Pass.h"
Brian Gaekebc1d27a2004-03-03 23:03:14 +000019#include "llvm/Constants.h"
Chris Lattner1c809c52004-02-29 00:27:00 +000020#include "llvm/CodeGen/MachineInstrBuilder.h"
21#include "llvm/CodeGen/MachineFunction.h"
Brian Gaekebc1d27a2004-03-03 23:03:14 +000022#include "llvm/CodeGen/SSARegMap.h"
Chris Lattner1c809c52004-02-29 00:27:00 +000023#include "llvm/Target/TargetMachine.h"
24#include "llvm/Support/GetElementPtrTypeIterator.h"
25#include "llvm/Support/InstVisitor.h"
26#include "llvm/Support/CFG.h"
27using namespace llvm;
28
29namespace {
30 struct V8ISel : public FunctionPass, public InstVisitor<V8ISel> {
31 TargetMachine &TM;
32 MachineFunction *F; // The function we are compiling into
33 MachineBasicBlock *BB; // The current MBB we are compiling
34
35 std::map<Value*, unsigned> RegMap; // Mapping between Val's and SSA Regs
36
37 // MBBMap - Mapping between LLVM BB -> Machine BB
38 std::map<const BasicBlock*, MachineBasicBlock*> MBBMap;
39
40 V8ISel(TargetMachine &tm) : TM(tm), F(0), BB(0) {}
41
42 /// runOnFunction - Top level implementation of instruction selection for
43 /// the entire function.
44 ///
45 bool runOnFunction(Function &Fn);
46
47 virtual const char *getPassName() const {
48 return "SparcV8 Simple Instruction Selection";
49 }
50
51 /// visitBasicBlock - This method is called when we are visiting a new basic
52 /// block. This simply creates a new MachineBasicBlock to emit code into
53 /// and adds it to the current MachineFunction. Subsequent visit* for
54 /// instructions will be invoked for all instructions in the basic block.
55 ///
56 void visitBasicBlock(BasicBlock &LLVM_BB) {
57 BB = MBBMap[&LLVM_BB];
58 }
59
Chris Lattner4be7ca52004-04-07 04:27:16 +000060 void visitBinaryOperator(Instruction &I);
61 void visitShiftInstruction(Instruction &I) { visitBinaryOperator(I); }
Chris Lattner4d0cda42004-04-07 05:04:51 +000062 void visitSetCondInst(Instruction &I);
Chris Lattner4be7ca52004-04-07 04:27:16 +000063 void visitCallInst(CallInst &I);
64 void visitReturnInst(ReturnInst &RI);
Chris Lattner1c809c52004-02-29 00:27:00 +000065
66 void visitInstruction(Instruction &I) {
67 std::cerr << "Unhandled instruction: " << I;
68 abort();
69 }
70
71 /// LowerUnknownIntrinsicFunctionCalls - This performs a prepass over the
72 /// function, lowering any calls to unknown intrinsic functions into the
73 /// equivalent LLVM code.
74 void LowerUnknownIntrinsicFunctionCalls(Function &F);
Chris Lattner1c809c52004-02-29 00:27:00 +000075 void visitIntrinsicCall(Intrinsic::ID ID, CallInst &CI);
76
Brian Gaekebc1d27a2004-03-03 23:03:14 +000077 /// copyConstantToRegister - Output the instructions required to put the
78 /// specified constant into the specified register.
79 ///
80 void copyConstantToRegister(MachineBasicBlock *MBB,
81 MachineBasicBlock::iterator IP,
82 Constant *C, unsigned R);
83
84 /// makeAnotherReg - This method returns the next register number we haven't
85 /// yet used.
86 ///
87 /// Long values are handled somewhat specially. They are always allocated
88 /// as pairs of 32 bit integer values. The register number returned is the
89 /// lower 32 bits of the long value, and the regNum+1 is the upper 32 bits
90 /// of the long value.
91 ///
92 unsigned makeAnotherReg(const Type *Ty) {
93 assert(dynamic_cast<const SparcV8RegisterInfo*>(TM.getRegisterInfo()) &&
94 "Current target doesn't have SparcV8 reg info??");
95 const SparcV8RegisterInfo *MRI =
96 static_cast<const SparcV8RegisterInfo*>(TM.getRegisterInfo());
97 if (Ty == Type::LongTy || Ty == Type::ULongTy) {
98 const TargetRegisterClass *RC = MRI->getRegClassForType(Type::IntTy);
99 // Create the lower part
100 F->getSSARegMap()->createVirtualRegister(RC);
101 // Create the upper part.
102 return F->getSSARegMap()->createVirtualRegister(RC)-1;
103 }
104
105 // Add the mapping of regnumber => reg class to MachineFunction
106 const TargetRegisterClass *RC = MRI->getRegClassForType(Ty);
107 return F->getSSARegMap()->createVirtualRegister(RC);
108 }
109
110 unsigned getReg(Value &V) { return getReg (&V); } // allow refs.
111 unsigned getReg(Value *V) {
112 // Just append to the end of the current bb.
113 MachineBasicBlock::iterator It = BB->end();
114 return getReg(V, BB, It);
115 }
116 unsigned getReg(Value *V, MachineBasicBlock *MBB,
117 MachineBasicBlock::iterator IPt) {
118 unsigned &Reg = RegMap[V];
119 if (Reg == 0) {
120 Reg = makeAnotherReg(V->getType());
121 RegMap[V] = Reg;
122 }
123 // If this operand is a constant, emit the code to copy the constant into
124 // the register here...
125 //
126 if (Constant *C = dyn_cast<Constant>(V)) {
127 copyConstantToRegister(MBB, IPt, C, Reg);
128 RegMap.erase(V); // Assign a new name to this constant if ref'd again
129 } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
130 // Move the address of the global into the register
Brian Gaekecf471982004-03-09 04:49:13 +0000131 unsigned TmpReg = makeAnotherReg(V->getType());
132 BuildMI (*MBB, IPt, V8::SETHIi, 1, TmpReg).addGlobalAddress (GV);
133 BuildMI (*MBB, IPt, V8::ORri, 2, Reg).addReg (TmpReg)
134 .addGlobalAddress (GV);
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000135 RegMap.erase(V); // Assign a new name to this address if ref'd again
136 }
137
138 return Reg;
139 }
140
Chris Lattner1c809c52004-02-29 00:27:00 +0000141 };
142}
143
144FunctionPass *llvm::createSparcV8SimpleInstructionSelector(TargetMachine &TM) {
145 return new V8ISel(TM);
146}
147
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000148enum TypeClass {
Brian Gaekef57e3642004-03-16 22:37:11 +0000149 cByte, cShort, cInt, cLong, cFloat, cDouble
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000150};
151
152static TypeClass getClass (const Type *T) {
153 switch (T->getPrimitiveID ()) {
154 case Type::UByteTyID: case Type::SByteTyID: return cByte;
155 case Type::UShortTyID: case Type::ShortTyID: return cShort;
156 case Type::UIntTyID: case Type::IntTyID: return cInt;
Brian Gaekef57e3642004-03-16 22:37:11 +0000157 case Type::ULongTyID: case Type::LongTyID: return cLong;
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000158 case Type::FloatTyID: return cFloat;
159 case Type::DoubleTyID: return cDouble;
160 default:
161 assert (0 && "Type of unknown class passed to getClass?");
162 return cByte;
163 }
164}
Chris Lattner0d538bb2004-04-07 04:36:53 +0000165static TypeClass getClassB(const Type *T) {
166 if (T == Type::BoolTy) return cByte;
167 return getClass(T);
168}
169
170
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000171
172/// copyConstantToRegister - Output the instructions required to put the
173/// specified constant into the specified register.
174///
175void V8ISel::copyConstantToRegister(MachineBasicBlock *MBB,
176 MachineBasicBlock::iterator IP,
177 Constant *C, unsigned R) {
Brian Gaeke775158d2004-03-04 04:37:45 +0000178 if (ConstantInt *CI = dyn_cast<ConstantInt> (C)) {
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000179 unsigned Class = getClass(C->getType());
Chris Lattner4be7ca52004-04-07 04:27:16 +0000180 uint64_t Val = CI->getRawValue ();
Brian Gaekee8061732004-03-04 00:56:25 +0000181 switch (Class) {
182 case cByte:
Chris Lattner4be7ca52004-04-07 04:27:16 +0000183 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (V8::G0).addImm((uint8_t)Val);
Brian Gaekee8061732004-03-04 00:56:25 +0000184 return;
185 case cShort: {
186 unsigned TmpReg = makeAnotherReg (C->getType ());
Chris Lattner4be7ca52004-04-07 04:27:16 +0000187 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg)
188 .addImm (((uint16_t) Val) >> 10);
189 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
190 .addImm (((uint16_t) Val) & 0x03ff);
Brian Gaekee8061732004-03-04 00:56:25 +0000191 return;
192 }
193 case cInt: {
194 unsigned TmpReg = makeAnotherReg (C->getType ());
Chris Lattner4be7ca52004-04-07 04:27:16 +0000195 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addImm(((uint32_t)Val) >> 10);
196 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
197 .addImm (((uint32_t) Val) & 0x03ff);
Brian Gaekee8061732004-03-04 00:56:25 +0000198 return;
199 }
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000200 case cLong: {
201 unsigned TmpReg = makeAnotherReg (Type::UIntTy);
Chris Lattner4be7ca52004-04-07 04:27:16 +0000202 uint32_t topHalf = (uint32_t) (Val >> 32);
203 uint32_t bottomHalf = (uint32_t)Val;
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000204 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addImm (topHalf >> 10);
Chris Lattner4be7ca52004-04-07 04:27:16 +0000205 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
206 .addImm (topHalf & 0x03ff);
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000207 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addImm (bottomHalf >> 10);
Chris Lattner4be7ca52004-04-07 04:27:16 +0000208 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
209 .addImm (bottomHalf & 0x03ff);
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000210 return;
211 }
Brian Gaekee8061732004-03-04 00:56:25 +0000212 default:
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000213 std::cerr << "Offending constant: " << *C << "\n";
Brian Gaeke775158d2004-03-04 04:37:45 +0000214 assert (0 && "Can't copy this kind of constant into register yet");
Brian Gaekee8061732004-03-04 00:56:25 +0000215 return;
216 }
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000217 }
218
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000219 std::cerr << "Offending constant: " << *C << "\n";
Brian Gaeke775158d2004-03-04 04:37:45 +0000220 assert (0 && "Can't copy this kind of constant into register yet");
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000221}
Chris Lattner1c809c52004-02-29 00:27:00 +0000222
223bool V8ISel::runOnFunction(Function &Fn) {
224 // First pass over the function, lower any unknown intrinsic functions
225 // with the IntrinsicLowering class.
226 LowerUnknownIntrinsicFunctionCalls(Fn);
227
228 F = &MachineFunction::construct(&Fn, TM);
229
230 // Create all of the machine basic blocks for the function...
231 for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
232 F->getBasicBlockList().push_back(MBBMap[I] = new MachineBasicBlock(I));
233
234 BB = &F->front();
235
236 // Set up a frame object for the return address. This is used by the
237 // llvm.returnaddress & llvm.frameaddress intrinisics.
238 //ReturnAddressIndex = F->getFrameInfo()->CreateFixedObject(4, -4);
239
240 // Copy incoming arguments off of the stack and out of fixed registers.
241 //LoadArgumentsToVirtualRegs(Fn);
242
243 // Instruction select everything except PHI nodes
244 visit(Fn);
245
246 // Select the PHI nodes
247 //SelectPHINodes();
248
249 RegMap.clear();
250 MBBMap.clear();
251 F = 0;
252 // We always build a machine code representation for the function
253 return true;
254}
255
Brian Gaekef7e44ef2004-04-02 20:53:33 +0000256void V8ISel::visitCallInst(CallInst &I) {
257 assert (I.getNumOperands () == 1 && "Can't handle call args yet");
Brian Gaekeea8494b2004-04-06 22:09:23 +0000258 unsigned DestReg = getReg (I);
Brian Gaekef7e44ef2004-04-02 20:53:33 +0000259 BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
Brian Gaekeea8494b2004-04-06 22:09:23 +0000260 if (I.getType ()->getPrimitiveID () == Type::VoidTyID)
261 return;
262 // Deal w/ return value
263 switch (getClass (I.getType ())) {
264 case cByte:
265 case cShort:
266 case cInt:
267 // Schlep it over into the destination register
268 BuildMI (BB, V8::ORrr, 2, DestReg).addReg(V8::G0).addReg(V8::O0);
269 break;
270 default:
271 visitInstruction (I);
272 return;
273 }
Brian Gaekef7e44ef2004-04-02 20:53:33 +0000274}
Chris Lattner1c809c52004-02-29 00:27:00 +0000275
276void V8ISel::visitReturnInst(ReturnInst &I) {
Brian Gaeke08f64c32004-03-06 05:32:28 +0000277 if (I.getNumOperands () == 1) {
278 unsigned RetValReg = getReg (I.getOperand (0));
279 switch (getClass (I.getOperand (0)->getType ())) {
280 case cByte:
281 case cShort:
282 case cInt:
283 // Schlep it over into i0 (where it will become o0 after restore).
284 BuildMI (BB, V8::ORrr, 2, V8::I0).addReg(V8::G0).addReg(RetValReg);
285 break;
286 default:
287 visitInstruction (I);
288 return;
289 }
Chris Lattner1c809c52004-02-29 00:27:00 +0000290 }
Chris Lattner0d538bb2004-04-07 04:36:53 +0000291
Brian Gaeke08f64c32004-03-06 05:32:28 +0000292 // Just emit a 'retl' instruction to return.
293 BuildMI(BB, V8::RETL, 0);
294 return;
Chris Lattner1c809c52004-02-29 00:27:00 +0000295}
296
Chris Lattner4be7ca52004-04-07 04:27:16 +0000297void V8ISel::visitBinaryOperator (Instruction &I) {
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000298 unsigned DestReg = getReg (I);
299 unsigned Op0Reg = getReg (I.getOperand (0));
300 unsigned Op1Reg = getReg (I.getOperand (1));
301
Chris Lattner0d538bb2004-04-07 04:36:53 +0000302 unsigned ResultReg = DestReg;
303 if (getClassB(I.getType()) != cInt)
304 ResultReg = makeAnotherReg (I.getType ());
Chris Lattner22ede702004-04-07 04:06:46 +0000305 unsigned OpCase = ~0;
306
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000307 // FIXME: support long, ulong, fp.
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000308 switch (I.getOpcode ()) {
Chris Lattner22ede702004-04-07 04:06:46 +0000309 case Instruction::Add: OpCase = 0; break;
310 case Instruction::Sub: OpCase = 1; break;
311 case Instruction::Mul: OpCase = 2; break;
312 case Instruction::And: OpCase = 3; break;
313 case Instruction::Or: OpCase = 4; break;
314 case Instruction::Xor: OpCase = 5; break;
Chris Lattner4be7ca52004-04-07 04:27:16 +0000315 case Instruction::Shl: OpCase = 6; break;
316 case Instruction::Shr: OpCase = 7+I.getType()->isSigned(); break;
Chris Lattner22ede702004-04-07 04:06:46 +0000317
318 case Instruction::Div:
319 case Instruction::Rem: {
320 unsigned Dest = ResultReg;
321 if (I.getOpcode() == Instruction::Rem)
322 Dest = makeAnotherReg(I.getType());
323
324 // FIXME: this is probably only right for 32 bit operands.
325 if (I.getType ()->isSigned()) {
326 unsigned Tmp = makeAnotherReg (I.getType ());
327 // Sign extend into the Y register
328 BuildMI (BB, V8::SRAri, 2, Tmp).addReg (Op0Reg).addZImm (31);
329 BuildMI (BB, V8::WRrr, 2, V8::Y).addReg (Tmp).addReg (V8::G0);
330 BuildMI (BB, V8::SDIVrr, 2, Dest).addReg (Op0Reg).addReg (Op1Reg);
331 } else {
332 // Zero extend into the Y register, ie, just set it to zero
333 BuildMI (BB, V8::WRrr, 2, V8::Y).addReg (V8::G0).addReg (V8::G0);
334 BuildMI (BB, V8::UDIVrr, 2, Dest).addReg (Op0Reg).addReg (Op1Reg);
Brian Gaeke2d4fa8f2004-04-07 04:00:49 +0000335 }
Chris Lattner22ede702004-04-07 04:06:46 +0000336
337 if (I.getOpcode() == Instruction::Rem) {
338 unsigned Tmp = makeAnotherReg (I.getType ());
339 BuildMI (BB, V8::SMULrr, 2, Tmp).addReg(Dest).addReg(Op1Reg);
340 BuildMI (BB, V8::SUBrr, 2, ResultReg).addReg(Op0Reg).addReg(Tmp);
Brian Gaekef57e3642004-03-16 22:37:11 +0000341 }
Chris Lattner22ede702004-04-07 04:06:46 +0000342 break;
343 }
344 default:
345 visitInstruction (I);
346 return;
347 }
348
349 if (OpCase != ~0U) {
350 static const unsigned Opcodes[] = {
Chris Lattner4be7ca52004-04-07 04:27:16 +0000351 V8::ADDrr, V8::SUBrr, V8::SMULrr, V8::ANDrr, V8::ORrr, V8::XORrr,
352 V8::SLLrr, V8::SRLrr, V8::SRArr
Chris Lattner22ede702004-04-07 04:06:46 +0000353 };
354 BuildMI (BB, Opcodes[OpCase], 2, ResultReg).addReg (Op0Reg).addReg (Op1Reg);
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000355 }
356
357 switch (getClass (I.getType ())) {
358 case cByte:
Brian Gaeke08f64c32004-03-06 05:32:28 +0000359 if (I.getType ()->isSigned ()) { // add byte
360 BuildMI (BB, V8::ANDri, 2, DestReg).addReg (ResultReg).addZImm (0xff);
361 } else { // add ubyte
362 unsigned TmpReg = makeAnotherReg (I.getType ());
363 BuildMI (BB, V8::SLLri, 2, TmpReg).addReg (ResultReg).addZImm (24);
364 BuildMI (BB, V8::SRAri, 2, DestReg).addReg (TmpReg).addZImm (24);
365 }
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000366 break;
367 case cShort:
Brian Gaeke08f64c32004-03-06 05:32:28 +0000368 if (I.getType ()->isSigned ()) { // add short
369 unsigned TmpReg = makeAnotherReg (I.getType ());
370 BuildMI (BB, V8::SLLri, 2, TmpReg).addReg (ResultReg).addZImm (16);
371 BuildMI (BB, V8::SRAri, 2, DestReg).addReg (TmpReg).addZImm (16);
372 } else { // add ushort
373 unsigned TmpReg = makeAnotherReg (I.getType ());
Brian Gaeke6d339f92004-03-16 22:45:42 +0000374 BuildMI (BB, V8::SLLri, 2, TmpReg).addReg (ResultReg).addZImm (16);
375 BuildMI (BB, V8::SRLri, 2, DestReg).addReg (TmpReg).addZImm (16);
Brian Gaeke08f64c32004-03-06 05:32:28 +0000376 }
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000377 break;
378 case cInt:
Chris Lattner0d538bb2004-04-07 04:36:53 +0000379 // Nothing todo here.
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000380 break;
381 default:
Brian Gaeke08f64c32004-03-06 05:32:28 +0000382 visitInstruction (I);
Brian Gaekebc1d27a2004-03-03 23:03:14 +0000383 return;
384 }
385}
386
Chris Lattner4d0cda42004-04-07 05:04:51 +0000387void V8ISel::visitSetCondInst(Instruction &I) {
388 unsigned Op0Reg = getReg (I.getOperand (0));
389 unsigned Op1Reg = getReg (I.getOperand (1));
390 unsigned DestReg = getReg (I);
391
392 // Compare the two values.
393 BuildMI(BB, V8::SUBCCrr, 2, V8::G0).addReg(Op0Reg).addReg(Op1Reg);
394
395 // Put 0 into a register.
396 //unsigned ZeroReg = makeAnotheRReg(Type::IntTy);
397 //BuildMI(BB, V8::ORri, 2, ZeroReg).addReg(V8::G0).addReg(V8::G0);
398
399 unsigned Opcode;
400 switch (I.getOpcode()) {
401 default: assert(0 && "Unknown setcc instruction!");
402 case Instruction::SetEQ:
403 case Instruction::SetNE:
404 case Instruction::SetLT:
405 case Instruction::SetGT:
406 case Instruction::SetLE:
407 case Instruction::SetGE:
408 }
409
410 // FIXME: We need either conditional moves like the V9 has (e.g. movge), or we
411 // need to be able to turn a single LLVM basic block into multiple machine
412 // code basic blocks. For now, it probably makes sense to emit Sparc V9
413 // instructions until the code generator is upgraded. Note that this should
414 // only happen when the setcc cannot be folded into the branch, but this needs
415 // to be handled correctly!
416
417 visitInstruction(I);
418}
419
420
Chris Lattner1c809c52004-02-29 00:27:00 +0000421
422/// LowerUnknownIntrinsicFunctionCalls - This performs a prepass over the
423/// function, lowering any calls to unknown intrinsic functions into the
424/// equivalent LLVM code.
425void V8ISel::LowerUnknownIntrinsicFunctionCalls(Function &F) {
426 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
427 for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; )
428 if (CallInst *CI = dyn_cast<CallInst>(I++))
429 if (Function *F = CI->getCalledFunction())
430 switch (F->getIntrinsicID()) {
431 case Intrinsic::not_intrinsic: break;
432 default:
433 // All other intrinsic calls we must lower.
434 Instruction *Before = CI->getPrev();
435 TM.getIntrinsicLowering().LowerIntrinsicCall(CI);
436 if (Before) { // Move iterator to instruction after call
437 I = Before; ++I;
438 } else {
439 I = BB->begin();
440 }
441 }
442}
443
444
445void V8ISel::visitIntrinsicCall(Intrinsic::ID ID, CallInst &CI) {
446 unsigned TmpReg1, TmpReg2;
447 switch (ID) {
448 default: assert(0 && "Intrinsic not supported!");
449 }
450}