[PATCH] D93013: [RISCV] Define vadd intrinsics and lower to V instructions.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 13:42:29 PST 2020


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td:26
+
+    if (auto *C = dyn_cast<ConstantSDNode>(N)) {
+      if (C->isNullValue()) {
----------------
jrtc27 wrote:
> craig.topper wrote:
> > This can be simplified slightly to
> > 
> > ```
> > auto *C = dyn_cast<ConstantSDNode(N);
> > if (C && C->isNullValue()
> > ```
> > 
> > Then you don't need two levels of indentation
> I forget whether C++17 is allowed; if so you can do
> ```
> if (auto *C = dyn_cast<ConstantSDNode>(N); C->isNullValue())
> ```
> to get the benefits both of reduced scope and of reduced indentation.
I think we're only allowed to use C++14.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D93013



More information about the llvm-commits mailing list