[llvm] [PeepholeOptimizer] Recognize new move-immediate instructions (PR #72128)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 22:49:29 PST 2023


arsenm wrote:

> But currently it has no way to "go backwards" from a constant in a vgpr to the same constant in an sgpr.


I think SIFoldOperands works backwards from how it should, going from uses to defs instead of defs to uses. It would be better if it collected seen foldable instructions, more like how PeepholeOpt does it. If we consistently have constants materialized in VGPRs (as should happen in GlobalIsel), I think it's simpler to introduce new SGPRs where appropriate rather than needing to handle existing partially folded operands as it does now.



https://github.com/llvm/llvm-project/pull/72128


More information about the llvm-commits mailing list