[X86] Implement __builtin_ia32_vec_ext_v2si correctly even though we only use it with an index of 0.

This builtin takes an index as its second operand, but the codegen hardcodes an index of 0 and doesn't use the operand. The only use of the builtin in the header file passes 0 to the operand so this works for that usage. But its more correct to use the real operand.

llvm-svn: 334054
This commit is contained in:
Craig Topper 2018-06-05 22:40:03 +00:00
parent 8cef7fd75a
commit 6b5b5ce06c
1 changed files with 1 additions and 1 deletions

View File

@ -8779,7 +8779,7 @@ Value *CodeGenFunction::EmitX86BuiltinExpr(unsigned BuiltinID,
llvm::Type::getX86_MMXTy(getLLVMContext()));
case X86::BI__builtin_ia32_vec_ext_v2si:
return Builder.CreateExtractElement(Ops[0],
llvm::ConstantInt::get(Ops[1]->getType(), 0));
cast<ConstantInt>(Ops[1])->getZExtValue());
case X86::BI_mm_setcsr:
case X86::BI__builtin_ia32_ldmxcsr: {
Address Tmp = CreateMemTemp(E->getArg(0)->getType());