Skip to content

Commit 72fd10a

Browse files
committed
[X86] getTargetConstantBitsFromNode - don't support partial undefs by default.
Noticed by inspection - as undef bits are seen as zero, we could be matching in places where we require a zero but end up referencing an undef that could then get changed in a later fold. Creating a test case has proven difficult as multi-use limits usually saves us, but really we shouldn't be allowing partial undefs for anything but constant folding.
1 parent 915c3d9 commit 72fd10a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4596,7 +4596,7 @@ static bool getTargetConstantBitsFromNode(SDValue Op, unsigned EltSizeInBits,
45964596
APInt &UndefElts,
45974597
SmallVectorImpl<APInt> &EltBits,
45984598
bool AllowWholeUndefs = true,
4599-
bool AllowPartialUndefs = true) {
4599+
bool AllowPartialUndefs = false) {
46004600
assert(EltBits.empty() && "Expected an empty EltBits vector");
46014601

46024602
Op = peekThroughBitcasts(Op);

0 commit comments

Comments
 (0)