Index: llvm/lib/CodeGen/TargetPassConfig.cpp
--- llvm/lib/CodeGen/TargetPassConfig.cpp.orig
+++ llvm/lib/CodeGen/TargetPassConfig.cpp
@@ -955,6 +955,8 @@ void TargetPassConfig::addISelPrepare() {
 
   addPass(createCallBrPass());
 
+  addPass(createReturnProtectorPass());
+
   // Add both the safe stack and the stack protection passes: each of them will
   // only protect functions that have corresponding attributes.
   addPass(createSafeStackPass());
