unsigned Size = VT.getSizeInBits();
const APInt &AndMask = CAnd->getAPIntValue();
unsigned ShiftBits = CShift->getZExtValue();
+
+ // Bail out, this node will probably disappear anyway.
+ if (ShiftBits == 0)
+ return SDValue();
+
unsigned MaskBits = AndMask.countTrailingOnes();
EVT HalfVT = EVT::getIntegerVT(*DAG.getContext(), Size / 2);
// extended to handle extensions mixed in.
SDValue SL(N0);
- assert(ShiftBits != 0 && MaskBits <= Size);
+ assert(MaskBits <= Size);
// Extracting the highest bit of the low half.
EVT ShiftVT = TLI.getShiftAmountTy(HalfVT, DAG.getDataLayout());
--- /dev/null
+ .text
+ .file "/home/davide/work/llvm/test/CodeGen/X86/visitand-shift.ll"
+ .globl patatino
+ .p2align 4, 0x90
+ .type patatino,@function
+patatino: # @patatino
+ .cfi_startproc
+# BB#0:
+ # implicit-def: %RAX
+ movzwl (%rax), %ecx
+ movl %ecx, %eax
+ # implicit-def: %RDX
+ movq %rax, (%rdx)
+ retq
+.Lfunc_end0:
+ .size patatino, .Lfunc_end0-patatino
+ .cfi_endproc
+
+
+ .section ".note.GNU-stack","",@progbits