[PATCH] D139877: [RISCV][InsertVSETVLI] Reverse traversal order of block in post pass [nfc]

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 13 11:19:51 PST 2022


reames added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp:1230
   SmallVector<MachineInstr*> ToDelete;
-  for (MachineInstr &MI : MBB) {
-    // Note: Must be *before* vsetvli handling to account for config cases
-    // which only change some subfields.
-    doUnion(Used, getDemanded(MI));
+  for (MachineInstr &MI : iterator_range(MBB.rbegin(), MBB.rend())) {
 
----------------
reames wrote:
> craig.topper wrote:
> > reames wrote:
> > > nemanjai wrote:
> > > > This causes failures with `-Werror`:
> > > > 
> > > > ```
> > > > RISCVInsertVSETVLI.cpp:1230:27: error: 'iterator_range' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported]
> > > >   for (MachineInstr &MI : iterator_range(MBB.rbegin(), MBB.rend())) {
> > > >                           ^
> > > > /home/nemanjai/llvm/Git/trunk1/llvm-project/llvm/include/llvm/ADT/iterator_range.h:30:7: note: add a deduction guide to suppress this warning
> > > > class iterator_range {
> > > >       ^
> > > > 1 error generated.
> > > > ```
> > > > Example: https://lab.llvm.org/buildbot/#/builders/36/builds/28344
> > > I have no idea what that warning means.  Forming an iterator range from two iterators is pretty much the canonical use case.  I'm happy to adjust code to remove the warning, but I'll need a hint on how to do so.
> > I think you want `make_range` instead of `iterator_range`?
> I absolutely do.  Wow, how did that even compile, much less pass all the unit tests?  Eek.
> 
> Fix upcoming shortly.  
Jordan beat me to a fix in 4f9d069, but I went ahead and switched to make_range in 3a020527 for clarity sake.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139877



More information about the llvm-commits mailing list