[PATCH] D48288: Fix a bug introduced by rL334850
Tomasz Krupa via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 18 11:01:43 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rC334964: Fix a bug introduced by rL334850 (authored by tkrupa, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D48288?vs=151742&id=151752#toc
Repository:
rC Clang
https://reviews.llvm.org/D48288
Files:
lib/CodeGen/CGBuiltin.cpp
Index: lib/CodeGen/CGBuiltin.cpp
===================================================================
--- lib/CodeGen/CGBuiltin.cpp
+++ lib/CodeGen/CGBuiltin.cpp
@@ -9907,15 +9907,15 @@
Intrinsic::x86_avx512_mask_sqrt_ss;
return Builder.CreateCall(CGM.getIntrinsic(IID), Ops);
}
- Value *A = Builder.CreateExtractElement(Ops[0], (uint64_t)0);
+ Value *A = Builder.CreateExtractElement(Ops[1], (uint64_t)0);
Function *F = CGM.getIntrinsic(Intrinsic::sqrt, A->getType());
Value *Src = Builder.CreateExtractElement(Ops[2], (uint64_t)0);
int MaskSize = Ops[3]->getType()->getScalarSizeInBits();
llvm::Type *MaskTy = llvm::VectorType::get(Builder.getInt1Ty(), MaskSize);
Value *Mask = Builder.CreateBitCast(Ops[3], MaskTy);
Mask = Builder.CreateExtractElement(Mask, (uint64_t)0);
A = Builder.CreateSelect(Mask, Builder.CreateCall(F, {A}), Src);
- return Builder.CreateInsertElement(Ops[1], A, (uint64_t)0);
+ return Builder.CreateInsertElement(Ops[0], A, (uint64_t)0);
}
case X86::BI__builtin_ia32_sqrtpd256:
case X86::BI__builtin_ia32_sqrtpd:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D48288.151752.patch
Type: text/x-patch
Size: 1133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180618/39415f99/attachment.bin>
More information about the cfe-commits
mailing list