131 #define DEBUG_TYPE "infer-address-spaces" 133 using namespace llvm;
148 unsigned FlatAddrSpace = 0;
153 InferAddressSpaces() :
154 FunctionPass(ID), FlatAddrSpace(UninitializedAddressSpace) {}
155 InferAddressSpaces(
unsigned AS) :
FunctionPass(ID), FlatAddrSpace(AS) {}
167 updateAddressSpace(
const Value &V,
168 const ValueToAddrSpaceMapTy &InferredAddrSpace)
const;
173 ValueToAddrSpaceMapTy *InferredAddrSpace)
const;
175 bool isSafeToCastConstAddrSpace(
Constant *
C,
unsigned NewAS)
const;
180 bool rewriteWithNewAddressSpaces(
182 const ValueToAddrSpaceMapTy &InferredAddrSpace,
Function *
F)
const;
184 void appendsFlatAddressExpressionToPostorderStack(
185 Value *V, std::vector<std::pair<Value *, bool>> &PostorderStack,
190 void collectRewritableIntrinsicOperands(
192 std::vector<std::pair<Value *, bool>> &PostorderStack,
195 std::vector<WeakTrackingVH> collectFlatAddressExpressions(
Function &
F)
const;
197 Value *cloneValueWithNewAddressSpace(
198 Value *V,
unsigned NewAddrSpace,
201 unsigned joinAddressSpaces(
unsigned AS1,
unsigned AS2)
const;
220 static
bool isAddressExpression(
const Value &V) {
221 if (!isa<Operator>(V))
226 case Instruction::PHI:
229 case Instruction::BitCast:
230 case Instruction::AddrSpaceCast:
231 case Instruction::GetElementPtr:
246 case Instruction::PHI: {
247 auto IncomingValues = cast<PHINode>(
Op).incoming_values();
249 IncomingValues.end());
251 case Instruction::BitCast:
252 case Instruction::AddrSpaceCast:
253 case Instruction::GetElementPtr:
263 bool InferAddressSpaces::rewriteIntrinsicOperands(
IntrinsicInst *II,
269 case Intrinsic::objectsize: {
279 return TTI->rewriteIntrinsicWithAddressSpace(II, OldV, NewV);
283 void InferAddressSpaces::collectRewritableIntrinsicOperands(
284 IntrinsicInst *II, std::vector<std::pair<Value *, bool>> &PostorderStack,
288 case Intrinsic::objectsize:
289 appendsFlatAddressExpressionToPostorderStack(II->
getArgOperand(0),
290 PostorderStack, Visited);
294 if (TTI->collectFlatAddressOperands(OpIndexes, IID)) {
295 for (
int Idx : OpIndexes) {
296 appendsFlatAddressExpressionToPostorderStack(II->
getArgOperand(Idx),
297 PostorderStack, Visited);
307 void InferAddressSpaces::appendsFlatAddressExpressionToPostorderStack(
308 Value *V, std::vector<std::pair<Value *, bool>> &PostorderStack,
316 if (isAddressExpression(*CE) && Visited.
insert(CE).second)
317 PostorderStack.push_back(std::make_pair(CE,
false));
322 if (isAddressExpression(*V) &&
324 if (Visited.
insert(V).second) {
325 PostorderStack.push_back(std::make_pair(V,
false));
330 if (isAddressExpression(*CE) && Visited.
insert(CE).second)
331 PostorderStack.emplace_back(CE,
false);
340 std::vector<WeakTrackingVH>
341 InferAddressSpaces::collectFlatAddressExpressions(
Function &
F)
const {
344 std::vector<std::pair<Value *, bool>> PostorderStack;
348 auto PushPtrOperand = [&](
Value *Ptr) {
349 appendsFlatAddressExpressionToPostorderStack(Ptr, PostorderStack,
357 if (
auto *
GEP = dyn_cast<GetElementPtrInst>(&
I)) {
358 if (!
GEP->getType()->isVectorTy())
359 PushPtrOperand(
GEP->getPointerOperand());
360 }
else if (
auto *LI = dyn_cast<LoadInst>(&
I))
361 PushPtrOperand(LI->getPointerOperand());
362 else if (
auto *
SI = dyn_cast<StoreInst>(&
I))
363 PushPtrOperand(
SI->getPointerOperand());
364 else if (
auto *RMW = dyn_cast<AtomicRMWInst>(&
I))
365 PushPtrOperand(RMW->getPointerOperand());
366 else if (
auto *CmpX = dyn_cast<AtomicCmpXchgInst>(&
I))
367 PushPtrOperand(CmpX->getPointerOperand());
368 else if (
auto *
MI = dyn_cast<MemIntrinsic>(&
I)) {
370 PushPtrOperand(
MI->getRawDest());
373 if (
auto *MTI = dyn_cast<MemTransferInst>(
MI))
374 PushPtrOperand(MTI->getRawSource());
375 }
else if (
auto *II = dyn_cast<IntrinsicInst>(&
I))
376 collectRewritableIntrinsicOperands(II, PostorderStack, Visited);
377 else if (
ICmpInst *Cmp = dyn_cast<ICmpInst>(&
I)) {
379 if (Cmp->getOperand(0)->getType()->isPointerTy()) {
380 PushPtrOperand(Cmp->getOperand(0));
381 PushPtrOperand(Cmp->getOperand(1));
383 }
else if (
auto *ASC = dyn_cast<AddrSpaceCastInst>(&
I)) {
384 if (!ASC->getType()->isVectorTy())
385 PushPtrOperand(ASC->getPointerOperand());
389 std::vector<WeakTrackingVH> Postorder;
390 while (!PostorderStack.empty()) {
391 Value *TopVal = PostorderStack.back().first;
394 if (PostorderStack.back().second) {
396 Postorder.push_back(TopVal);
397 PostorderStack.pop_back();
401 PostorderStack.back().second =
true;
403 appendsFlatAddressExpressionToPostorderStack(PtrOperand, PostorderStack,
414 const Use &OperandUse,
unsigned NewAddrSpace,
422 if (
Constant *
C = dyn_cast<Constant>(Operand))
425 if (
Value *NewOperand = ValueWithNewAddrSpace.
lookup(Operand))
448 if (I->
getOpcode() == Instruction::AddrSpaceCast) {
454 if (Src->
getType() != NewPtrType)
462 if (!OperandUse.get()->getType()->isPointerTy())
466 OperandUse, NewAddrSpace, ValueWithNewAddrSpace, UndefUsesToFix));
470 case Instruction::BitCast:
471 return new BitCastInst(NewPointerOperands[0], NewPtrType);
472 case Instruction::PHI: {
476 for (
unsigned Index = 0;
Index < PHI->getNumIncomingValues(); ++
Index) {
478 NewPHI->addIncoming(NewPointerOperands[OperandNo],
479 PHI->getIncomingBlock(
Index));
483 case Instruction::GetElementPtr: {
494 NewPointerOperands[2],
"",
nullptr,
I);
509 if (CE->
getOpcode() == Instruction::AddrSpaceCast) {
518 if (CE->
getOpcode() == Instruction::BitCast) {
546 if (
Value *NewOperand = ValueWithNewAddrSpace.
lookup(Operand)) {
548 NewOperands.
push_back(cast<Constant>(NewOperand));
551 if (
auto CExpr = dyn_cast<ConstantExpr>(Operand))
553 CExpr, NewAddrSpace, ValueWithNewAddrSpace)) {
555 NewOperands.
push_back(cast<Constant>(NewOperand));
567 if (CE->
getOpcode() == Instruction::GetElementPtr) {
571 NewOperands, TargetType,
false,
572 NewOperands[0]->
getType()->getPointerElementType());
583 Value *InferAddressSpaces::cloneValueWithNewAddressSpace(
584 Value *V,
unsigned NewAddrSpace,
588 assert(isAddressExpression(*V) &&
593 I, NewAddrSpace, ValueWithNewAddrSpace, UndefUsesToFix);
594 if (
Instruction *NewI = dyn_cast<Instruction>(NewV)) {
595 if (NewI->getParent() ==
nullptr) {
596 NewI->insertBefore(
I);
604 cast<ConstantExpr>(V), NewAddrSpace, ValueWithNewAddrSpace);
609 unsigned InferAddressSpaces::joinAddressSpaces(
unsigned AS1,
610 unsigned AS2)
const {
611 if (AS1 == FlatAddrSpace || AS2 == FlatAddrSpace)
612 return FlatAddrSpace;
614 if (AS1 == UninitializedAddressSpace)
616 if (AS2 == UninitializedAddressSpace)
620 return (AS1 == AS2) ? AS1 : FlatAddrSpace;
627 TTI = &getAnalysis<TargetTransformInfoWrapperPass>().getTTI(F);
629 if (FlatAddrSpace == UninitializedAddressSpace) {
630 FlatAddrSpace = TTI->getFlatAddressSpace();
631 if (FlatAddrSpace == UninitializedAddressSpace)
636 std::vector<WeakTrackingVH> Postorder = collectFlatAddressExpressions(F);
640 ValueToAddrSpaceMapTy InferredAddrSpace;
641 inferAddressSpaces(Postorder, &InferredAddrSpace);
645 return rewriteWithNewAddressSpaces(*TTI, Postorder, InferredAddrSpace, &F);
650 void InferAddressSpaces::inferAddressSpaces(
652 ValueToAddrSpaceMapTy *InferredAddrSpace)
const {
655 for (
Value *V : Postorder)
658 while (!Worklist.empty()) {
659 Value *V = Worklist.pop_back_val();
663 LLVM_DEBUG(
dbgs() <<
"Updating the address space of\n " << *V <<
'\n');
670 (*InferredAddrSpace)[V] = NewAS.
getValue();
674 if (Worklist.count(
User))
677 auto Pos = InferredAddrSpace->find(
User);
680 if (Pos == InferredAddrSpace->end())
686 if (Pos->second == FlatAddrSpace)
689 Worklist.insert(
User);
695 const Value &V,
const ValueToAddrSpaceMapTy &InferredAddrSpace)
const {
696 assert(InferredAddrSpace.count(&V));
707 auto I = InferredAddrSpace.find(Src0);
708 unsigned Src0AS = (
I != InferredAddrSpace.end()) ?
711 auto J = InferredAddrSpace.find(Src1);
712 unsigned Src1AS = (J != InferredAddrSpace.end()) ?
721 if ((C1 && Src0AS == UninitializedAddressSpace) ||
725 if (C0 && isSafeToCastConstAddrSpace(C0, Src1AS))
727 else if (C1 && isSafeToCastConstAddrSpace(C1, Src0AS))
730 NewAS = joinAddressSpaces(Src0AS, Src1AS);
733 auto I = InferredAddrSpace.find(PtrOperand);
734 unsigned OperandAS =
I != InferredAddrSpace.end() ?
735 I->second : PtrOperand->getType()->getPointerAddressSpace();
738 NewAS = joinAddressSpaces(NewAS, OperandAS);
739 if (NewAS == FlatAddrSpace)
744 unsigned OldAS = InferredAddrSpace.lookup(&V);
745 assert(OldAS != FlatAddrSpace);
757 Use &U,
unsigned AddrSpace) {
760 bool VolatileIsAllowed =
false;
761 if (
auto *
I = dyn_cast<Instruction>(Inst))
764 if (
auto *LI = dyn_cast<LoadInst>(Inst))
766 (VolatileIsAllowed || !LI->isVolatile());
768 if (
auto *
SI = dyn_cast<StoreInst>(Inst))
770 (VolatileIsAllowed || !
SI->isVolatile());
772 if (
auto *RMW = dyn_cast<AtomicRMWInst>(Inst))
774 (VolatileIsAllowed || !RMW->isVolatile());
776 if (
auto *CmpX = dyn_cast<AtomicCmpXchgInst>(Inst))
778 (VolatileIsAllowed || !CmpX->isVolatile());
793 if (
auto *MSI = dyn_cast<MemSetInst>(MI)) {
797 TBAA, ScopeMD, NoAliasMD);
798 }
else if (
auto *MTI = dyn_cast<MemTransferInst>(MI)) {
799 Value *Src = MTI->getRawSource();
800 Value *Dest = MTI->getRawDest();
809 if (isa<MemCpyInst>(MTI)) {
810 MDNode *TBAAStruct = MTI->getMetadata(LLVMContext::MD_tbaa_struct);
811 B.
CreateMemCpy(Dest, MTI->getDestAlign(), Src, MTI->getSourceAlign(),
814 TBAA, TBAAStruct, ScopeMD, NoAliasMD);
816 assert(isa<MemMoveInst>(MTI));
817 B.
CreateMemMove(Dest, MTI->getDestAlign(), Src, MTI->getSourceAlign(),
820 TBAA, ScopeMD, NoAliasMD);
831 bool InferAddressSpaces::isSafeToCastConstAddrSpace(
Constant *
C,
unsigned NewAS)
const {
832 assert(NewAS != UninitializedAddressSpace);
835 if (SrcAS == NewAS || isa<UndefValue>(C))
839 if (SrcAS != FlatAddrSpace && NewAS != FlatAddrSpace)
842 if (isa<ConstantPointerNull>(C))
845 if (
auto *
Op = dyn_cast<Operator>(C)) {
848 if (
Op->getOpcode() == Instruction::AddrSpaceCast)
849 return isSafeToCastConstAddrSpace(cast<Constant>(
Op->getOperand(0)), NewAS);
851 if (
Op->getOpcode() == Instruction::IntToPtr &&
852 Op->getType()->getPointerAddressSpace() == FlatAddrSpace)
861 User *CurUser = I->getUser();
864 while (I != End && I->getUser() == CurUser)
870 bool InferAddressSpaces::rewriteWithNewAddressSpaces(
872 const ValueToAddrSpaceMapTy &InferredAddrSpace,
Function *F)
const {
879 for (
Value* V : Postorder) {
880 unsigned NewAddrSpace = InferredAddrSpace.lookup(V);
882 ValueWithNewAddrSpace[V] = cloneValueWithNewAddressSpace(
883 V, NewAddrSpace, ValueWithNewAddrSpace, &UndefUsesToFix);
887 if (ValueWithNewAddrSpace.
empty())
891 for (
const Use *UndefUse : UndefUsesToFix) {
892 User *V = UndefUse->getUser();
893 User *NewV = cast<User>(ValueWithNewAddrSpace.
lookup(V));
894 unsigned OperandNo = UndefUse->getOperandNo();
903 assert(WVH &&
"value was unexpectedly deleted");
909 LLVM_DEBUG(
dbgs() <<
"Replacing the uses of " << *V <<
"\n with\n " 912 if (
Constant *C = dyn_cast<Constant>(V)) {
916 LLVM_DEBUG(
dbgs() <<
"Inserting replacement const cast: " << Replace
917 <<
": " << *Replace <<
'\n');
942 if (
auto *
MI = dyn_cast<MemIntrinsic>(CurUser)) {
947 if (
auto *II = dyn_cast<IntrinsicInst>(CurUser)) {
948 if (rewriteIntrinsicOperands(II, V, NewV))
952 if (isa<Instruction>(CurUser)) {
953 if (
ICmpInst *Cmp = dyn_cast<ICmpInst>(CurUser)) {
962 int OtherIdx = (SrcIdx == 0) ? 1 : 0;
963 Value *OtherSrc = Cmp->getOperand(OtherIdx);
965 if (
Value *OtherNewV = ValueWithNewAddrSpace.
lookup(OtherSrc)) {
966 if (OtherNewV->getType()->getPointerAddressSpace() == NewAS) {
967 Cmp->setOperand(OtherIdx, OtherNewV);
968 Cmp->setOperand(SrcIdx, NewV);
974 if (
auto *KOtherSrc = dyn_cast<Constant>(OtherSrc)) {
975 if (isSafeToCastConstAddrSpace(KOtherSrc, NewAS)) {
976 Cmp->setOperand(SrcIdx, NewV);
977 Cmp->setOperand(OtherIdx,
986 if (ASC->getDestAddressSpace() == NewAS) {
987 if (ASC->getType()->getPointerElementType() !=
999 if (
Instruction *Inst = dyn_cast<Instruction>(V)) {
1001 if (U == V && isa<AddrSpaceCastInst>(V))
1005 while (isa<PHINode>(InsertPos))
1028 return new InferAddressSpaces(AddressSpace);
static bool handleMemIntrinsicPtrUse(MemIntrinsic *MI, Value *OldV, Value *NewV)
Update memory intrinsic uses that require more complex processing than simple memory instructions...
SymbolTableList< Instruction >::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
unsigned getOpcode() const
Return the opcode at the root of this constant expression.
This class represents lattice values for constants.
A Module instance is used to store all the information related to an LLVM module. ...
void push_back(const T &Elt)
static Constant * getAddrSpaceCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
static GetElementPtrInst * Create(Type *PointeeType, Value *Ptr, ArrayRef< Value *> IdxList, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
static SelectInst * Create(Value *C, Value *S1, Value *S2, const Twine &NameStr="", Instruction *InsertBefore=nullptr, Instruction *MDFrom=nullptr)
void setArgOperand(unsigned i, Value *v)
unsigned getPointerAddressSpace() const
Get the address space of this pointer or pointer vector type.
This defines the Use class.
Value * getArgOperand(unsigned i) const
static unsigned getOperandNumForIncomingValue(unsigned i)
AnalysisUsage & addRequired()
This class represents a conversion between pointers from one address space to another.
Type * getPointerElementType() const
A Use represents the edge between a Value definition and its users.
PointerType * getPointerTo(unsigned AddrSpace=0) const
Return a pointer to the current type.
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
Type * getSourceElementType() const
User * getUser() const LLVM_READONLY
Returns the User that contains this Use.
A constant value that is initialized with an expression using other constant values.
Type * getType() const
All values are typed, get the type of this value.
Value handle that is nullable, but tries to track the Value.
CallInst * CreateMemCpy(Value *Dst, MaybeAlign DstAlign, Value *Src, MaybeAlign SrcAlign, uint64_t Size, bool isVolatile=false, MDNode *TBAATag=nullptr, MDNode *TBAAStructTag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
bool isInBounds() const
Determine whether the GEP has the inbounds flag.
void setCalledFunction(Function *Fn)
Sets the function called, including updating the function type.
const T & getValue() const LLVM_LVALUE_FUNCTION
static Constant * getSelect(Constant *C, Constant *V1, Constant *V2, Type *OnlyIfReducedTy=nullptr)
Select constant expr.
This class represents a no-op cast from one type to another.
MDNode * getMetadata(unsigned KindID) const
Get the metadata of given kind attached to this Instruction.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
unsigned getOpcode() const
Returns a member of one of the enums like Instruction::Add.
void replaceAllUsesWith(Value *V)
Change all uses of this to point to a new Value.
unsigned getOperandNo() const
Return the operand # of this use in its User.
ValueT lookup(const KeyT &Val) const
lookup - Return the entry for the specified key, or a default constructed value if no such entry exis...
Function * getDeclaration(Module *M, ID id, ArrayRef< Type *> Tys=None)
Create or insert an LLVM Function declaration for an intrinsic, and return it.
Value * getOperand(unsigned i) const
use_iterator_impl< Use > use_iterator
static Constant * getBitCast(Constant *C, Type *Ty, bool OnlyIfReduced=false)
an instruction for type-safe pointer arithmetic to access elements of arrays and structs ...
FunctionPass * createInferAddressSpacesPass(unsigned AddressSpace=~0u)
static bool runOnFunction(Function &F, bool PostInlining)
static unsigned getPointerOperandIndex()
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
The instances of the Type class are immutable: once they are created, they are never changed...
static unsigned getPointerOperandIndex()
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
bool isPointerTy() const
True if this is an instance of PointerType.
std::pair< iterator, bool > insert(const ValueT &V)
Represent the analysis usage information of a pass.
This instruction compares its operands according to the predicate given to the constructor.
FunctionPass class - This class is used to implement most global optimizations.
void initializeInferAddressSpacesPass(PassRegistry &)
bool RecursivelyDeleteTriviallyDeadInstructions(Value *V, const TargetLibraryInfo *TLI=nullptr, MemorySSAUpdater *MSSAU=nullptr)
If the specified value is a trivially dead instruction, delete it.
static UndefValue * get(Type *T)
Static factory methods - Return an 'undef' object of the specified type.
static wasm::ValType getType(const TargetRegisterClass *RC)
Constant * getWithOperands(ArrayRef< Constant *> Ops) const
This returns the current constant expression with the operands replaced with the specified values...
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
Intrinsic::ID getIntrinsicID() const
Return the intrinsic ID of this intrinsic.
static Value * cloneConstantExprWithNewAddressSpace(ConstantExpr *CE, unsigned NewAddrSpace, const ValueToValueMapTy &ValueWithNewAddrSpace)
This is the common base class for memset/memcpy/memmove.
Iterator for intrusive lists based on ilist_node.
unsigned getNumOperands() const
Align max(MaybeAlign Lhs, Align Rhs)
This struct is a compact representation of a valid (power of two) or undefined (0) alignment...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
This is a utility class that provides an abstraction for the common functionality between Instruction...
static Value * cloneInstructionWithNewAddressSpace(Instruction *I, unsigned NewAddrSpace, const ValueToValueMapTy &ValueWithNewAddrSpace, SmallVectorImpl< const Use *> *UndefUsesToFix)
static PHINode * Create(Type *Ty, unsigned NumReservedValues, const Twine &NameStr="", Instruction *InsertBefore=nullptr)
Constructors - NumReservedValues is a hint for the number of incoming edges that this phi node will h...
void setPreservesCFG()
This function should be called by the pass, iff they do not:
static const unsigned UninitializedAddressSpace
void setOperand(unsigned i, Value *Val)
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
iterator_range< user_iterator > users()
INITIALIZE_PASS(InferAddressSpaces, DEBUG_TYPE, "Infer address spaces", false, false) static bool isAddressExpression(const Value &V)
CallInst * CreateMemMove(Value *Dst, MaybeAlign DstAlign, Value *Src, MaybeAlign SrcAlign, uint64_t Size, bool isVolatile=false, MDNode *TBAATag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
static CastInst * Create(Instruction::CastOps, Value *S, Type *Ty, const Twine &Name="", Instruction *InsertBefore=nullptr)
Provides a way to construct any of the CastInst subclasses using an opcode instead of the subclass's ...
const Function * getParent() const
Return the enclosing method, or null if none.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
static unsigned getPointerOperandIndex()
static unsigned getPointerOperandIndex()
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
Module * getParent()
Get the module that this global value is contained inside of...
LLVM Value Representation.
unsigned getOpcode() const
Return the opcode for this Instruction or ConstantExpr.
static SmallVector< Value *, 2 > getPointerOperands(const Value &V)
static Value::use_iterator skipToNextUser(Value::use_iterator I, Value::use_iterator End)
inst_range instructions(Function *F)
PassRegistry - This class manages the registration and intitialization of the pass subsystem as appli...
static bool isSimplePointerUseValidToReplace(const TargetTransformInfo &TTI, Use &U, unsigned AddrSpace)
returns true if U is the pointer operand of a memory instruction with a single pointer operand that c...
A wrapper class for inspecting calls to intrinsic functions.
const BasicBlock * getParent() const
CallInst * CreateMemSet(Value *Ptr, Value *Val, uint64_t Size, MaybeAlign Align, bool isVolatile=false, MDNode *TBAATag=nullptr, MDNode *ScopeTag=nullptr, MDNode *NoAliasTag=nullptr)
Create and insert a memset to the specified pointer and the specified value.
static Value * operandWithNewAddressSpaceOrCreateUndef(const Use &OperandUse, unsigned NewAddrSpace, const ValueToValueMapTy &ValueWithNewAddrSpace, SmallVectorImpl< const Use *> *UndefUsesToFix)