[llvm] [RISCV] Inhibit DAG folding shl through zext.w pattern with zba (PR #91626)

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Thu May 9 10:56:11 PDT 2024


preames wrote:

> > In practice, we can't undo this during ISEL resulting in worse code in some cases.
> 
> Why can't we undo it? Does it move too far away?

Sorry, I hadn't meant this as "we can't" and more "we don't".  We could write a non-trivial pattern match here, but we up having to match the whole (and (shl X, C), ShiftedMask) expression and then we have to check that C and the shift are compatible.  I looked at doing that, but it didn't seem particularly clean in tablegen.  

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


More information about the llvm-commits mailing list