Detecting power loss in a microcontroller to save context
The AMS1117 datasheet shows that it has a dropout voltage of 1.3 V max over the output voltage.
As a power fail indicator you need to detect when the 5 V supply drops to 4.3 V or less. After this point your AMS1117 output may start to drop. You have not specified the brownout voltage on your MCU, and you want to ensure you have time to save state before this voltage. 

I'd suggest that you should set the detection mechanism to a higher voltage on the 5 V supply, since it's probably clearly out of spec at anything below 4.7 V. 

Increasing the capacitance on the 3.3 v or 5 V supply can provide extra time, but putting a diode in series with the AMS1117 would be a bad idea since it's simply lowering the 3.3 V supplied to the MCU.

My suggestion would be to use a brownout detector such as the TC54VX42 or 43 with an external divider from the 5 V supply to set your detection threshold. 
They show you in the datasheet exactly how to set it up:


If you want to add extra capacitance to give extra response time, add it to the 5 V supply or to that supplies unregulated input ...not the AMS1117 supply.