[llvm] [RISCV] Model dest EEW and fix peepholes not checking EEW (PR #105945)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 28 23:39:55 PDT 2024


lukel97 wrote:

> As discussed over at ([#104689 (comment)](https://github.com/llvm/llvm-project/pull/104689#discussion_r1731379411)), I think we really need to be checking EEW here not the ratio.

Agreed, I think using the ratio mostly worked by coincidence because the same ratio usually implies the same EEW. 

I've removed the ratio check so the only check we do now is for just the EEW.

> Given that, I think we also have a problem with narrowing operations as MI. (This case is not yet in the current code, but something I'd like to handle long term.) Such operations have SrcEEW=SEW*2. It would be nice if we could find a way to solve this consistently. (i.e. Can we implement something like an getOperandEEW?)

This crossed my mind as well. Something we should think about for a future patch.

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


More information about the llvm-commits mailing list