@@ -4342,11 +4342,6 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
43424342 assert (Mask->getType ()->getPrimitiveSizeInBits () == NumElements);
43434343 assert (RoundingMode->getType ()->isIntegerTy ());
43444344
4345- Mask = IRB.CreateBitCast (
4346- Mask, FixedVectorType::get (IRB.getInt1Ty (), NumElements));
4347- Value *MaskLower =
4348- IRB.CreateExtractElement (Mask, ConstantInt::get (IRB.getInt32Ty (), 0 ));
4349-
43504345 Value *AShadow = getShadow (A);
43514346 Value *AShadowLower = IRB.CreateExtractElement (
43524347 AShadow, ConstantInt::get (IRB.getInt32Ty (), 0 ));
@@ -4361,6 +4356,11 @@ struct MemorySanitizerVisitor : public InstVisitor<MemorySanitizerVisitor> {
43614356 Value *WriteThroughLowerShadow = IRB.CreateExtractElement (
43624357 WriteThroughShadow, ConstantInt::get (IRB.getInt32Ty (), 0 ));
43634358
4359+ Mask = IRB.CreateBitCast (
4360+ Mask, FixedVectorType::get (IRB.getInt1Ty (), NumElements));
4361+ Value *MaskLower =
4362+ IRB.CreateExtractElement (Mask, ConstantInt::get (IRB.getInt32Ty (), 0 ));
4363+
43644364 Value *DstLowerShadow =
43654365 IRB.CreateSelect (MaskLower, ABLowerShadow, WriteThroughLowerShadow);
43664366 Value *DstShadow = IRB.CreateInsertElement (
0 commit comments