@@ -135,7 +135,6 @@ static Constant *constantFoldWrRegion(Type *RetTy,
135
135
const CMRegion &R, const DataLayout &DL) {
136
136
Constant *OldValue = Operands[GenXIntrinsic::GenXRegion::OldValueOperandNum];
137
137
Constant *NewValue = Operands[GenXIntrinsic::GenXRegion::NewValueOperandNum];
138
- Constant *Mask = Operands[GenXIntrinsic::GenXRegion::PredicateOperandNum];
139
138
// The inputs can be ConstantExpr if we are being called from
140
139
// CallAnalyzer.
141
140
if (isa<ConstantExpr>(OldValue) || isa<ConstantExpr>(NewValue))
@@ -148,8 +147,7 @@ static Constant *constantFoldWrRegion(Type *RetTy,
148
147
149
148
const int RetElemSize = DL.getTypeSizeInBits (RetTy->getScalarType ()) / 8 ;
150
149
unsigned Offset = OffsetC->getSExtValue () / RetElemSize;
151
- if (isa<UndefValue>(OldValue) && R.isContiguous () && Offset == 0 &&
152
- Mask->isAllOnesValue ()) {
150
+ if (isa<UndefValue>(OldValue) && R.isContiguous () && (Offset == 0 )) {
153
151
// If old value is undef and new value is splat, and the result vector
154
152
// is no bigger than 2 GRFs, then just return a splat of the right type.
155
153
Constant *Splat = NewValue;
@@ -174,7 +172,7 @@ static Constant *constantFoldWrRegion(Type *RetTy,
174
172
return UndefValue::get (RetTy); // out of range index
175
173
if (!isa<VectorType>(NewValue->getType ()))
176
174
Values[Offset] = NewValue;
177
- else if (!Mask-> isZeroValue ()) {
175
+ else {
178
176
unsigned RowIdx = Offset;
179
177
unsigned Idx = RowIdx;
180
178
unsigned NextRow = R.Width ;
@@ -187,10 +185,7 @@ static Constant *constantFoldWrRegion(Type *RetTy,
187
185
if (Idx >= WholeNumElements)
188
186
// return collected values even if idx is out of bounds
189
187
return ConstantVector::get (Values);
190
- if (Mask->isAllOnesValue () ||
191
- (Mask->getType ()->isVectorTy () &&
192
- !cast<ConstantVector>(Mask)->getAggregateElement (i)->isZeroValue ()))
193
- Values[Idx] = NewValue->getAggregateElement (i);
188
+ Values[Idx] = NewValue->getAggregateElement (i);
194
189
Idx += R.Stride ;
195
190
}
196
191
}
0 commit comments