[PATCH] D41949: [RISCV] implement li pseudo instruction

Mario Werner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 18 02:17:55 PDT 2018


niosHD added a comment.

Hi Sameer,

thank you for reporting the issue. Eli already predicted that we loose CSE for LUI due to the use of the pseudo instruction. I was therefore already kind of expecting a missed optimisation of this form. On the plus side, considering that we only emit 32-bit constants in the codegen path, I am pretty confident that the LUI duplication is as bad as it gets. Still, we definitely should fix this issue.

Unfortunately, I do not see an easy fix as long as we stick with emitting pseudo instructions during codegen. When I introduced this in January it was a pure win given that it improved code quality and de-duplicated code. However, this may has to be revisited now given that the backend has been improved considerably in the meantime. To be perfectly honest, I would probably take a step backward in this situation and remove the automatic emission of the PseudoLI instruction from the codegen path again. I still think it is in the long run desirable to share the calculation of the individual immediate values and shift constants (if needed) between the codegen path and the MC layer. However, the current approach does not seem to be the right one. What do you guys think?


Repository:
  rL LLVM

https://reviews.llvm.org/D41949





More information about the llvm-commits mailing list