[llvm] [LVI] Remove unused get of Range metadata. (PR #94914)

Andreas Jonson via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 9 13:48:15 PDT 2024


https://github.com/andjo403 created https://github.com/llvm/llvm-project/pull/94914

There is no test for this code and it also do not change the result of https://github.com/dtcxzyw/llvm-opt-benchmark when I run it locally. 
I have not been able to make a test for this and do not know how to handle the range attribute for this so maybe it shall be removed?

CC @nikic 

>From aec8af2e2d7963058b08e8fecf0a5a1aeea9a2b4 Mon Sep 17 00:00:00 2001
From: Andreas Jonson <andjo403 at hotmail.com>
Date: Sun, 9 Jun 2024 22:11:23 +0200
Subject: [PATCH] [LVI] Remove unused get of Range metadata.

---
 llvm/lib/Analysis/LazyValueInfo.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 6cded828c25f4..8b6e56ce8113d 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -1116,9 +1116,6 @@ LazyValueInfoImpl::getValueFromSimpleICmpCondition(CmpInst::Predicate Pred,
     if (!R)
       return std::nullopt;
     RHSRange = toConstantRange(*R, RHS->getType());
-  } else if (Instruction *I = dyn_cast<Instruction>(RHS)) {
-    if (auto *Ranges = I->getMetadata(LLVMContext::MD_range))
-      RHSRange = getConstantRangeFromMetadata(*Ranges);
   }
 
   ConstantRange TrueValues =



More information about the llvm-commits mailing list