[PATCH] D45722: [X86] Lowering SAD (sum of absolute differences) intrinsics to native IR (clang side)

Craig Topper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 23 10:12:47 PDT 2018


craig.topper added inline comments.


================
Comment at: clang/lib/CodeGen/CGBuiltin.cpp:8426
+  llvm::Type *BTy = llvm::VectorType::get(CGF.Builder.getInt8Ty(), N * 8);
+  SmallVector<uint32_t, 8> ShuffleMask;
+  for (unsigned i = 0; i < N; ++i)
----------------
Size the ShuffleMask to N when it's created. Then you can use just direct assign each array entry in the loops. This will remove the need for the clear() in the later loop. It will also remove the hidden code that checks if we need to grow on every call to push_back.


https://reviews.llvm.org/D45722





More information about the cfe-commits mailing list