Home | History | Annotate | Download | only in Instrumentation

Lines Matching defs:Origin

45 ///                           Origin tracking.
54 /// "select" instructions that pick the origin of a dirty argument, if an
57 /// Every 4 aligned, consecutive bytes of application memory have one origin
64 /// avoids storing origin to memory when a fully initialized value is stored.
65 /// This way it avoids needless overwritting origin of the 4-byte region on
183 "this number of checks and origin stores, use callbacks instead of "
199 // Origin = OriginBase + Offset
294 /// \brief Thread-local origin storage for function parameters.
298 /// \brief Thread-local origin storage for function return value.
306 /// \brief Thread-local space used to pass origin value to the UMR reporting
316 /// \brief Run-time helper that generates a new origin value for a stack
322 /// uninitialized value and returns an updated origin id encoding this info.
331 /// \brief Branch weights for origin store.
550 /// instructions store and load corresponding shadow and origin
572 Value *Origin;
575 : Shadow(S), Origin(O), OrigIns(I) { }
601 Value *originToIntptr(IRBuilder<> &IRB, Value *Origin) {
604 if (IntptrSize == kOriginSize) return Origin;
606 Origin = IRB.CreateIntCast(Origin, MS.IntptrTy, /* isSigned */ false);
607 return IRB.CreateOr(Origin, IRB.CreateShl(Origin, kOriginSize * 8));
610 /// \brief Fill memory range with the given origin value.
611 void paintOrigin(IRBuilder<> &IRB, Value *Origin, Value *OriginPtr,
622 Value *IntptrOrigin = originToIntptr(IRB, Origin);
637 IRB.CreateAlignedStore(Origin, GEP, CurrentAlignment);
642 void storeOrigin(IRBuilder<> &IRB, Value *Addr, Value *Shadow, Value *Origin,
648 paintOrigin(IRB, updateOrigin(Origin, IRB),
656 paintOrigin(IRB, updateOrigin(Origin, IRB),
671 Origin);
678 paintOrigin(IRBNew, updateOrigin(Origin, IRBNew),
710 void materializeOneCheck(Instruction *OrigIns, Value *Shadow, Value *Origin,
721 IRB.CreateStore(Origin ? (Value *)Origin : (Value *)IRB.getInt32(0),
741 IRB.CreateCall2(Fn, ConvertedShadow2, MS.TrackOrigins && Origin
742 ? Origin
753 IRB.CreateStore(Origin ? (Value *)Origin : (Value *)IRB.getInt32(0),
766 Value *Origin = ShadowData.Origin;
767 materializeOneCheck(OrigIns, Shadow, Origin, InstrumentWithCalls);
900 /// \brief Compute the origin address that corresponds to a given application
931 /// \brief Compute the origin address for a given function argument.
948 /// \brief Compute the origin address for a retval.
950 // We keep a single origin for the entire retval. Might be too optimistic.
960 /// \brief Set Origin to be the origin value for V.
961 void setOrigin(Value *V, Value *Origin) {
963 assert(!OriginMap.count(V) && "Values may only have one origin");
964 DEBUG(dbgs() << "ORIGIN: " << *V << " ==> " << *Origin << "\n");
965 OriginMap[V] = Origin;
1006 /// \brief Create a clean (zero) origin.
1110 /// \brief Get the origin for a value.
1117 Value *Origin = OriginMap[V];
1118 assert(Origin && "Missing origin");
1119 return Origin;
1122 /// \brief Get the origin for i-th argument of the instruction I.
1131 void insertShadowCheck(Value *Shadow, Value *Origin, Instruction *OrigIns) {
1140 ShadowOriginAndInsertPoint(Shadow, Origin, OrigIns));
1149 Value *Shadow, *Origin;
1153 Origin = getOrigin(Val);
1157 Origin = dyn_cast_or_null<Instruction>(getOrigin(Val));
1159 insertShadowCheck(Shadow, Origin, OrigIns);
1200 /// Loads the corresponding shadow and (optionally) origin.
1235 /// Stores the corresponding shadow and (optionally) origin.
1393 /// \brief Default propagation of shadow and/or origin.
1403 /// This class also implements the general case of origin propagation. For a
1404 /// Nary operation, result origin is set to the origin of an argument that is
1411 Value *Origin;
1417 Shadow(nullptr), Origin(nullptr), IRB(IRB), MSV(MSV) {}
1419 /// \brief Add a pair of shadow and origin values to the mix.
1433 if (!Origin) {
1434 Origin = OpOrigin;
1437 // No point in adding something that might result in 0 origin value.
1442 Origin = IRB.CreateSelect(Cond, OpOrigin, Origin);
1457 /// and origin.
1465 assert(Origin);
1466 MSV->setOrigin(I, Origin);
1474 /// \brief Propagate origin for arbitrary operation.