forked from OSchip/llvm-project
[ValueTracking] Add computeKnownBits DemandedElts support to XOR instructions (PR36319)
This commit is contained in:
parent
47ce1406c8
commit
9d40292a64
|
@ -1137,8 +1137,8 @@ static void computeKnownBitsFromOperator(const Operator *I,
|
|||
Known.One |= Known2.One;
|
||||
break;
|
||||
case Instruction::Xor: {
|
||||
computeKnownBits(I->getOperand(1), Known, Depth + 1, Q);
|
||||
computeKnownBits(I->getOperand(0), Known2, Depth + 1, Q);
|
||||
computeKnownBits(I->getOperand(1), DemandedElts, Known, Depth + 1, Q);
|
||||
computeKnownBits(I->getOperand(0), DemandedElts, Known2, Depth + 1, Q);
|
||||
|
||||
// Output known-0 bits are known if clear or set in both the LHS & RHS.
|
||||
APInt KnownZeroOut = (Known.Zero & Known2.Zero) | (Known.One & Known2.One);
|
||||
|
|
|
@ -112,12 +112,7 @@ define i8 @test11(i8 %A) {
|
|||
|
||||
define i8 @test11v(<2 x i8> %A) {
|
||||
; CHECK-LABEL: @test11v(
|
||||
; CHECK-NEXT: [[B:%.*]] = or <2 x i8> [[A:%.*]], <i8 -2, i8 0>
|
||||
; CHECK-NEXT: [[CV:%.*]] = xor <2 x i8> [[B]], <i8 13, i8 13>
|
||||
; CHECK-NEXT: [[C:%.*]] = extractelement <2 x i8> [[CV]], i32 0
|
||||
; CHECK-NEXT: [[D:%.*]] = or i8 [[C]], 1
|
||||
; CHECK-NEXT: [[E:%.*]] = xor i8 [[D]], 12
|
||||
; CHECK-NEXT: ret i8 [[E]]
|
||||
; CHECK-NEXT: ret i8 -1
|
||||
;
|
||||
%B = or <2 x i8> %A, <i8 -2, i8 0>
|
||||
%CV = xor <2 x i8> %B, <i8 13, i8 13>
|
||||
|
|
Loading…
Reference in New Issue