• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10.1/llvmCore-3425.0.34/lib/Analysis/

Lines Matching refs:Constant

41 // Constant Folding internal helper functions
44 /// FoldBitCast - Constant fold bitcast, symbolically evaluating it with
47 static Constant *FoldBitCast(Constant *C, Type *DestTy,
51 return Constant::getNullValue(DestTy);
53 return Constant::getAllOnesValue(DestTy);
99 Constant *Ops = C; // don't take the address of C!
158 SmallVector<Constant*, 32> Result;
161 Constant *Zero = Constant::getNullValue(DstEltTy);
167 Constant *Elt = Zero;
170 Constant *Src =dyn_cast<ConstantInt>(C->getAggregateElement(SrcElt++));
196 Constant *Src = dyn_cast<ConstantInt>(C->getAggregateElement(i));
204 Constant *Elt = ConstantExpr::getLShr(Src,
220 static bool IsConstantOffsetFromGlobal(Constant *C, GlobalValue *&GV,
275 static bool ReadDataFromGlobal(Constant *C, uint64_t ByteOffset,
390 static Constant *FoldReinterpretLoadFromConstPtr(Constant *C,
414 if (Constant *Res = FoldReinterpretLoadFromConstPtr(C, TD))
457 Constant *llvm::ConstantFoldLoadFromConstPtr(Constant *C,
471 if (Constant *V =
504 Constant *Res = ConstantInt::get(CE->getContext(), StrVal);
518 return Constant::getNullValue(ResTy);
532 static Constant *ConstantFoldLoadInst(const LoadInst *LI, const TargetData *TD){
535 if (Constant *C = dyn_cast<Constant>(LI->getOperand(0)))
545 static Constant *SymbolicallyEvaluateBinop(unsigned Opc, Constant *Op0,
546 Constant *Op1, const TargetData *TD){
574 static Constant *CastGEPIndices(ArrayRef<Constant *> Ops,
581 SmallVector<Constant*, 32> NewIdxs;
598 Constant *C =
601 if (Constant *Folded = ConstantFoldConstantExpression(CE, TD, TLI))
607 static Constant* StripPtrCastKeepAS(Constant* Ptr) {
610 Ptr = cast<Constant>(Ptr->stripPointerCasts());
624 static Constant *SymbolicallyEvaluateGEP(ArrayRef<Constant *> Ops,
627 Constant *Ptr = Ops[0];
648 Constant *Res = ConstantExpr::getPtrToInt(Ptr, CE->getType());
681 Ptr = cast<Constant>(GEP->getOperand(0));
695 Constant *C = ConstantInt::get(Ptr->getContext(), Offset+BasePtr);
705 SmallVector<Constant*, 32> NewIdxs;
764 Constant *C =
780 // Constant Folding public APIs
788 Constant *llvm::ConstantFoldInstruction(Instruction *I,
793 Constant *CommonValue = 0;
804 Constant *C = dyn_cast<Constant>(Incoming);
824 SmallVector<Constant*, 8> Ops;
826 Constant *Op = dyn_cast<Constant>(*i);
846 cast<Constant>(IVI->getAggregateOperand()),
847 cast<Constant>(IVI->getInsertedValueOperand()),
852 cast<Constant>(EVI->getAggregateOperand()),
861 Constant *llvm::ConstantFoldConstantExpression(const ConstantExpr *CE,
864 SmallVector<Constant*, 8> Ops;
867 Constant *NewC = cast<Constant>(*i);
887 /// information, due to only being passed an opcode and operands. Constant
890 Constant *llvm::ConstantFoldInstOperands(unsigned Opcode, Type *DestTy,
891 ArrayRef<Constant *> Ops,
897 if (Constant *C = SymbolicallyEvaluateBinop(Opcode, Ops[0], Ops[1], TD))
917 Constant *Input = CE->getOperand(0);
920 Constant *Mask =
964 if (Constant *C = CastGEPIndices(Ops, DestTy, TD, TLI))
966 if (Constant *C = SymbolicallyEvaluateGEP(Ops, DestTy, TD, TLI))
977 Constant *llvm::ConstantFoldCompareInstOperands(unsigned Predicate,
978 Constant *Ops0, Constant *Ops1,
994 Constant *C = ConstantExpr::getIntegerCast(CE0->getOperand(0),
996 Constant *Null = Constant::getNullValue(C->getType());
1004 Constant *C = CE0->getOperand(0);
1005 Constant *Null = Constant::getNullValue(C->getType());
1017 Constant *C0 = ConstantExpr::getIntegerCast(CE0->getOperand(0),
1019 Constant *C1 = ConstantExpr::getIntegerCast(CE1->getOperand(0),
1038 Constant *LHS =
1041 Constant *RHS =
1046 Constant *Ops[] = { LHS, RHS };
1058 Constant *llvm::ConstantFoldLoadThroughGEPConstantExpr(Constant *C,
1076 Constant *llvm::ConstantFoldLoadThroughGEPIndices(Constant *C,
1077 ArrayRef<Constant*> Indices) {
1089 // Constant Folding for Calls
1155 static Constant *ConstantFoldFP(double (*NativeFP)(double), double V,
1171 static Constant *ConstantFoldBinaryFP(double (*NativeFP)(double, double),
1193 /// performed, otherwise returns the Constant value resulting from the
1195 static Constant *ConstantFoldConvertToInt(const APFloat &Val,
1216 Constant *
1217 llvm::ConstantFoldCall(Function *F, ArrayRef<Constant *> Operands,
1275 // Constant fold exp2(x) as pow(2,x) in case the host doesn't have a
1296 return Constant::getNullValue(Ty);
1351 Constant *Op = cast<Constant>(Operands[0]);
1454 Constant *Ops[] = {