diff --git a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp --- a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp +++ b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp @@ -40,6 +40,9 @@ STATISTIC(NumPhisDemoted, "Number of phi-nodes demoted"); static bool valueEscapes(const Instruction &Inst) { + if(Inst.getType()->isTokenTy()){ + return false; + } const BasicBlock *BB = Inst.getParent(); for (const User *U : Inst.users()) { const Instruction *UI = cast(U);