[PATCH] D114174: [ARM][CodeGen] Add support for complex addition and multiplication

Momchil Velikov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 03:28:21 PDT 2022


chill added inline comments.


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:136
+
+    return std::find(ContainedInstructions.begin(), ContainedInstructions.end(),
+                     I) != ContainedInstructions.end();
----------------
Here and elsewhere `std::find` -> `llvm::find`


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:593
+
+  for (auto &I : *ConvergingI->getParent()) {
+
----------------
Why are we scanning the whole block?
It looks to me (admittedly I don't understand what this pass does yet)
we can just walk over the `Instructions` vector (in reverse, if the order matters),
avoiding the quadratic complexity.


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:633
+      bool ContainsNeg = false;
+      for (unsigned i = 0; i < Op0->getNumOperands(); i++) {
+        auto *Op = dyn_cast<Instruction>(Op0->getOperand(i));
----------------
Here and in a few other places `for (Value  *V : Op0->operands()) { `


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114174



More information about the llvm-commits mailing list