Skip to content

Commit b8d2b77

Browse files
authored
[SelectionDAGBuilder] Avoid const_cast on call to matchSelectPattern. NFC (llvm#100053)
By making the LHS and RHS const pointers, we can use the const signature of matchSelectPattern.
1 parent 4854e25 commit b8d2b77

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)