[PATCH] D153808: [CodeGen] Add support for integers using SVE2 in ComplexDeinterleaving passDepends on D153355

mgabka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 13 05:45:00 PDT 2023


mgabka added inline comments.


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:103
 
+static bool isNeg(Value *V);
+
----------------
please add a 1 line comment (just to emphasise that it works with floats and integers)


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:105
+
+static Value *getNegOperand(Value *V);
+
----------------
please add a comment


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:524
+
+  return match(I, m_Sub(m_Zero(), m_Value()));
+}
----------------
I think you can use here m_Neg pattern matches, documentation for it says:

Matches a "Neg" as 'sub 0, V'


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:968
+  if (isa<FPMathOperator>(Real)) {
+    Flags = Real->getFastMathFlags();
+    if (Real->getFastMathFlags() != Imag->getFastMathFlags()) {
----------------
looks like it can be deleted as we have an assignment after the check below.


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:1875
     I = B.CreateFNeg(InputA);
+    cast<Instruction>(I)->setFastMathFlags(Flags);
     break;
----------------
wouldn't be easier to always set FatMathFlags if they exist, outside of this switch? 


================
Comment at: llvm/lib/Target/AArch64/AArch64ISelLowering.cpp:25690
+        auto *Mask =
+            B.CreateVectorSplat(Ty->getElementCount(), B.getInt1(true));
         return B.CreateIntrinsic(
----------------
I think you can just use here getAllOnesValue


================
Comment at: llvm/test/CodeGen/AArch64/complex-deinterleaving-i16-add-scalable.ll:6
+
+; Expected to not transform
+define <vscale x 4 x i16> @complex_add_v4i16(<vscale x 4 x i16> %a, <vscale x 4 x i16> %b) {
----------------
worth to mention why


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153808



More information about the llvm-commits mailing list