2009 Corolla Engine swap from 2014

So I just bought a 2009 Corolla and it has a severe misfire. I have replaced plugs and ignition plugs with same results. I have completed a compression text on cylinders 1&2 which tested at 90 and 3&4 were 160. So I have decided to replace the engine. The 2009 engine has 213k miles and want to swap in an engine from a 2014 Corolla with 36k engine is 1.8L made in Canada and the 5th digit vin is U as well. So my question is will this 2014 motor work with the ECU and PCM on a 2009?
Thanks for any assistance in advanced!
Currently in the same position my moms 09 is only reading 90 in all 4. I found a 2017 for a good price, but not sure if anything in the motor changed, both vin letters match.
I TO NEED TO REPLACE MY ENGINE IN MY 2009 LE. What year engine will work with 2009 corolla 1.8l. Only 2009-2010 or will a newer one still mount easily?