Page MenuHomePhabricator

[DAGCombiner] Transform ABS(X) eq/ne 0/IntMin -> X eq/ne 0/IntMIn
Needs ReviewPublic

Authored by goldstein.w.n on Jan 26 2023, 1:38 PM.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Jan 26 2023, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 1:38 PM
goldstein.w.n requested review of this revision.Jan 26 2023, 1:38 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 26 2023, 1:38 PM
RKSimon added inline comments.Jan 27 2023, 3:29 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
11698

Isn't ISD::ABS always one operand? We don't have the INT_MIN handling in the DAG node:

/// ABS - Determine the unsigned absolute value of a signed integer value of
/// the same bitwidth.
/// Note: A value of INT_MIN will return INT_MIN, no saturation or overflow
/// is performed.
ABS,
goldstein.w.n added inline comments.Jan 27 2023, 10:43 AM
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
11698

Isn't ISD::ABS always one operand? We don't have the INT_MIN handling in the DAG node:

/// ABS - Determine the unsigned absolute value of a signed integer value of
/// the same bitwidth.
/// Note: A value of INT_MIN will return INT_MIN, no saturation or overflow
/// is performed.
ABS,

You're right, will fix if go forward with the patch, although based on the comment in D142345 I think the consensus with this is truly unneeded so will likely abandon.

RKSimon edited the summary of this revision. (Show Details)Tue, Mar 14, 8:34 AM