diff options
author | Tim Corringham <tcorring@amd.com> | 2019-08-08 13:46:17 +0000 |
---|---|---|
committer | Tim Corringham <tcorring@amd.com> | 2019-08-08 13:46:17 +0000 |
commit | 4f64f1ba3c540cddbcf3f7f5e5b8a2fd9ebbb416 (patch) | |
tree | 69bb4c8a06f78dafb8905900509c5f5ba51eebe5 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 195ae90307bdbfcb7393da5dfbbb2bb38ff24107 (diff) | |
download | bcm5719-llvm-4f64f1ba3c540cddbcf3f7f5e5b8a2fd9ebbb416.tar.gz bcm5719-llvm-4f64f1ba3c540cddbcf3f7f5e5b8a2fd9ebbb416.zip |
Add llvm.licm.disable metadata
For some targets the LICM pass can result in sub-optimal code in some
cases where it would be better not to run the pass, but it isn't
always possible to suppress the transformations heuristically.
Where the front-end has insight into such cases it is beneficial
to attach loop metadata to disable the pass - this change adds the
llvm.licm.disable metadata to enable that.
Differential Revision: https://reviews.llvm.org/D64557
llvm-svn: 368296
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index ce296b9d4dd..4c6c2edc385 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -45,6 +45,7 @@ using namespace llvm::PatternMatch; #define DEBUG_TYPE "loop-utils" static const char *LLVMLoopDisableNonforced = "llvm.loop.disable_nonforced"; +static const char *LLVMLoopDisableLICM = "llvm.licm.disable"; bool llvm::formDedicatedExitBlocks(Loop *L, DominatorTree *DT, LoopInfo *LI, MemorySSAUpdater *MSSAU, @@ -379,6 +380,10 @@ bool llvm::hasDisableAllTransformsHint(const Loop *L) { return getBooleanLoopAttribute(L, LLVMLoopDisableNonforced); } +bool llvm::hasDisableLICMTransformsHint(const Loop *L) { + return getBooleanLoopAttribute(L, LLVMLoopDisableLICM); +} + TransformationMode llvm::hasUnrollTransformation(Loop *L) { if (getBooleanLoopAttribute(L, "llvm.loop.unroll.disable")) return TM_SuppressedByUser; |