[PATCH] D13543: [LVI/CVP] Teach LVI about range metadata

Sanjoy Das via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 13:07:07 PDT 2015


sanjoy added a comment.

Minor inline comment inline.  I don't really know LVI, so I'll have to read some code before I can review this properly.


================
Comment at: lib/Analysis/LazyValueInfo.cpp:507
@@ +506,3 @@
+  case Instruction::Invoke:
+    if (MDNode *Ranges = BBI->getMetadata(LLVMContext::MD_range))
+      if (auto *IType = dyn_cast<IntegerType>(BBI->getType())) {
----------------
I've seen this logic repeated in several places now.  I think it's time to refactor out a `ConstantRange getRangeFromMetadata()` helper function.

However, I think its fine to check this in as is, and then extract out the helper.


http://reviews.llvm.org/D13543





More information about the llvm-commits mailing list