Index: lib/CodeGen/BlockGenerators.cpp =================================================================== --- lib/CodeGen/BlockGenerators.cpp +++ lib/CodeGen/BlockGenerators.cpp @@ -299,8 +383,16 @@ // Skip some special intrinsics for which we do not adjust the semantics to // the new schedule. All others are handled like every other instruction. - if (isIgnoredIntrinsic(Inst)) + if (isIgnoredIntrinsic(Inst)){ + IntrinsicInst *IT = dyn_cast(Inst); + if(IT->getIntrinsicID() == llvm::Intrinsic::expect){ + Instruction *ValInst = dyn_cast(dyn_cast(Inst)->getArgOperand(0)); + dyn_cast(Inst)->replaceAllUsesWith(dyn_cast(ValInst)); + copyInstScalar(Stmt, ValInst, BBMap, LTS); + } + return; + } copyInstScalar(Stmt, Inst, BBMap, LTS); }