aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/Local.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2014-10-21 21:02:19 +0000
committerPhilip Reames <listmail@philipreames.com>2014-10-21 21:02:19 +0000
commitd7c21364a92a035e20d89928e2b0ee60e35e64a7 (patch)
treed76bf6a4bbb7304334ac3319f82e2c774127ae61 /llvm/lib/Transforms/Utils/Local.cpp
parentb2d3f035e2ad90890b80cd45348adf4daec20e19 (diff)
downloadllvm-d7c21364a92a035e20d89928e2b0ee60e35e64a7.zip
llvm-d7c21364a92a035e20d89928e2b0ee60e35e64a7.tar.gz
llvm-d7c21364a92a035e20d89928e2b0ee60e35e64a7.tar.bz2
Teach combineMetadata how to merge 'nonnull' metadata.
combineMetadata is used when merging two instructions into one. This change teaches it how to merge 'nonnull' - i.e. only preserve it on the new instruction if it's set on both sources. This isn't actually used yet since I haven't adjusted any of the call sites to pass in nonnull as a 'known metadata'. llvm-svn: 220325
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/Local.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index ecbe94a..ef54eb2 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -1339,6 +1339,10 @@ void llvm::combineMetadata(Instruction *K, const Instruction *J, ArrayRef<unsign
// Only set the !invariant.load if it is present in both instructions.
K->setMetadata(Kind, JMD);
break;
+ case LLVMContext::MD_nonnull:
+ // Only set the !nonnull if it is present in both instructions.
+ K->setMetadata(Kind, JMD);
+ break;
}
}
}