Skip to content

Commit e10c6a5

Browse files
toppercyuxuanchen1997
authored andcommitted
[SelectionDAGBuilder] Avoid const_cast on call to matchSelectPattern. NFC (#100053)
Summary: By making the LHS and RHS const pointers, we can use the const signature of matchSelectPattern. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251079
1 parent f74576d commit e10c6a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3730,8 +3730,8 @@ void SelectionDAGBuilder::visitSelect(const User &I) {
37303730
// ValueTracking's select pattern matching does not account for -0.0,
37313731
// so we can't lower to FMINIMUM/FMAXIMUM because those nodes specify that
37323732
// -0.0 is less than +0.0.
3733-
Value *LHS, *RHS;
3734-
auto SPR = matchSelectPattern(const_cast<User*>(&I), LHS, RHS);
3733+
const Value *LHS, *RHS;
3734+
auto SPR = matchSelectPattern(&I, LHS, RHS);
37353735
ISD::NodeType Opc = ISD::DELETED_NODE;
37363736
switch (SPR.Flavor) {
37373737
case SPF_UMAX: Opc = ISD::UMAX; break;

0 commit comments

Comments
 (0)