[PATCH] D139169: [RISCV][WIP] Move VSPILL/VRELOAD expansion for vector tuples to eliminateFrameIndex.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 13:05:46 PST 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVRegisterInfo.cpp:276
+                  "Unexpected subreg numbering");
+  } else
+    assert(LMUL == 1 && "LMUL must be 1, 2, or 4.");
----------------
reames wrote:
> craig.topper wrote:
> > reames wrote:
> > > Missing {} will cause this to not compile without assertions.  Same in the function below.
> > Why? I moved this from another function that didn't have braces and it has been compiling fine.
> So, doesn't an assert expand to an empty string when assertions are enabled?
> 
> If so, we have a dangling else.  The next statement effectively becomes the body of the else.
> 
> Looking at the code you copied from, this is really quite interesting as it looks like that code is just blatantly wrong.  The key lowering loop would be conditional on the else.  Do we have any testing for this?  And if we do, does that test pass without asserts?
Doesn't the `;` that would still be there count as a statement for the else?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139169



More information about the llvm-commits mailing list