File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -278,20 +278,19 @@ static bool expandNormalizeIntrinsic(CallInst *Orig) {
278
278
/* gen_crash_diag=*/ false );
279
279
}
280
280
281
- Value *Multiplicand = Builder.CreateIntrinsic (EltTy, Intrinsic::dx_rsqrt,
282
- ArrayRef<Value *>{DotProduct},
283
- nullptr , " dx.rsqrt" );
284
-
285
281
// verify that the length is non-zero
286
- // (if the reciprocal sqrt of the length is non-zero, then the length is
287
- // non-zero)
288
- if (auto *constantFP = dyn_cast<ConstantFP>(Multiplicand)) {
282
+ // (if the dot product is non-zero, then the length is non-zero)
283
+ if (auto *constantFP = dyn_cast<ConstantFP>(DotProduct)) {
289
284
const APFloat &fpVal = constantFP->getValueAPF ();
290
285
if (fpVal.isZero ())
291
286
report_fatal_error (Twine (" Invalid input vector: length is zero" ),
292
287
/* gen_crash_diag=*/ false );
293
288
}
294
289
290
+ Value *Multiplicand = Builder.CreateIntrinsic (EltTy, Intrinsic::dx_rsqrt,
291
+ ArrayRef<Value *>{DotProduct},
292
+ nullptr , " dx.rsqrt" );
293
+
295
294
Value *MultiplicandVec = Builder.CreateVectorSplat (XVecSize, Multiplicand);
296
295
Value *Result = Builder.CreateFMul (X, MultiplicandVec);
297
296
You can’t perform that action at this time.
0 commit comments