Skip to content

Commit 0c2b6a0

Browse files
committed
[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.
1 parent 06c4f78 commit 0c2b6a0

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

llvm/lib/Analysis/LazyValueInfo.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -903,19 +903,13 @@ LazyValueInfoImpl::getRangeFor(Value *V, Instruction *CxtI, BasicBlock *BB) {
903903

904904
std::optional<ValueLatticeElement>
905905
LazyValueInfoImpl::solveBlockValueCast(CastInst *CI, BasicBlock *BB) {
906-
// Without knowing how wide the input is, we can't analyze it in any useful
907-
// way.
908-
if (!CI->getOperand(0)->getType()->isSized())
909-
return ValueLatticeElement::getOverdefined();
910-
911906
// Filter out casts we don't know how to reason about before attempting to
912907
// recurse on our operand. This can cut a long search short if we know we're
913908
// not going to be able to get any useful information anways.
914909
switch (CI->getOpcode()) {
915910
case Instruction::Trunc:
916911
case Instruction::SExt:
917912
case Instruction::ZExt:
918-
case Instruction::BitCast:
919913
break;
920914
default:
921915
// Unhandled instructions are overdefined.

0 commit comments

Comments
 (0)