diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -49145,7 +49145,7 @@ // Don't break NOT patterns. SDValue BC = peekThroughOneUseBitcasts(N0); if (ISD::isBitwiseLogicOp(BC.getOpcode()) && - BC->isOnlyUserOf(BC.getOperand(1).getNode()) && + BC->isOnlyUserOf(BC.getOperand(1).getNode()) && !ISD::isBuildVectorAllOnes(BC.getOperand(1).getNode())) { if (SDValue RHS = TryConstantFold(BC.getOperand(1))) { SDLoc DL(N);