[llvm] r321398 - [X86] Use SelectionDAG::getZeroExtendInReg instead of implementing it manually.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 22 18:54:52 PST 2017
Author: ctopper
Date: Fri Dec 22 18:54:52 2017
New Revision: 321398
URL: http://llvm.org/viewvc/llvm-project?rev=321398&view=rev
Log:
[X86] Use SelectionDAG::getZeroExtendInReg instead of implementing it manually.
Modified:
llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
Modified: llvm/trunk/lib/Target/X86/X86ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86ISelLowering.cpp?rev=321398&r1=321397&r2=321398&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86ISelLowering.cpp Fri Dec 22 18:54:52 2017
@@ -33073,20 +33073,14 @@ static SDValue WidenMaskArithmetic(SDNod
SDValue Op = DAG.getNode(Narrow->getOpcode(), DL, WideVT, N0, N1);
unsigned Opcode = N->getOpcode();
switch (Opcode) {
+ default: llvm_unreachable("Unexpected opcode");
case ISD::ANY_EXTEND:
return Op;
- case ISD::ZERO_EXTEND: {
- unsigned InBits = NarrowVT.getScalarSizeInBits();
- APInt Mask = APInt::getAllOnesValue(InBits);
- Mask = Mask.zext(VT.getScalarSizeInBits());
- return DAG.getNode(ISD::AND, DL, VT,
- Op, DAG.getConstant(Mask, DL, VT));
- }
+ case ISD::ZERO_EXTEND:
+ return DAG.getZeroExtendInReg(Op, DL, VT.getScalarType());
case ISD::SIGN_EXTEND:
return DAG.getNode(ISD::SIGN_EXTEND_INREG, DL, VT,
Op, DAG.getValueType(NarrowVT));
- default:
- llvm_unreachable("Unexpected opcode");
}
}
More information about the llvm-commits
mailing list