[PATCH] D99384: [AArch64] Avoid SCALAR_TO_VECTOR for single FP constant vector.

David Sherwood via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 26 02:32:45 PDT 2021


david-arm added inline comments.


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:9673
   SDValue ConstantValue;
+  auto IsIntOrFPConstant = [](SDValue V) {
+    return isa<ConstantSDNode>(V) || isa<ConstantFPSDNode>(V);
----------------
It's just a thought, but this looks like a useful static function in it's own right that could live in a header somewhere? There are other parts of codegen that check the same thing, i.e.

  DAGCombiner::visitBITCAST
  DAGCombiner::getStoreMergeCandidates



================
Comment at: llvm/test/CodeGen/AArch64/arm64-build-vector.ll:94
+; single element FP vector constant from a scalar to vector.
+define <1 x double> @convert_single_fp_vector_constant(<1 x double>* %ptr, i1 %cmp) {
+; CHECK-LABEL: convert_single_fp_vector_constant:
----------------
This appears to be unused


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99384/new/

https://reviews.llvm.org/D99384



More information about the llvm-commits mailing list