OLD | NEW |
1 //===-- IntrinsicLowering.cpp - Intrinsic Lowering default implementation -===// | 1 //===-- IntrinsicLowering.cpp - Intrinsic Lowering default implementation -===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 // | 9 // |
10 // This file implements the IntrinsicLowering class. | 10 // This file implements the IntrinsicLowering class. |
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 } | 446 } |
447 | 447 |
448 case Intrinsic::dbg_declare: | 448 case Intrinsic::dbg_declare: |
449 break; // Simply strip out debugging intrinsics | 449 break; // Simply strip out debugging intrinsics |
450 | 450 |
451 case Intrinsic::eh_typeid_for: | 451 case Intrinsic::eh_typeid_for: |
452 // Return something different to eh_selector. | 452 // Return something different to eh_selector. |
453 CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1)); | 453 CI->replaceAllUsesWith(ConstantInt::get(CI->getType(), 1)); |
454 break; | 454 break; |
455 | 455 |
456 case Intrinsic::annotation: | |
457 case Intrinsic::ptr_annotation: | |
458 // Just drop the annotation, but forward the value | |
459 CI->replaceAllUsesWith(CI->getOperand(0)); | |
460 break; | |
461 | |
462 case Intrinsic::var_annotation: | 456 case Intrinsic::var_annotation: |
463 break; // Strip out annotate intrinsic | 457 break; // Strip out annotate intrinsic |
464 | 458 |
465 case Intrinsic::memcpy: { | 459 case Intrinsic::memcpy: { |
466 Type *IntPtr = TD.getIntPtrType(Context); | 460 Type *IntPtr = TD.getIntPtrType(Context); |
467 Value *Size = Builder.CreateIntCast(CI->getArgOperand(2), IntPtr, | 461 Value *Size = Builder.CreateIntCast(CI->getArgOperand(2), IntPtr, |
468 /* isSigned */ false); | 462 /* isSigned */ false); |
469 Value *Ops[3]; | 463 Value *Ops[3]; |
470 Ops[0] = CI->getArgOperand(0); | 464 Ops[0] = CI->getArgOperand(0); |
471 Ops[1] = CI->getArgOperand(1); | 465 Ops[1] = CI->getArgOperand(1); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 Module *M = CI->getParent()->getParent()->getParent(); | 556 Module *M = CI->getParent()->getParent()->getParent(); |
563 Constant *Int = Intrinsic::getDeclaration(M, Intrinsic::bswap, Ty); | 557 Constant *Int = Intrinsic::getDeclaration(M, Intrinsic::bswap, Ty); |
564 | 558 |
565 Value *Op = CI->getArgOperand(0); | 559 Value *Op = CI->getArgOperand(0); |
566 Op = CallInst::Create(Int, Op, CI->getName(), CI); | 560 Op = CallInst::Create(Int, Op, CI->getName(), CI); |
567 | 561 |
568 CI->replaceAllUsesWith(Op); | 562 CI->replaceAllUsesWith(Op); |
569 CI->eraseFromParent(); | 563 CI->eraseFromParent(); |
570 return true; | 564 return true; |
571 } | 565 } |
OLD | NEW |