X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=lib%2FIR%2FValue.cpp;h=7d205f975eb4ecd51754be724847f90140042b27;hb=4ceab42509518746afef0370e7aba230736a80f5;hp=52dcd6311ff81bd7683c2d0f50dcda38fd889d45;hpb=acd7b00be2b258ad3a1122463fbd6c9180179807;p=oota-llvm.git diff --git a/lib/IR/Value.cpp b/lib/IR/Value.cpp index 52dcd6311ff..7d205f975eb 100644 --- a/lib/IR/Value.cpp +++ b/lib/IR/Value.cpp @@ -23,8 +23,10 @@ #include "llvm/IR/GetElementPtrTypeIterator.h" #include "llvm/IR/InstrTypes.h" #include "llvm/IR/Instructions.h" +#include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/Module.h" #include "llvm/IR/Operator.h" +#include "llvm/IR/Statepoint.h" #include "llvm/IR/ValueHandle.h" #include "llvm/IR/ValueSymbolTable.h" #include "llvm/Support/Debug.h" @@ -570,6 +572,13 @@ static bool isDereferenceablePointer(const Value *V, const DataLayout *DL, return true; } + // For gc.relocate, look through relocations + if (const IntrinsicInst *I = dyn_cast(V)) + if (I->getIntrinsicID() == Intrinsic::experimental_gc_relocate) { + GCRelocateOperands RelocateInst(I); + return isDereferenceablePointer(RelocateInst.derivedPtr(), DL, Visited); + } + if (const AddrSpaceCastInst *ASC = dyn_cast(V)) return isDereferenceablePointer(ASC->getOperand(0), DL, Visited);