From 802ebcb4bb739db8d4beec3c28dbb7f9fe4e77db Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Mon, 20 Jun 2016 19:04:44 +0000 Subject: InstCombine: Don't strip convergent from intrinsic callsites Specific instances of intrinsic calls may want to be convergent, such as certain register reads but the intrinsic declaration is not. llvm-svn: 273188 --- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms/InstCombine') diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp index 1aa4b87bb92..c2cf21d5221 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp @@ -2507,7 +2507,8 @@ Instruction *InstCombiner::visitCallSite(CallSite CS) { if (Function *CalleeF = dyn_cast(Callee)) { // Remove the convergent attr on calls when the callee is not convergent. - if (CS.isConvergent() && !CalleeF->isConvergent()) { + if (CS.isConvergent() && !CalleeF->isConvergent() && + !CalleeF->isIntrinsic()) { DEBUG(dbgs() << "Removing convergent attr from instr " << CS.getInstruction() << "\n"); CS.setNotConvergent(); -- cgit v1.2.3