[PATCH] D33170: [X86] Adding avx512_vpopcntdq feature set and its intrinsics

Oren Ben Simhon via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun May 21 03:32:54 PDT 2017


oren_ben_simhon added inline comments.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:7527
+    Value *X = EmitScalarExpr(E->getArg(0));
+    llvm::Function *F = CGM.getIntrinsic(Intrinsic::ctpop, ResultType);
+    return Builder.CreateCall(F, X);
----------------
craig.topper wrote:
> I think you can use Ops[0]->getType() and avoid the call to ConvertType. See the code for BI__builtin_ia32_vplzcntq_512_mask.
After checking it again, I am going to revert this change because AFAIK Ops[0] is the first argument and the return type.


================
Comment at: lib/CodeGen/CGBuiltin.cpp:7526
+    llvm::Type *ResultType = ConvertType(E->getType());
+    llvm::Function *F = CGM.getIntrinsic(Intrinsic::ctpop, ResultType);
+    return Builder.CreateCall(F, Ops);
----------------
craig.topper wrote:
> Why did the call to ConvertType come back? This code can just be
> 
> 
> ```
> llvm::Function *F = CGM.getIntrinsic(Intrinsic::ctpop, Ops[0]->getType());
> return Builder.CreateCall(F, Ops);
> ```
After checking it again, I reverted that change because AFAIK Ops[0] is the first argument and not the return type of the statement.


Repository:
  rL LLVM

https://reviews.llvm.org/D33170





More information about the cfe-commits mailing list