diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -1123,7 +1123,7 @@ assert(FTy->isFloatingPointTy() && "Expected floating point type!"); Type *IntTy = IntegerType::get(FTy->getContext(), FTy->getScalarSizeInBits()); Value *RuntimeVF = getRuntimeVF(B, IntTy, VF); - return B.CreateSIToFP(RuntimeVF, FTy); + return B.CreateUIToFP(RuntimeVF, FTy); } void reportVectorizationFailure(const StringRef DebugMsg, diff --git a/llvm/test/Transforms/LoopVectorize/scalable-inductions.ll b/llvm/test/Transforms/LoopVectorize/scalable-inductions.ll --- a/llvm/test/Transforms/LoopVectorize/scalable-inductions.ll +++ b/llvm/test/Transforms/LoopVectorize/scalable-inductions.ll @@ -146,7 +146,7 @@ ; CHECK-NEXT: %[[INDINIT:.*]] = fadd %[[TMP2]], shufflevector ( insertelement ( poison, float 0.000000e+00, i32 0), poison, zeroinitializer) ; CHECK-NEXT: %[[VSCALE:.*]] = call i32 @llvm.vscale.i32() ; CHECK-NEXT: %[[TMP3:.*]] = shl i32 %8, 2 -; CHECK-NEXT: %[[TMP4:.*]] = sitofp i32 %[[TMP3]] to float +; CHECK-NEXT: %[[TMP4:.*]] = uitofp i32 %[[TMP3]] to float ; CHECK-NEXT: %[[INC:.*]] = fmul float %[[TMP4]], 2.000000e+00 ; CHECK-NEXT: %[[TMP5:.*]] = insertelement poison, float %[[INC]], i32 0 ; CHECK-NEXT: %[[VECINC:.*]] = shufflevector %[[TMP5]], poison, zeroinitializer