[DAGCombiner][RISCV] Make foldBinOpIntoSelect work correctly with opaque constants.
The CanFoldNonConst doesn't work correctly with opaque constants because getNode won't constant fold constants if one is opaque. Even if the operation is AND/OR. This can lead to infinite loops. This patch does the folding manually in the DAGCombine. Alternatively, we could improve getNode but that seemed likely to have bigger impact and possibly increase compile time for the additional checks. We wouldn't want to directly constant fold because we need to preserve the opaque flag. Fixes PR58511. Reviewed By: spatel Differential Revision: https://reviews.llvm.org/D136472
Loading
Please sign in to comment