Index: llvm/lib/Analysis/ValueTracking.cpp =================================================================== --- llvm/lib/Analysis/ValueTracking.cpp +++ llvm/lib/Analysis/ValueTracking.cpp @@ -5418,7 +5418,10 @@ } break; } - + case Instruction::Ret: + if (I->getFunction()->hasRetAttribute(Attribute::NoUndef)) + Operands.insert(I->getOperand(0)); + break; default: break; }