[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 10:17:28 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())) {
 
----------------
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.
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