================
@@ -461,22 +461,23 @@ static Value *GEPToVectorIndex(GetElementPtrInst *GEP,
AllocaInst *Alloca,
return nullptr;
Value *Offset = VarOffset.first;
- auto *OffsetType = dyn_cast<IntegerType>(Offset->getType());
- if (!OffsetType)
+ if (!isa<IntegerType>(Offset->getType()))
return nullptr;
+ Offset = Builder.CreateSExtOrTrunc(Offset, Builder.getIntNTy(BW));
----------------
ritter-x2a wrote:
This patch changed it to signed:
https://github.com/llvm/llvm-project/pull/157682
Before that, the unsigned treatment caused a bug:
https://github.com/llvm/llvm-project/pull/155415#issuecomment-3244625707
GEPs with negative 32-bit indices were promoted into broken 64-bit
extract-element indices.
https://github.com/llvm/llvm-project/pull/170511
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits