1 //===-- InstSelectSimple.cpp - A simple instruction selector for SparcV8 --===//
3 // The LLVM Compiler Infrastructure
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.
8 //===----------------------------------------------------------------------===//
10 // This file defines a simple peephole instruction selector for the V8 target
12 //===----------------------------------------------------------------------===//
15 #include "SparcV8InstrInfo.h"
16 #include "llvm/Instructions.h"
17 #include "llvm/IntrinsicLowering.h"
18 #include "llvm/Pass.h"
19 #include "llvm/Constants.h"
20 #include "llvm/CodeGen/MachineInstrBuilder.h"
21 #include "llvm/CodeGen/MachineFunction.h"
22 #include "llvm/CodeGen/SSARegMap.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include "llvm/Support/GetElementPtrTypeIterator.h"
25 #include "llvm/Support/InstVisitor.h"
26 #include "llvm/Support/CFG.h"
30 struct V8ISel : public FunctionPass, public InstVisitor<V8ISel> {
32 MachineFunction *F; // The function we are compiling into
33 MachineBasicBlock *BB; // The current MBB we are compiling
35 std::map<Value*, unsigned> RegMap; // Mapping between Val's and SSA Regs
37 // MBBMap - Mapping between LLVM BB -> Machine BB
38 std::map<const BasicBlock*, MachineBasicBlock*> MBBMap;
40 V8ISel(TargetMachine &tm) : TM(tm), F(0), BB(0) {}
42 /// runOnFunction - Top level implementation of instruction selection for
43 /// the entire function.
45 bool runOnFunction(Function &Fn);
47 virtual const char *getPassName() const {
48 return "SparcV8 Simple Instruction Selection";
51 /// emitGEPOperation - Common code shared between visitGetElementPtrInst and
52 /// constant expression GEP support.
54 void emitGEPOperation(MachineBasicBlock *BB, MachineBasicBlock::iterator IP,
55 Value *Src, User::op_iterator IdxBegin,
56 User::op_iterator IdxEnd, unsigned TargetReg);
58 /// visitBasicBlock - This method is called when we are visiting a new basic
59 /// block. This simply creates a new MachineBasicBlock to emit code into
60 /// and adds it to the current MachineFunction. Subsequent visit* for
61 /// instructions will be invoked for all instructions in the basic block.
63 void visitBasicBlock(BasicBlock &LLVM_BB) {
64 BB = MBBMap[&LLVM_BB];
67 void visitBinaryOperator(Instruction &I);
68 void visitShiftInstruction(Instruction &I) { visitBinaryOperator(I); }
69 void visitSetCondInst(Instruction &I);
70 void visitCallInst(CallInst &I);
71 void visitReturnInst(ReturnInst &I);
72 void visitBranchInst(BranchInst &I);
73 void visitCastInst(CastInst &I);
74 void visitLoadInst(LoadInst &I);
75 void visitStoreInst(StoreInst &I);
76 void visitPHINode(PHINode &I) {} // PHI nodes handled by second pass
77 void visitGetElementPtrInst(GetElementPtrInst &I);
81 void visitInstruction(Instruction &I) {
82 std::cerr << "Unhandled instruction: " << I;
86 /// LowerUnknownIntrinsicFunctionCalls - This performs a prepass over the
87 /// function, lowering any calls to unknown intrinsic functions into the
88 /// equivalent LLVM code.
89 void LowerUnknownIntrinsicFunctionCalls(Function &F);
90 void visitIntrinsicCall(Intrinsic::ID ID, CallInst &CI);
92 void LoadArgumentsToVirtualRegs(Function *F);
94 /// copyConstantToRegister - Output the instructions required to put the
95 /// specified constant into the specified register.
97 void copyConstantToRegister(MachineBasicBlock *MBB,
98 MachineBasicBlock::iterator IP,
99 Constant *C, unsigned R);
101 /// makeAnotherReg - This method returns the next register number we haven't
104 /// Long values are handled somewhat specially. They are always allocated
105 /// as pairs of 32 bit integer values. The register number returned is the
106 /// lower 32 bits of the long value, and the regNum+1 is the upper 32 bits
107 /// of the long value.
109 unsigned makeAnotherReg(const Type *Ty) {
110 assert(dynamic_cast<const SparcV8RegisterInfo*>(TM.getRegisterInfo()) &&
111 "Current target doesn't have SparcV8 reg info??");
112 const SparcV8RegisterInfo *MRI =
113 static_cast<const SparcV8RegisterInfo*>(TM.getRegisterInfo());
114 if (Ty == Type::LongTy || Ty == Type::ULongTy) {
115 const TargetRegisterClass *RC = MRI->getRegClassForType(Type::IntTy);
116 // Create the lower part
117 F->getSSARegMap()->createVirtualRegister(RC);
118 // Create the upper part.
119 return F->getSSARegMap()->createVirtualRegister(RC)-1;
122 // Add the mapping of regnumber => reg class to MachineFunction
123 const TargetRegisterClass *RC = MRI->getRegClassForType(Ty);
124 return F->getSSARegMap()->createVirtualRegister(RC);
127 unsigned getReg(Value &V) { return getReg (&V); } // allow refs.
128 unsigned getReg(Value *V) {
129 // Just append to the end of the current bb.
130 MachineBasicBlock::iterator It = BB->end();
131 return getReg(V, BB, It);
133 unsigned getReg(Value *V, MachineBasicBlock *MBB,
134 MachineBasicBlock::iterator IPt) {
135 unsigned &Reg = RegMap[V];
137 Reg = makeAnotherReg(V->getType());
140 // If this operand is a constant, emit the code to copy the constant into
141 // the register here...
143 if (Constant *C = dyn_cast<Constant>(V)) {
144 copyConstantToRegister(MBB, IPt, C, Reg);
145 RegMap.erase(V); // Assign a new name to this constant if ref'd again
146 } else if (GlobalValue *GV = dyn_cast<GlobalValue>(V)) {
147 // Move the address of the global into the register
148 unsigned TmpReg = makeAnotherReg(V->getType());
149 BuildMI (*MBB, IPt, V8::SETHIi, 1, TmpReg).addGlobalAddress (GV);
150 BuildMI (*MBB, IPt, V8::ORri, 2, Reg).addReg (TmpReg)
151 .addGlobalAddress (GV);
152 RegMap.erase(V); // Assign a new name to this address if ref'd again
161 FunctionPass *llvm::createSparcV8SimpleInstructionSelector(TargetMachine &TM) {
162 return new V8ISel(TM);
166 cByte, cShort, cInt, cLong, cFloat, cDouble
169 static TypeClass getClass (const Type *T) {
170 switch (T->getPrimitiveID ()) {
171 case Type::UByteTyID: case Type::SByteTyID: return cByte;
172 case Type::UShortTyID: case Type::ShortTyID: return cShort;
173 case Type::PointerTyID:
174 case Type::UIntTyID: case Type::IntTyID: return cInt;
175 case Type::ULongTyID: case Type::LongTyID: return cLong;
176 case Type::FloatTyID: return cFloat;
177 case Type::DoubleTyID: return cDouble;
179 assert (0 && "Type of unknown class passed to getClass?");
183 static TypeClass getClassB(const Type *T) {
184 if (T == Type::BoolTy) return cByte;
190 /// copyConstantToRegister - Output the instructions required to put the
191 /// specified constant into the specified register.
193 void V8ISel::copyConstantToRegister(MachineBasicBlock *MBB,
194 MachineBasicBlock::iterator IP,
195 Constant *C, unsigned R) {
196 if (C->getType()->isIntegral ()) {
198 if (C->getType() == Type::BoolTy) {
199 Val = (C == ConstantBool::True);
201 ConstantInt *CI = dyn_cast<ConstantInt> (C);
202 Val = CI->getRawValue ();
204 switch (getClassB (C->getType ())) {
206 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (V8::G0).addImm((uint8_t)Val);
209 unsigned TmpReg = makeAnotherReg (C->getType ());
210 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg)
211 .addImm (((uint16_t) Val) >> 10);
212 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
213 .addImm (((uint16_t) Val) & 0x03ff);
217 unsigned TmpReg = makeAnotherReg (C->getType ());
218 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addImm(((uint32_t)Val) >> 10);
219 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
220 .addImm (((uint32_t) Val) & 0x03ff);
224 unsigned TmpReg = makeAnotherReg (Type::UIntTy);
225 uint32_t topHalf = (uint32_t) (Val >> 32);
226 uint32_t bottomHalf = (uint32_t)Val;
227 #if 0 // FIXME: This does not appear to be correct; it assigns SSA reg R twice.
228 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addImm (topHalf >> 10);
229 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
230 .addImm (topHalf & 0x03ff);
231 BuildMI (*MBB, IP, V8::SETHIi, 1, TmpReg).addImm (bottomHalf >> 10);
232 BuildMI (*MBB, IP, V8::ORri, 2, R).addReg (TmpReg)
233 .addImm (bottomHalf & 0x03ff);
235 std::cerr << "Offending constant: " << *C << "\n";
236 assert (0 && "Can't copy this kind of constant into register yet");
241 std::cerr << "Offending constant: " << *C << "\n";
242 assert (0 && "Can't copy this kind of constant into register yet");
247 std::cerr << "Offending constant: " << *C << "\n";
248 assert (0 && "Can't copy this kind of constant into register yet");
251 void V8ISel::LoadArgumentsToVirtualRegs (Function *F) {
252 unsigned ArgOffset = 0;
253 static const unsigned IncomingArgRegs[] = { V8::I0, V8::I1, V8::I2,
254 V8::I3, V8::I4, V8::I5 };
255 assert (F->asize () < 7
256 && "Can't handle loading excess call args off the stack yet");
258 for (Function::aiterator I = F->abegin(), E = F->aend(); I != E; ++I) {
259 unsigned Reg = getReg(*I);
260 switch (getClassB(I->getType())) {
264 BuildMI(BB, V8::ORrr, 2, Reg).addReg (V8::G0)
265 .addReg (IncomingArgRegs[ArgOffset]);
268 assert (0 && "Only <=32-bit, integral arguments currently handled");
275 bool V8ISel::runOnFunction(Function &Fn) {
276 // First pass over the function, lower any unknown intrinsic functions
277 // with the IntrinsicLowering class.
278 LowerUnknownIntrinsicFunctionCalls(Fn);
280 F = &MachineFunction::construct(&Fn, TM);
282 // Create all of the machine basic blocks for the function...
283 for (Function::iterator I = Fn.begin(), E = Fn.end(); I != E; ++I)
284 F->getBasicBlockList().push_back(MBBMap[I] = new MachineBasicBlock(I));
288 // Set up a frame object for the return address. This is used by the
289 // llvm.returnaddress & llvm.frameaddress intrinisics.
290 //ReturnAddressIndex = F->getFrameInfo()->CreateFixedObject(4, -4);
292 // Copy incoming arguments off of the stack and out of fixed registers.
293 LoadArgumentsToVirtualRegs(&Fn);
295 // Instruction select everything except PHI nodes
298 // Select the PHI nodes
304 // We always build a machine code representation for the function
308 void V8ISel::visitCastInst(CastInst &I) {
309 unsigned SrcReg = getReg (I.getOperand (0));
310 unsigned DestReg = getReg (I);
311 const Type *oldTy = I.getOperand (0)->getType ();
312 const Type *newTy = I.getType ();
313 unsigned oldTyClass = getClassB (oldTy);
314 unsigned newTyClass = getClassB (newTy);
316 if (oldTyClass < cLong && newTyClass < cLong && oldTyClass >= newTyClass) {
317 // Emit a reg->reg copy to do a equal-size or non-narrowing cast,
318 // and do sign/zero extension (necessary if we change signedness).
319 unsigned TempReg1 = makeAnotherReg (newTy);
320 unsigned TempReg2 = makeAnotherReg (newTy);
321 BuildMI (BB, V8::ORrr, 2, TempReg1).addReg (V8::G0).addReg (SrcReg);
322 unsigned shiftWidth = 32 - (8 * TM.getTargetData ().getTypeSize (newTy));
323 BuildMI (BB, V8::SLLri, 2, TempReg2).addZImm (shiftWidth).addReg (TempReg1);
324 if (newTy->isSigned ()) { // sign-extend with SRA
325 BuildMI(BB, V8::SRAri, 2, DestReg).addZImm (shiftWidth).addReg (TempReg2);
326 } else { // zero-extend with SRL
327 BuildMI(BB, V8::SRLri, 2, DestReg).addZImm (shiftWidth).addReg (TempReg2);
330 std::cerr << "Casts w/ long, fp, double, or widening still unsupported: "
336 void V8ISel::visitLoadInst(LoadInst &I) {
337 unsigned DestReg = getReg (I);
338 unsigned PtrReg = getReg (I.getOperand (0));
339 switch (getClassB (I.getType ())) {
341 if (I.getType ()->isSigned ())
342 BuildMI (BB, V8::LDSBmr, 1, DestReg).addReg (PtrReg).addSImm(0);
344 BuildMI (BB, V8::LDUBmr, 1, DestReg).addReg (PtrReg).addSImm(0);
347 if (I.getType ()->isSigned ())
348 BuildMI (BB, V8::LDSHmr, 1, DestReg).addReg (PtrReg).addSImm(0);
350 BuildMI (BB, V8::LDUHmr, 1, DestReg).addReg (PtrReg).addSImm(0);
353 BuildMI (BB, V8::LDmr, 1, DestReg).addReg (PtrReg).addSImm(0);
356 BuildMI (BB, V8::LDDmr, 1, DestReg).addReg (PtrReg).addSImm(0);
359 std::cerr << "Load instruction not handled: " << I;
365 void V8ISel::visitStoreInst(StoreInst &I) {
366 Value *SrcVal = I.getOperand (0);
367 unsigned SrcReg = getReg (SrcVal);
368 unsigned PtrReg = getReg (I.getOperand (1));
369 switch (getClassB (SrcVal->getType ())) {
371 BuildMI (BB, V8::STBrm, 1, SrcReg).addReg (PtrReg).addSImm(0);
374 BuildMI (BB, V8::STHrm, 1, SrcReg).addReg (PtrReg).addSImm(0);
377 BuildMI (BB, V8::STrm, 1, SrcReg).addReg (PtrReg).addSImm(0);
380 BuildMI (BB, V8::STDrm, 1, SrcReg).addReg (PtrReg).addSImm(0);
383 std::cerr << "Store instruction not handled: " << I;
389 void V8ISel::visitCallInst(CallInst &I) {
390 assert (I.getNumOperands () < 8
391 && "Can't handle pushing excess call args on the stack yet");
392 static const unsigned OutgoingArgRegs[] = { V8::O0, V8::O1, V8::O2, V8::O3,
394 for (unsigned i = 1; i < 7; ++i)
395 if (i < I.getNumOperands ()) {
396 unsigned ArgReg = getReg (I.getOperand (i));
397 // Schlep it over into the incoming arg register
398 BuildMI (BB, V8::ORrr, 2, OutgoingArgRegs[i - 1]).addReg (V8::G0)
402 unsigned DestReg = getReg (I);
403 BuildMI (BB, V8::CALL, 1).addPCDisp (I.getOperand (0));
404 if (I.getType ()->getPrimitiveID () == Type::VoidTyID)
406 // Deal w/ return value
407 switch (getClass (I.getType ())) {
411 // Schlep it over into the destination register
412 BuildMI (BB, V8::ORrr, 2, DestReg).addReg(V8::G0).addReg(V8::O0);
415 std::cerr << "Return type of call instruction not handled: " << I;
420 void V8ISel::visitReturnInst(ReturnInst &I) {
421 if (I.getNumOperands () == 1) {
422 unsigned RetValReg = getReg (I.getOperand (0));
423 switch (getClass (I.getOperand (0)->getType ())) {
427 // Schlep it over into i0 (where it will become o0 after restore).
428 BuildMI (BB, V8::ORrr, 2, V8::I0).addReg(V8::G0).addReg(RetValReg);
431 std::cerr << "Return instruction of this type not handled: " << I;
436 // Just emit a 'retl' instruction to return.
437 BuildMI(BB, V8::RETL, 0);
441 static inline BasicBlock *getBlockAfter(BasicBlock *BB) {
442 Function::iterator I = BB; ++I; // Get iterator to next block
443 return I != BB->getParent()->end() ? &*I : 0;
446 /// visitBranchInst - Handles conditional and unconditional branches.
448 void V8ISel::visitBranchInst(BranchInst &I) {
449 // Update machine-CFG edges
450 BB->addSuccessor (MBBMap[I.getSuccessor(0)]);
451 if (I.isConditional())
452 BB->addSuccessor (MBBMap[I.getSuccessor(1)]);
454 BasicBlock *NextBB = getBlockAfter(I.getParent()); // BB after current one
456 BasicBlock *takenSucc = I.getSuccessor (0);
457 if (!I.isConditional()) { // Unconditional branch?
458 if (I.getSuccessor(0) != NextBB)
459 BuildMI (BB, V8::BA, 1).addPCDisp (takenSucc);
463 unsigned CondReg = getReg (I.getCondition ());
464 BasicBlock *notTakenSucc = I.getSuccessor (1);
465 // Set Z condition code if CondReg was false
466 BuildMI (BB, V8::CMPri, 2).addSImm (0).addReg (CondReg);
467 if (notTakenSucc == NextBB) {
468 if (takenSucc != NextBB)
469 BuildMI (BB, V8::BNE, 1).addPCDisp (takenSucc);
471 BuildMI (BB, V8::BE, 1).addPCDisp (notTakenSucc);
472 if (takenSucc != NextBB)
473 BuildMI (BB, V8::BA, 1).addPCDisp (takenSucc);
477 /// emitGEPOperation - Common code shared between visitGetElementPtrInst and
478 /// constant expression GEP support.
480 void V8ISel::emitGEPOperation (MachineBasicBlock *BB,
481 MachineBasicBlock::iterator IP,
482 Value *Src, User::op_iterator IdxBegin,
483 User::op_iterator IdxEnd, unsigned TargetReg) {
484 std::cerr << "Sorry, GEPs not yet supported\n";
488 void V8ISel::visitGetElementPtrInst (GetElementPtrInst &I) {
489 unsigned outputReg = getReg (I);
490 emitGEPOperation (BB, BB->end (), I.getOperand (0),
491 I.op_begin ()+1, I.op_end (), outputReg);
494 void V8ISel::visitBinaryOperator (Instruction &I) {
495 unsigned DestReg = getReg (I);
496 unsigned Op0Reg = getReg (I.getOperand (0));
497 unsigned Op1Reg = getReg (I.getOperand (1));
499 unsigned ResultReg = DestReg;
500 if (getClassB(I.getType()) != cInt)
501 ResultReg = makeAnotherReg (I.getType ());
502 unsigned OpCase = ~0;
504 // FIXME: support long, ulong, fp.
505 switch (I.getOpcode ()) {
506 case Instruction::Add: OpCase = 0; break;
507 case Instruction::Sub: OpCase = 1; break;
508 case Instruction::Mul: OpCase = 2; break;
509 case Instruction::And: OpCase = 3; break;
510 case Instruction::Or: OpCase = 4; break;
511 case Instruction::Xor: OpCase = 5; break;
512 case Instruction::Shl: OpCase = 6; break;
513 case Instruction::Shr: OpCase = 7+I.getType()->isSigned(); break;
515 case Instruction::Div:
516 case Instruction::Rem: {
517 unsigned Dest = ResultReg;
518 if (I.getOpcode() == Instruction::Rem)
519 Dest = makeAnotherReg(I.getType());
521 // FIXME: this is probably only right for 32 bit operands.
522 if (I.getType ()->isSigned()) {
523 unsigned Tmp = makeAnotherReg (I.getType ());
524 // Sign extend into the Y register
525 BuildMI (BB, V8::SRAri, 2, Tmp).addReg (Op0Reg).addZImm (31);
526 BuildMI (BB, V8::WRrr, 2, V8::Y).addReg (Tmp).addReg (V8::G0);
527 BuildMI (BB, V8::SDIVrr, 2, Dest).addReg (Op0Reg).addReg (Op1Reg);
529 // Zero extend into the Y register, ie, just set it to zero
530 BuildMI (BB, V8::WRrr, 2, V8::Y).addReg (V8::G0).addReg (V8::G0);
531 BuildMI (BB, V8::UDIVrr, 2, Dest).addReg (Op0Reg).addReg (Op1Reg);
534 if (I.getOpcode() == Instruction::Rem) {
535 unsigned Tmp = makeAnotherReg (I.getType ());
536 BuildMI (BB, V8::SMULrr, 2, Tmp).addReg(Dest).addReg(Op1Reg);
537 BuildMI (BB, V8::SUBrr, 2, ResultReg).addReg(Op0Reg).addReg(Tmp);
542 visitInstruction (I);
547 static const unsigned Opcodes[] = {
548 V8::ADDrr, V8::SUBrr, V8::SMULrr, V8::ANDrr, V8::ORrr, V8::XORrr,
549 V8::SLLrr, V8::SRLrr, V8::SRArr
551 BuildMI (BB, Opcodes[OpCase], 2, ResultReg).addReg (Op0Reg).addReg (Op1Reg);
554 switch (getClass (I.getType ())) {
556 if (I.getType ()->isSigned ()) { // add byte
557 BuildMI (BB, V8::ANDri, 2, DestReg).addReg (ResultReg).addZImm (0xff);
558 } else { // add ubyte
559 unsigned TmpReg = makeAnotherReg (I.getType ());
560 BuildMI (BB, V8::SLLri, 2, TmpReg).addReg (ResultReg).addZImm (24);
561 BuildMI (BB, V8::SRAri, 2, DestReg).addReg (TmpReg).addZImm (24);
565 if (I.getType ()->isSigned ()) { // add short
566 unsigned TmpReg = makeAnotherReg (I.getType ());
567 BuildMI (BB, V8::SLLri, 2, TmpReg).addReg (ResultReg).addZImm (16);
568 BuildMI (BB, V8::SRAri, 2, DestReg).addReg (TmpReg).addZImm (16);
569 } else { // add ushort
570 unsigned TmpReg = makeAnotherReg (I.getType ());
571 BuildMI (BB, V8::SLLri, 2, TmpReg).addReg (ResultReg).addZImm (16);
572 BuildMI (BB, V8::SRLri, 2, DestReg).addReg (TmpReg).addZImm (16);
576 // Nothing todo here.
579 visitInstruction (I);
584 void V8ISel::visitSetCondInst(Instruction &I) {
585 unsigned Op0Reg = getReg (I.getOperand (0));
586 unsigned Op1Reg = getReg (I.getOperand (1));
587 unsigned DestReg = getReg (I);
589 // Compare the two values.
590 BuildMI(BB, V8::SUBCCrr, 2, V8::G0).addReg(Op0Reg).addReg(Op1Reg);
592 // Put 0 into a register.
593 //unsigned ZeroReg = makeAnotheRReg(Type::IntTy);
594 //BuildMI(BB, V8::ORri, 2, ZeroReg).addReg(V8::G0).addReg(V8::G0);
597 switch (I.getOpcode()) {
598 default: assert(0 && "Unknown setcc instruction!");
599 case Instruction::SetEQ:
600 case Instruction::SetNE:
601 case Instruction::SetLT:
602 case Instruction::SetGT:
603 case Instruction::SetLE:
604 case Instruction::SetGE:
608 // FIXME: We need either conditional moves like the V9 has (e.g. movge), or we
609 // need to be able to turn a single LLVM basic block into multiple machine
610 // code basic blocks. For now, it probably makes sense to emit Sparc V9
611 // instructions until the code generator is upgraded. Note that this should
612 // only happen when the setcc cannot be folded into the branch, but this needs
613 // to be handled correctly!
620 /// LowerUnknownIntrinsicFunctionCalls - This performs a prepass over the
621 /// function, lowering any calls to unknown intrinsic functions into the
622 /// equivalent LLVM code.
623 void V8ISel::LowerUnknownIntrinsicFunctionCalls(Function &F) {
624 for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
625 for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; )
626 if (CallInst *CI = dyn_cast<CallInst>(I++))
627 if (Function *F = CI->getCalledFunction())
628 switch (F->getIntrinsicID()) {
629 case Intrinsic::not_intrinsic: break;
631 // All other intrinsic calls we must lower.
632 Instruction *Before = CI->getPrev();
633 TM.getIntrinsicLowering().LowerIntrinsicCall(CI);
634 if (Before) { // Move iterator to instruction after call
643 void V8ISel::visitIntrinsicCall(Intrinsic::ID ID, CallInst &CI) {
644 unsigned TmpReg1, TmpReg2;
646 default: assert(0 && "Intrinsic not supported!");