[PATCH] D86844: [Loops] Introduces handling for the noprogress loop metadata.

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 29 20:08:14 PDT 2020


jdoerfert added a comment.

I think the metadata name needs to be reversed, or at least made the opposite of the attribute name.
By default progress is required/guaranteed. With the function attribute it is not. With the metadata it is again for the loop. It has to be this way because the metadata can be dropped. It is only sound to go from required/guaranteed progress to not required/guaranteed, not the other way around.

That means in loop deletion we can remove the loop if:

1. the trip count is known
2. the function does not have the attribute
3. the loop has the metadata

We also need llvm-ir tests for the loop deletion pass that go through all combinations of attribute and metadata.



================
Comment at: llvm/include/llvm/Transforms/Utils/LoopUtils.h:230
 
+/// Look for the loop attribute that disables the Loop Deletion pass.
+bool hasNoProgress(const Loop *L);
----------------
Describe the metadata rather then the effect.


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:66
 static const char *LLVMLoopDisableLICM = "llvm.licm.disable";
+static const char *LLVMLoopNoProgress = "llvm.licm.noprogress";
 
----------------
`llvm.loop.XXXX`, `licm` is an optimization, this is generic "loop metadata".


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D86844



More information about the llvm-commits mailing list