Home
last modified time | relevance | path

Searched refs:CastInst (Results 1 – 25 of 76) sorted by relevance

1234

/external/llvm/unittests/IR/
DInstructionsTest.cpp171 TEST(InstructionsTest, CastInst) { in TEST() argument
210 EXPECT_TRUE(CastInst::isCastable(V8x8Ty, X86MMXTy)); in TEST()
211 EXPECT_TRUE(CastInst::isCastable(X86MMXTy, V8x8Ty)); in TEST()
212 EXPECT_FALSE(CastInst::isCastable(Int64Ty, X86MMXTy)); in TEST()
213 EXPECT_TRUE(CastInst::isCastable(V8x64Ty, V8x8Ty)); in TEST()
214 EXPECT_TRUE(CastInst::isCastable(V8x8Ty, V8x64Ty)); in TEST()
215 EXPECT_EQ(CastInst::Trunc, CastInst::getCastOpcode(c64, true, V8x8Ty, true)); in TEST()
216 EXPECT_EQ(CastInst::SExt, CastInst::getCastOpcode(c8, true, V8x64Ty, true)); in TEST()
218 EXPECT_FALSE(CastInst::isBitCastable(V8x8Ty, X86MMXTy)); in TEST()
219 EXPECT_FALSE(CastInst::isBitCastable(X86MMXTy, V8x8Ty)); in TEST()
[all …]
DValueHandleTest.cpp105 AssertingVH<CastInst> AVH(BitcastV.get()); in TEST_F()
106 CastInst *implicit_to_exact_type = AVH; in TEST_F()
121 const CastInst *ConstBitcast = BitcastV.get(); in TEST_F()
122 AssertingVH<const CastInst> AVH(ConstBitcast); in TEST_F()
123 const CastInst *implicit_to_exact_type = AVH; in TEST_F()
169 EXPECT_EQ(sizeof(CastInst *), sizeof(AssertingVH<CastInst>)); in TEST_F()
/external/llvm/include/llvm/IR/
DInstVisitor.h185 RetTy visitTruncInst(TruncInst &I) { DELEGATE(CastInst);} in visitTruncInst()
186 RetTy visitZExtInst(ZExtInst &I) { DELEGATE(CastInst);} in visitZExtInst()
187 RetTy visitSExtInst(SExtInst &I) { DELEGATE(CastInst);} in visitSExtInst()
188 RetTy visitFPTruncInst(FPTruncInst &I) { DELEGATE(CastInst);} in visitFPTruncInst()
189 RetTy visitFPExtInst(FPExtInst &I) { DELEGATE(CastInst);} in visitFPExtInst()
190 RetTy visitFPToUIInst(FPToUIInst &I) { DELEGATE(CastInst);} in visitFPToUIInst()
191 RetTy visitFPToSIInst(FPToSIInst &I) { DELEGATE(CastInst);} in visitFPToSIInst()
192 RetTy visitUIToFPInst(UIToFPInst &I) { DELEGATE(CastInst);} in visitUIToFPInst()
193 RetTy visitSIToFPInst(SIToFPInst &I) { DELEGATE(CastInst);} in visitSIToFPInst()
194 RetTy visitPtrToIntInst(PtrToIntInst &I) { DELEGATE(CastInst);} in visitPtrToIntInst()
[all …]
DInstrTypes.h584 class CastInst : public UnaryInstruction {
589 CastInst(Type *Ty, unsigned iType, Value *S,
595 CastInst(Type *Ty, unsigned iType, Value *S,
608 static CastInst *Create(
621 static CastInst *Create(
630 static CastInst *CreateZExtOrBitCast(
638 static CastInst *CreateZExtOrBitCast(
646 static CastInst *CreateSExtOrBitCast(
654 static CastInst *CreateSExtOrBitCast(
662 static CastInst *CreatePointerCast(
[all …]
DNoFolder.h217 return CastInst::Create(Op, C, DestTy); in CreateCast()
220 return CastInst::CreatePointerCast(C, DestTy); in CreatePointerCast()
224 return CastInst::CreateIntegerCast(C, DestTy, isSigned); in CreateIntCast()
227 return CastInst::CreateFPCast(C, DestTy); in CreateFPCast()
240 return CastInst::CreateZExtOrBitCast(C, DestTy); in CreateZExtOrBitCast()
243 return CastInst::CreateSExtOrBitCast(C, DestTy); in CreateSExtOrBitCast()
247 return CastInst::CreateTruncOrBitCast(C, DestTy); in CreateTruncOrBitCast()
/external/llvm/lib/Transforms/Scalar/
DConstantHoisting.cpp220 if (auto CastInst = dyn_cast<Instruction>(Opnd)) in findMatInsertPt() local
221 if (CastInst->isCast()) in findMatInsertPt()
222 return CastInst; in findMatInsertPt()
334 if (auto CastInst = dyn_cast<Instruction>(Opnd)) { in collectConstantCandidates() local
337 if (!CastInst->isCast()) in collectConstantCandidates()
340 if (auto *ConstInt = dyn_cast<ConstantInt>(CastInst->getOperand(0))) { in collectConstantCandidates()
495 if (auto CastInst = dyn_cast<Instruction>(Opnd)) { in emitBaseConstants() local
496 assert(CastInst->isCast() && "Expected an cast instruction!"); in emitBaseConstants()
499 Instruction *&ClonedCastInst = ClonedCastMap[CastInst]; in emitBaseConstants()
501 ClonedCastInst = CastInst->clone(); in emitBaseConstants()
[all …]
DReg2Mem.cpp85 CastInst *AllocaInsertionPoint = new BitCastInst( in INITIALIZE_PASS_DEPENDENCY()
DSeparateConstOffsetFromGEP.cpp308 SmallVector<CastInst *, 16> ExtInsts;
612 if (CastInst *Cast = dyn_cast<CastInst>(U)) { in distributeExtsAndCloneChain()
727 *I = CastInst::CreateIntegerCast(*I, IntPtrTy, true, "idxprom", GEP); in canonicalizeArrayIndicesToPointerSize()
DEarlyCSE.cpp69 return isa<CastInst>(Inst) || isa<BinaryOperator>(Inst) || in canHandle()
123 if (CastInst *CI = dyn_cast<CastInst>(Inst)) in getHashValue()
DRewriteStatepointsForGC.cpp455 if (CastInst *CI = dyn_cast<CastInst>(I)) { in findBaseDefiningValue()
465 assert(!isa<CastInst>(Def) && "shouldn't find another cast here"); in findBaseDefiningValue()
2106 if (CastInst *CI = dyn_cast<CastInst>(CurrentValue)) { in findRematerializableChainToBasePointer()
2111 assert(!isa<CastInst>(Def) && "not a pointer cast found"); in findRematerializableChainToBasePointer()
2131 if (CastInst *CI = dyn_cast<CastInst>(Instr)) { in chainToBasePointerCost()
2219 assert(isa<GetElementPtrInst>(Instr) || isa<CastInst>(Instr)); in rematerializeLiveValues()
/external/llvm/lib/IR/
DInstructions.cpp400 ArraySize = CastInst::CreateIntegerCast(ArraySize, IntPtrTy, false, in createMalloc()
403 ArraySize = CastInst::CreateIntegerCast(ArraySize, IntPtrTy, false, in createMalloc()
2251 void CastInst::anchor() {} in anchor()
2254 bool CastInst::isIntegerCast() const { in isIntegerCast()
2267 bool CastInst::isLosslessCast() const { in isLosslessCast()
2292 bool CastInst::isNoopCast(Instruction::CastOps Opcode, in isNoopCast()
2322 bool CastInst::isNoopCast(Type *IntPtrTy) const { in isNoopCast()
2326 bool CastInst::isNoopCast(const DataLayout &DL) const { in isNoopCast()
2347 unsigned CastInst::isEliminableCastPair( in isEliminableCastPair()
2571 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty, in Create()
[all …]
DConstantFold.cpp84 assert(CastInst::isCast(opc) && "Invalid cast opcode"); in foldConstantCastPair()
98 return CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy, DstTy, in foldConstantCastPair()
397 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedSizeOf()
414 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedAlignOf()
463 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedAlignOf()
478 Constant *N = ConstantExpr::getCast(CastInst::getCastOpcode(FieldNo, false, in getFoldedOffsetOf()
502 Constant *N = ConstantExpr::getCast(CastInst::getCastOpcode(FieldNo, in getFoldedOffsetOf()
518 C = ConstantExpr::getCast(CastInst::getCastOpcode(C, false, in getFoldedOffsetOf()
642 Idx = ConstantExpr::getCast(CastInst::getCastOpcode(Idx, true, in ConstantFoldCastInstruction()
/external/llvm/lib/Analysis/
DPHITransAddr.cpp30 if (isa<CastInst>(Inst) && in CanPHITrans()
190 if (CastInst *Cast = dyn_cast<CastInst>(Inst)) { in PHITranslateSubExpr()
207 if (CastInst *CastI = dyn_cast<CastInst>(U)) in PHITranslateSubExpr()
383 if (CastInst *Cast = dyn_cast<CastInst>(Inst)) { in InsertPHITranslatedSubExpr()
390 CastInst *New = CastInst::Create(Cast->getOpcode(), OpVal, InVal->getType(), in InsertPHITranslatedSubExpr()
DLoads.cpp47 if (isa<BinaryOperator>(A) || isa<CastInst>(A) || isa<PHINode>(A) || in AreEquivalentAddressValues()
233 CastInst::isBitOrNoopPointerCastable(LI->getType(), AccessTy, DL)) { in FindAvailableLoadedValue()
245 CastInst::isBitOrNoopPointerCastable(SI->getValueOperand()->getType(), in FindAvailableLoadedValue()
DScalarEvolutionExpander.cpp57 if (CastInst *CI = dyn_cast<CastInst>(U)) in ReuseOrCreateCast()
66 Ret = CastInst::Create(Op, V, Ty, "", &*IP); in ReuseOrCreateCast()
78 Ret = CastInst::Create(Op, V, Ty, V->getName(), &*IP); in ReuseOrCreateCast()
115 Instruction::CastOps Op = CastInst::getCastOpcode(V, false, Ty, false); in InsertNoopCastOfTo()
127 if (CastInst *CI = dyn_cast<CastInst>(V)) { in InsertNoopCastOfTo()
135 if (CastInst *CI = dyn_cast<CastInst>(V)) in InsertNoopCastOfTo()
828 (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV))) in isNormalAddRecExprPHI()
DLint.cpp657 } else if (CastInst *CI = dyn_cast<CastInst>(V)) { in findValueImpl()
668 if (CastInst::isNoopCast(Instruction::CastOps(CE->getOpcode()), in findValueImpl()
/external/llvm/include/llvm/Transforms/Utils/
DSimplifyIndVar.h24 class CastInst; variable
55 virtual void visitCast(CastInst *Cast) = 0;
/external/llvm/lib/Transforms/InstCombine/
DInstCombineCasts.cpp201 Res = CastInst::CreateIntegerCast(I->getOperand(0), Ty, in EvaluateInDifferentType()
234 isEliminableCastPair(const CastInst *CI, ///< First cast instruction in isEliminableCastPair()
250 unsigned Res = CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy, in isEliminableCastPair()
274 if (const CastInst *CI = dyn_cast<CastInst>(V)) in ShouldOptimizeCast()
288 Instruction *InstCombiner::commonCastTransforms(CastInst &CI) { in commonCastTransforms()
293 if (CastInst *CSrc = dyn_cast<CastInst>(Src)) { // A->B->C cast in commonCastTransforms()
298 return CastInst::Create(opc, CSrc->getOperand(0), CI.getType()); in commonCastTransforms()
542 return CastInst::CreateIntegerCast(Shift, DestTy, false); in visitTrunc()
561 return CastInst::CreateIntegerCast(Shift, CI.getType(), true); in visitTrunc()
658 return CastInst::CreateIntegerCast(In, CI.getType(), false/*ZExt*/); in transformZExtICmp()
[all …]
DInstCombineInternal.h287 Instruction *commonCastTransforms(CastInst &CI);
288 Instruction *commonPointerCastTransforms(CastInst &CI);
293 Instruction *visitFPExt(CastInst &CI);
296 Instruction *visitUIToFP(CastInst &CI);
297 Instruction *visitSIToFP(CastInst &CI);
DInstCombineAndOrXor.cpp1243 return CastInst::CreateZExtOrBitCast(Not, I.getType()); in matchDeMorgansLaws()
1490 if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) { in visitAnd()
1494 if (CastInst *Op1C = dyn_cast<CastInst>(Op1)) { in visitAnd()
1504 return CastInst::Create(Op0C->getOpcode(), NewOp, I.getType()); in visitAnd()
1512 return CastInst::Create(Op0C->getOpcode(), Res, I.getType()); in visitAnd()
1519 return CastInst::Create(Op0C->getOpcode(), Res, I.getType()); in visitAnd()
1533 return CastInst::CreateBitOrPointerCast(Call, I.getType()); in visitAnd()
2546 if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) { in visitOr()
2547 CastInst *Op1C = dyn_cast<CastInst>(Op1); in visitOr()
2560 return CastInst::Create(Op0C->getOpcode(), NewOp, I.getType()); in visitOr()
[all …]
DInstCombinePHI.cpp471 return CastInst::CreateZExtOrBitCast(NewPhi, Phi.getType()); in FoldPHIArgZextsIntoPHI()
499 if (isa<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
575 if (CastInst *FirstCI = dyn_cast<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
576 CastInst *NewCI = CastInst::Create(FirstCI->getOpcode(), PhiVal, in FoldPHIArgOpIntoPHI()
DInstCombineVectorOps.cpp231 } else if (CastInst *CI = dyn_cast<CastInst>(I)) { in visitExtractElementInst()
239 return CastInst::Create(CI->getOpcode(), EE, EI.getType()); in visitExtractElementInst()
681 return CastInst::Create(cast<CastInst>(I)->getOpcode(), NewOps[0], DestTy, in buildNew()
DInstructionCombining.cpp701 if (CastInst *CI = dyn_cast<CastInst>(&I)) { in FoldOperationIntoSelectOperand()
906 CastInst *CI = cast<CastInst>(&I); in FoldOpIntoPhi()
1137 if (CastInst *Cast = dyn_cast<CastInst>(Op)) { in Descale()
1597 return CastInst::Create(Instruction::IntToPtr, NewSub, GEP.getType()); in visitGetElementPtrInst()
1604 return CastInst::CreatePointerBitCastOrAddrSpaceCast(Y, in visitGetElementPtrInst()
1704 return CastInst::CreatePointerBitCastOrAddrSpaceCast(NewGEP, in visitGetElementPtrInst()
1740 return CastInst::CreatePointerBitCastOrAddrSpaceCast(NewGEP, in visitGetElementPtrInst()
1781 return CastInst::CreatePointerBitCastOrAddrSpaceCast(NewGEP, in visitGetElementPtrInst()
DInstCombineCalls.cpp1548 return CastInst::Create(Instruction::BitCast, Result, CI.getType()); in visitCallInst()
1612 return CastInst::CreateIntegerCast(Arg0, II->getType(), in visitCallInst()
1808 const CastInst *const CI, in isSafeToEliminateVarargsCast()
2031 CastInst *CI = dyn_cast<CastInst>(*I); in visitCallSite()
2087 if (!CastInst::isBitOrNoopPointerCastable(NewRetTy, OldRetTy, DL)) { in transformConstExprCastCall()
2136 if (!CastInst::isBitOrNoopPointerCastable(ActTy, ParamTy, DL)) in transformConstExprCastCall()
2252 CastInst::getCastOpcode(*AI, false, PTy, false); in transformConstExprCastCall()
2301 NV = NC = CastInst::CreateBitOrPointerCast(NC, OldRetTy); in transformConstExprCastCall()
/external/llvm/include/llvm/Analysis/
DTargetTransformInfoImpl.h490 if (const CastInst *CI = dyn_cast<CastInst>(U)) { in getUserCost()

1234