Run -mem2reg at the beginning of the kernel compilation to clean up the code.