Home
last modified time | relevance | path

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

123

/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.h182 RetTy visitTruncInst(TruncInst &I) { DELEGATE(CastInst);} in visitTruncInst()
183 RetTy visitZExtInst(ZExtInst &I) { DELEGATE(CastInst);} in visitZExtInst()
184 RetTy visitSExtInst(SExtInst &I) { DELEGATE(CastInst);} in visitSExtInst()
185 RetTy visitFPTruncInst(FPTruncInst &I) { DELEGATE(CastInst);} in visitFPTruncInst()
186 RetTy visitFPExtInst(FPExtInst &I) { DELEGATE(CastInst);} in visitFPExtInst()
187 RetTy visitFPToUIInst(FPToUIInst &I) { DELEGATE(CastInst);} in visitFPToUIInst()
188 RetTy visitFPToSIInst(FPToSIInst &I) { DELEGATE(CastInst);} in visitFPToSIInst()
189 RetTy visitUIToFPInst(UIToFPInst &I) { DELEGATE(CastInst);} in visitUIToFPInst()
190 RetTy visitSIToFPInst(SIToFPInst &I) { DELEGATE(CastInst);} in visitSIToFPInst()
191 RetTy visitPtrToIntInst(PtrToIntInst &I) { DELEGATE(CastInst);} in visitPtrToIntInst()
[all …]
DInstrTypes.h385 class CastInst : public UnaryInstruction {
389 CastInst(Type *Ty, unsigned iType, Value *S,
395 CastInst(Type *Ty, unsigned iType, Value *S,
407 static CastInst *Create(
420 static CastInst *Create(
429 static CastInst *CreateZExtOrBitCast(
437 static CastInst *CreateZExtOrBitCast(
445 static CastInst *CreateSExtOrBitCast(
453 static CastInst *CreateSExtOrBitCast(
461 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()
DInstructions.h3391 class TruncInst : public CastInst {
3427 class ZExtInst : public CastInst {
3463 class SExtInst : public CastInst {
3499 class FPTruncInst : public CastInst {
3535 class FPExtInst : public CastInst {
3571 class UIToFPInst : public CastInst {
3607 class SIToFPInst : public CastInst {
3643 class FPToUIInst : public CastInst {
3679 class FPToSIInst : public CastInst {
3715 class IntToPtrInst : public CastInst {
[all …]
DIRBuilder.h1253 return Insert(CastInst::CreateZExtOrBitCast(V, DestTy), Name);
1261 return Insert(CastInst::CreateSExtOrBitCast(V, DestTy), Name);
1269 return Insert(CastInst::CreateTruncOrBitCast(V, DestTy), Name);
1277 return Insert(CastInst::Create(Op, V, DestTy), Name);
1285 return Insert(CastInst::CreatePointerCast(V, DestTy), Name);
1298 return Insert(CastInst::CreatePointerBitCastOrAddrSpaceCast(V, DestTy),
1308 return Insert(CastInst::CreateIntegerCast(V, DestTy, isSigned), Name);
1333 return Insert(CastInst::CreateFPCast(V, DestTy), Name);
/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 …]
DSeparateConstOffsetFromGEP.cpp293 SmallVector<CastInst *, 16> ExtInsts;
552 if (CastInst *Cast = dyn_cast<CastInst>(U)) { in distributeExtsAndCloneChain()
683 *I = CastInst::CreateIntegerCast(*I, IntPtrTy, true, "idxprom", GEP); in canonicalizeArrayIndicesToPointerSize()
DReg2Mem.cpp85 CastInst *AllocaInsertionPoint = in INITIALIZE_PASS_DEPENDENCY()
DEarlyCSE.cpp68 return isa<CastInst>(Inst) || isa<BinaryOperator>(Inst) || in canHandle()
122 if (CastInst *CI = dyn_cast<CastInst>(Inst)) in getHashValue()
/external/llvm/lib/IR/
DInstructions.cpp400 ArraySize = CastInst::CreateIntegerCast(ArraySize, IntPtrTy, false, in createMalloc()
403 ArraySize = CastInst::CreateIntegerCast(ArraySize, IntPtrTy, false, in createMalloc()
1982 void CastInst::anchor() {} in anchor()
1985 bool CastInst::isIntegerCast() const { in isIntegerCast()
1998 bool CastInst::isLosslessCast() const { in isLosslessCast()
2023 bool CastInst::isNoopCast(Instruction::CastOps Opcode, in isNoopCast()
2053 bool CastInst::isNoopCast(Type *IntPtrTy) const { in isNoopCast()
2057 bool CastInst::isNoopCast(const DataLayout &DL) const { in isNoopCast()
2078 unsigned CastInst::isEliminableCastPair( in isEliminableCastPair()
2297 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()
189 if (CastInst *Cast = dyn_cast<CastInst>(Inst)) { in PHITranslateSubExpr()
206 if (CastInst *CastI = dyn_cast<CastInst>(U)) in PHITranslateSubExpr()
381 if (CastInst *Cast = dyn_cast<CastInst>(Inst)) { in InsertPHITranslatedSubExpr()
388 CastInst *New = CastInst::Create(Cast->getOpcode(), in InsertPHITranslatedSubExpr()
DLoads.cpp47 if (isa<BinaryOperator>(A) || isa<CastInst>(A) || isa<PHINode>(A) || in AreEquivalentAddressValues()
206 CastInst::isBitOrNoopPointerCastable(LI->getType(), AccessTy, DL)) { in FindAvailableLoadedValue()
218 CastInst::isBitOrNoopPointerCastable(SI->getValueOperand()->getType(), in FindAvailableLoadedValue()
DScalarEvolutionExpander.cpp55 if (CastInst *CI = dyn_cast<CastInst>(U)) in ReuseOrCreateCast()
64 Ret = CastInst::Create(Op, V, Ty, "", IP); in ReuseOrCreateCast()
76 Ret = CastInst::Create(Op, V, Ty, V->getName(), IP); in ReuseOrCreateCast()
91 Instruction::CastOps Op = CastInst::getCastOpcode(V, false, Ty, false); in InsertNoopCastOfTo()
103 if (CastInst *CI = dyn_cast<CastInst>(V)) { in InsertNoopCastOfTo()
111 if (CastInst *CI = dyn_cast<CastInst>(V)) in InsertNoopCastOfTo()
821 (isa<CastInst>(IncV) && !isa<BitCastInst>(IncV))) in isNormalAddRecExprPHI()
/external/llvm/include/llvm/Transforms/Utils/
DSimplifyIndVar.h24 class CastInst; variable
55 virtual void visitCast(CastInst *Cast) = 0;
/external/llvm/lib/Transforms/InstCombine/
DInstCombineCasts.cpp202 Res = CastInst::CreateIntegerCast(I->getOperand(0), Ty, in EvaluateInDifferentType()
235 isEliminableCastPair(const CastInst *CI, ///< First cast instruction in isEliminableCastPair()
251 unsigned Res = CastInst::isEliminableCastPair(firstOp, secondOp, SrcTy, MidTy, in isEliminableCastPair()
275 if (const CastInst *CI = dyn_cast<CastInst>(V)) in ShouldOptimizeCast()
289 Instruction *InstCombiner::commonCastTransforms(CastInst &CI) { in commonCastTransforms()
294 if (CastInst *CSrc = dyn_cast<CastInst>(Src)) { // A->B->C cast in commonCastTransforms()
299 return CastInst::Create(opc, CSrc->getOperand(0), CI.getType()); in commonCastTransforms()
490 return CastInst::CreateIntegerCast(Shift, CI.getType(), false); in visitTrunc()
583 return CastInst::CreateIntegerCast(In, CI.getType(), false/*ZExt*/); in transformZExtICmp()
971 return CastInst::CreateIntegerCast(In, CI.getType(), true/*SExt*/); in transformSExtICmp()
[all …]
DInstCombineInternal.h293 Instruction *commonCastTransforms(CastInst &CI);
294 Instruction *commonPointerCastTransforms(CastInst &CI);
299 Instruction *visitFPExt(CastInst &CI);
302 Instruction *visitUIToFP(CastInst &CI);
303 Instruction *visitSIToFP(CastInst &CI);
DInstCombineAndOrXor.cpp1449 if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) in visitAnd()
1450 if (CastInst *Op1C = dyn_cast<CastInst>(Op1)) { in visitAnd()
1461 return CastInst::Create(Op0C->getOpcode(), NewOp, I.getType()); in visitAnd()
1469 return CastInst::Create(Op0C->getOpcode(), Res, I.getType()); in visitAnd()
1476 return CastInst::Create(Op0C->getOpcode(), Res, I.getType()); in visitAnd()
2460 if (CastInst *Op0C = dyn_cast<CastInst>(Op0)) { in visitOr()
2461 CastInst *Op1C = dyn_cast<CastInst>(Op1); in visitOr()
2474 return CastInst::Create(Op0C->getOpcode(), NewOp, I.getType()); in visitOr()
2482 return CastInst::Create(Op0C->getOpcode(), Res, I.getType()); in visitOr()
2489 return CastInst::Create(Op0C->getOpcode(), Res, I.getType()); in visitOr()
[all …]
DInstCombinePHI.cpp407 if (isa<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
483 if (CastInst *FirstCI = dyn_cast<CastInst>(FirstInst)) { in FoldPHIArgOpIntoPHI()
484 CastInst *NewCI = CastInst::Create(FirstCI->getOpcode(), PhiVal, in FoldPHIArgOpIntoPHI()
DInstCombineCalls.cpp1001 return CastInst::Create(Instruction::BitCast, Result, CI.getType()); in visitCallInst()
1065 return CastInst::CreateIntegerCast(Arg0, II->getType(), in visitCallInst()
1234 const CastInst *const CI, in isSafeToEliminateVarargsCast()
1431 CastInst *CI = dyn_cast<CastInst>(*I); in visitCallSite()
1487 if (!CastInst::isBitOrNoopPointerCastable(NewRetTy, OldRetTy, DL)) { in transformConstExprCastCall()
1539 if (!CastInst::isBitOrNoopPointerCastable(ActTy, ParamTy, DL)) in transformConstExprCastCall()
1659 CastInst::getCastOpcode(*AI, false, PTy, false); in transformConstExprCastCall()
1705 NV = NC = CastInst::CreateBitOrPointerCast(NC, OldRetTy); in transformConstExprCastCall()
DInstructionCombining.cpp655 if (CastInst *CI = dyn_cast<CastInst>(&I)) { in FoldOperationIntoSelectOperand()
846 CastInst *CI = cast<CastInst>(&I); in FoldOpIntoPhi()
1077 if (CastInst *Cast = dyn_cast<CastInst>(Op)) { in Descale()
1533 return CastInst::Create(Instruction::IntToPtr, NewSub, GEP.getType()); in visitGetElementPtrInst()
1540 return CastInst::CreatePointerBitCastOrAddrSpaceCast(Y, in visitGetElementPtrInst()
1639 return CastInst::CreatePointerBitCastOrAddrSpaceCast(NewGEP, in visitGetElementPtrInst()
1675 return CastInst::CreatePointerBitCastOrAddrSpaceCast(NewGEP, in visitGetElementPtrInst()
1716 return CastInst::CreatePointerBitCastOrAddrSpaceCast(NewGEP, in visitGetElementPtrInst()
DInstCombineVectorOps.cpp281 } else if (CastInst *CI = dyn_cast<CastInst>(I)) { in visitExtractElementInst()
288 return CastInst::Create(CI->getOpcode(), EE, EI.getType()); in visitExtractElementInst()
730 return CastInst::Create(cast<CastInst>(I)->getOpcode(), NewOps[0], DestTy, in BuildNew()
/external/llvm/include/llvm/Analysis/
DTargetTransformInfoImpl.h426 if (const CastInst *CI = dyn_cast<CastInst>(U)) { in getUserCost()

123