File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
test/Transforms/SLPVectorizer/X86 Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -1100,7 +1100,9 @@ class BinOpSameOpcodeHelper {
1100
1100
// constant + x cannot be -constant - x
1101
1101
// instead, it should be x - -constant
1102
1102
if (Pos == 1 ||
1103
- (FromOpcode == Instruction::Add && ToOpcode == Instruction::Sub))
1103
+ ((FromOpcode == Instruction::Add || FromOpcode == Instruction::Or ||
1104
+ FromOpcode == Instruction::Xor) &&
1105
+ ToOpcode == Instruction::Sub))
1104
1106
return SmallVector<Value *>({LHS, RHS});
1105
1107
return SmallVector<Value *>({RHS, LHS});
1106
1108
}
@@ -1188,6 +1190,10 @@ class BinOpSameOpcodeHelper {
1188
1190
if (CIValue.isAllOnes())
1189
1191
InterchangeableMask = CanBeAll;
1190
1192
break;
1193
+ case Instruction::Xor:
1194
+ if (CIValue.isZero())
1195
+ InterchangeableMask = XorBIT | OrBIT | AndBIT | SubBIT | AddBIT;
1196
+ break;
1191
1197
default:
1192
1198
if (CIValue.isZero())
1193
1199
InterchangeableMask = CanBeAll;
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ define i1 @foo(i1 %v) { ; assume %v is 1
6
6
; CHECK-NEXT: [[ENTRY:.*:]]
7
7
; CHECK-NEXT: [[TMP0:%.*]] = insertelement <2 x i1> poison, i1 [[V]], i32 0
8
8
; CHECK-NEXT: [[TMP1:%.*]] = shufflevector <2 x i1> [[TMP0]], <2 x i1> poison, <2 x i32> zeroinitializer
9
- ; CHECK-NEXT: [[TMP2:%.*]] = mul <2 x i1> <i1 false, i1 true> , [[TMP1]]
9
+ ; CHECK-NEXT: [[TMP2:%.*]] = xor <2 x i1> zeroinitializer , [[TMP1]]
10
10
; CHECK-NEXT: [[TMP3:%.*]] = extractelement <2 x i1> [[TMP2]], i32 0
11
11
; CHECK-NEXT: [[TMP4:%.*]] = extractelement <2 x i1> [[TMP2]], i32 1
12
12
; CHECK-NEXT: [[SUB:%.*]] = sub i1 [[TMP3]], [[TMP4]]
You can’t perform that action at this time.
0 commit comments