From ccd7a98f97c7fabaf7ba3ccccaa71d458038d7a1 Mon Sep 17 00:00:00 2001 From: Simon Pilgrim Date: Fri, 18 Jun 2021 14:58:47 +0100 Subject: [PATCH] [DAG] SelectionDAG::computeKnownBits - use APInt::insertBits to merge subvector knownbits. NFCI. As noticed on D104472 we can use APInt::insertBits which will avoid a lot of temporary APInt creations --- lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index 6d2827e8574..c7f22dd3627 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -2955,8 +2955,8 @@ KnownBits SelectionDAG::computeKnownBits(SDValue Op, const APInt &DemandedElts, Known2 = computeKnownBits(N0, SubDemandedElts.shl(i), Depth + 1); unsigned Shifts = IsLE ? i : SubScale - 1 - i; - Known.One |= Known2.One.zext(BitWidth).shl(SubBitWidth * Shifts); - Known.Zero |= Known2.Zero.zext(BitWidth).shl(SubBitWidth * Shifts); + Known.One.insertBits(Known2.One, SubBitWidth * Shifts); + Known.Zero.insertBits(Known2.Zero, SubBitWidth * Shifts); } }