[llvm] 0c2b6a0 - [LVI] Drop bitcast handling (NFCI)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 12 04:09:58 PST 2023
Author: Nikita Popov
Date: 2023-12-12T13:09:51+01:00
New Revision: 0c2b6a022595c55ba3d091e3014b5d3b0e213259
URL: https://github.com/llvm/llvm-project/commit/0c2b6a022595c55ba3d091e3014b5d3b0e213259
DIFF: https://github.com/llvm/llvm-project/commit/0c2b6a022595c55ba3d091e3014b5d3b0e213259.diff
LOG: [LVI] Drop bitcast handling (NFCI)
The code only works on integer casts, and the only bitcasts
involving integers are trivial. The code as previously written
would try to handle things like float to integer bitcasts by
fetching a ConstantRange of a float value, which is an ill-defined
operation.
Added:
Modified:
llvm/lib/Analysis/LazyValueInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/LazyValueInfo.cpp b/llvm/lib/Analysis/LazyValueInfo.cpp
index 45f7f049ceb9f0..ec870694f5b60a 100644
--- a/llvm/lib/Analysis/LazyValueInfo.cpp
+++ b/llvm/lib/Analysis/LazyValueInfo.cpp
@@ -903,11 +903,6 @@ LazyValueInfoImpl::getRangeFor(Value *V, Instruction *CxtI, BasicBlock *BB) {
std::optional<ValueLatticeElement>
LazyValueInfoImpl::solveBlockValueCast(CastInst *CI, BasicBlock *BB) {
- // Without knowing how wide the input is, we can't analyze it in any useful
- // way.
- if (!CI->getOperand(0)->getType()->isSized())
- return ValueLatticeElement::getOverdefined();
-
// Filter out casts we don't know how to reason about before attempting to
// recurse on our operand. This can cut a long search short if we know we're
// not going to be able to get any useful information anways.
@@ -915,7 +910,6 @@ LazyValueInfoImpl::solveBlockValueCast(CastInst *CI, BasicBlock *BB) {
case Instruction::Trunc:
case Instruction::SExt:
case Instruction::ZExt:
- case Instruction::BitCast:
break;
default:
// Unhandled instructions are overdefined.
More information about the llvm-commits
mailing list