it is impossible because the 8940 motherboard is intel and uses Intel socket and chipset, which are totally incompatible with AMD Ryzen.
Is it a good idea to replace the CPU of Dell XPS 8940 with AMD Ryzen 9 5900X?
XPS 8940, replace CPU with AMD Ryzen 9 5900X?