Skip to content

Commit b32b679

Browse files
committed
Update to use ConstantInt::isNegative()
1 parent 3c5d0c4 commit b32b679

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

llvm/lib/Transforms/IPO/FunctionAttrs.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -633,13 +633,10 @@ ArgumentAccessInfo getArgmentAccessInfo(const Instruction *I,
633633
[](Value *Length,
634634
std::optional<int64_t> Offset) -> std::optional<ConstantRange> {
635635
auto *ConstantLength = dyn_cast<ConstantInt>(Length);
636-
if (ConstantLength && Offset) {
637-
if (ConstantLength->getSExtValue() < 0)
638-
return std::nullopt;
636+
if (ConstantLength && Offset && !ConstantLength->isNegative())
639637
return ConstantRange(
640638
APInt(64, *Offset, true),
641639
APInt(64, *Offset + ConstantLength->getSExtValue(), true));
642-
}
643640
return std::nullopt;
644641
};
645642
if (auto *SI = dyn_cast<StoreInst>(I)) {

0 commit comments

Comments
 (0)