[PATCH] D41168: [X86] Lowering X86 avx512 sqrt intrinsics to IR
Craig Topper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 2 21:52:37 PDT 2018
craig.topper added inline comments.
================
Comment at: lib/CodeGen/CGBuiltin.cpp:8904
+ unsigned CC = cast<llvm::ConstantInt>(Ops[4])->getZExtValue();
+ // Support only if the rounding mode is 4 (AKA CUR_DIRECTION), otherwise keep the intrinsic.
+ if (CC != 4) {
----------------
80 columns?
================
Comment at: lib/CodeGen/CGBuiltin.cpp:8907
+ return nullptr;
+ }
+ llvm::Value *C0 = llvm::ConstantInt::get(SizeTy, 0);
----------------
Drop the curly braces
================
Comment at: lib/CodeGen/CGBuiltin.cpp:8909
+ llvm::Value *C0 = llvm::ConstantInt::get(SizeTy, 0);
+ Value *A = Builder.CreateExtractElement(Ops[0], C0, "extract");
+ Function *F = CGM.getIntrinsic(Intrinsic::sqrt, A->getType());
----------------
There's a signature for CreateExtractElement that takes a uint64_t for the index. No need to create a ConstantInt explicitly
================
Comment at: lib/CodeGen/CGBuiltin.cpp:8930
+ // Support only if the rounding mode is 4 (AKA CUR_DIRECTION), otherwise keep the intrinsic.
+ if (CC != 4) {
+ return nullptr;
----------------
Drop the curly braces
Repository:
rC Clang
https://reviews.llvm.org/D41168
More information about the cfe-commits
mailing list