[llvm] [SelectionDAG] Fold (icmp eq/ne (shift X, C), 0) -> (icmp eq/ne X, 0) (PR #88801)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Tue May 7 02:26:14 PDT 2024
================
@@ -4282,6 +4282,38 @@ SelectionDAG::computeOverflowForSignedMul(SDValue N0, SDValue N1) const {
return OFK_Sometime;
}
+SDNodeFlags SelectionDAG::computeShiftFlags(SDValue Op) const {
+ assert((Op.getOpcode() == ISD::SRL || Op.getOpcode() == ISD::SRA ||
+ Op.getOpcode() == ISD::SHL) &&
+ "Expecting an SHL/SRL/SRA operation.");
+ SDValue Op0 = Op.getOperand(0);
+ SDNodeFlags Flags = Op->getFlags();
+
----------------
bjope wrote:
I've tried to guard the most expensive computations below by checking if the flags already are present. So not quite sure what you propose.
https://github.com/llvm/llvm-project/pull/88801
More information about the llvm-commits
mailing list