[DAGCombiner] When matching a disguised rotate by constant don't forget to apply LHSMask/RHSMask.
We try to match as a disguised rotate by constant of these forms (shl (X | Y), C1) | (srl X, C2) --> (rotl X, C1) | (shl Y, C1) (shl X, C1) | (srl (X | Y), C2) --> (rotl X, C1) | (srl Y, C2) We may have also looked through an AND to find the shift. If we did, we need to apply a mask to the result. I'll add an AArch64 test and pre-commit it and the RISC-V test tomorrow. Fixes PR55201. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D124711
Loading
Please sign in to comment