Skip to content

Commit cef490d

Browse files
[SDAG] Check context node for free truncates in DemandedBits (#171266)
Allow ShrinkDemandedOp to use Node-specific info
1 parent c9c4e6e commit cef490d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ bool TargetLowering::ShrinkDemandedOp(SDValue Op, unsigned BitWidth,
630630
for (unsigned SmallVTBits = llvm::bit_ceil(DemandedSize);
631631
SmallVTBits < BitWidth; SmallVTBits = NextPowerOf2(SmallVTBits)) {
632632
EVT SmallVT = EVT::getIntegerVT(*DAG.getContext(), SmallVTBits);
633-
if (isTruncateFree(VT, SmallVT) && isZExtFree(SmallVT, VT)) {
633+
if (isTruncateFree(Op, SmallVT) && isZExtFree(SmallVT, VT)) {
634634
// We found a type with free casts.
635635

636636
// If the operation has the 'disjoint' flag, then the

0 commit comments

Comments
 (0)