Index: llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp =================================================================== --- llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp +++ llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp @@ -190,13 +190,16 @@ } } -static void annotateNonNullBasedOnAccess(CallInst *CI, +static void annotateNonNullNoUndefBasedOnAccess(CallInst *CI, ArrayRef ArgNos) { Function *F = CI->getCaller(); if (!F) return; for (unsigned ArgNo : ArgNos) { + if (!CI->paramHasAttr(ArgNo, Attribute::NoUndef)) + CI->addParamAttr(ArgNo, Attribute::NoUndef); + if (CI->paramHasAttr(ArgNo, Attribute::NonNull)) continue; unsigned AS = CI->getArgOperand(ArgNo)->getType()->getPointerAddressSpace(); @@ -211,10 +214,10 @@ static void annotateNonNullAndDereferenceable(CallInst *CI, ArrayRef ArgNos, Value *Size, const DataLayout &DL) { if (ConstantInt *LenC = dyn_cast(Size)) { - annotateNonNullBasedOnAccess(CI, ArgNos); + annotateNonNullNoUndefBasedOnAccess(CI, ArgNos); annotateDereferenceableBytes(CI, ArgNos, LenC->getZExtValue()); } else if (isKnownNonZero(Size, DL)) { - annotateNonNullBasedOnAccess(CI, ArgNos); + annotateNonNullNoUndefBasedOnAccess(CI, ArgNos); const APInt *X, *Y; uint64_t DerefMin = 1; if (match(Size, m_Select(m_Value(), m_APInt(X), m_APInt(Y)))) { @@ -232,7 +235,7 @@ // Extract some information from the instruction Value *Dst = CI->getArgOperand(0); Value *Src = CI->getArgOperand(1); - annotateNonNullBasedOnAccess(CI, {0, 1}); + annotateNonNullNoUndefBasedOnAccess(CI, {0, 1}); // See if we can get the length of the input string. uint64_t Len = GetStringLength(Src); @@ -276,9 +279,9 @@ Value *Src = CI->getArgOperand(1); Value *Size = CI->getArgOperand(2); uint64_t Len; - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); if (isKnownNonZero(Size, DL)) - annotateNonNullBasedOnAccess(CI, 1); + annotateNonNullNoUndefBasedOnAccess(CI, 1); // We don't do anything if length is not constant. ConstantInt *LengthArg = dyn_cast(Size); @@ -317,7 +320,7 @@ Function *Callee = CI->getCalledFunction(); FunctionType *FT = Callee->getFunctionType(); Value *SrcStr = CI->getArgOperand(0); - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); // If the second operand is non-constant, see if we can compute the length // of the input string and turn this into memchr. @@ -361,7 +364,7 @@ Value *LibCallSimplifier::optimizeStrRChr(CallInst *CI, IRBuilderBase &B) { Value *SrcStr = CI->getArgOperand(0); ConstantInt *CharC = dyn_cast(CI->getArgOperand(1)); - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); // Cannot fold anything if we're not looking for a constant. if (!CharC) @@ -437,7 +440,7 @@ TLI); } - annotateNonNullBasedOnAccess(CI, {0, 1}); + annotateNonNullNoUndefBasedOnAccess(CI, {0, 1}); return nullptr; } @@ -449,7 +452,7 @@ return ConstantInt::get(CI->getType(), 0); if (isKnownNonZero(Size, DL)) - annotateNonNullBasedOnAccess(CI, {0, 1}); + annotateNonNullNoUndefBasedOnAccess(CI, {0, 1}); // Get the length argument if it is constant. uint64_t Length; if (ConstantInt *LengthArg = dyn_cast(Size)) @@ -527,7 +530,7 @@ if (Dst == Src) // strcpy(x,x) -> x return Src; - annotateNonNullBasedOnAccess(CI, {0, 1}); + annotateNonNullNoUndefBasedOnAccess(CI, {0, 1}); // See if we can get the length of the input string. uint64_t Len = GetStringLength(Src); if (Len) @@ -576,9 +579,9 @@ Value *Dst = CI->getArgOperand(0); Value *Src = CI->getArgOperand(1); Value *Size = CI->getArgOperand(2); - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); if (isKnownNonZero(Size, DL)) - annotateNonNullBasedOnAccess(CI, 1); + annotateNonNullNoUndefBasedOnAccess(CI, 1); uint64_t Len; if (ConstantInt *LengthArg = dyn_cast(Size)) @@ -722,7 +725,7 @@ Value *LibCallSimplifier::optimizeStrLen(CallInst *CI, IRBuilderBase &B) { if (Value *V = optimizeStringLength(CI, B, 8)) return V; - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); return nullptr; } @@ -872,13 +875,13 @@ return StrChr ? B.CreateBitCast(StrChr, CI->getType()) : nullptr; } - annotateNonNullBasedOnAccess(CI, {0, 1}); + annotateNonNullNoUndefBasedOnAccess(CI, {0, 1}); return nullptr; } Value *LibCallSimplifier::optimizeMemRChr(CallInst *CI, IRBuilderBase &B) { if (isKnownNonZero(CI->getOperand(2), DL)) - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); return nullptr; } @@ -2453,7 +2456,7 @@ return New; } - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); return nullptr; } @@ -2575,7 +2578,7 @@ return New; } - annotateNonNullBasedOnAccess(CI, {0, 1}); + annotateNonNullNoUndefBasedOnAccess(CI, {0, 1}); return nullptr; } @@ -2664,7 +2667,7 @@ } if (isKnownNonZero(CI->getOperand(1), DL)) - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); return nullptr; } @@ -2807,7 +2810,7 @@ } Value *LibCallSimplifier::optimizePuts(CallInst *CI, IRBuilderBase &B) { - annotateNonNullBasedOnAccess(CI, 0); + annotateNonNullNoUndefBasedOnAccess(CI, 0); if (!CI->use_empty()) return nullptr; Index: llvm/test/Transforms/InstCombine/memcpy_chk-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/memcpy_chk-1.ll +++ llvm/test/Transforms/InstCombine/memcpy_chk-1.ll @@ -18,7 +18,7 @@ define i8* @test_simplify1() { ; CHECK-LABEL: @test_simplify1( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(1824) bitcast (%struct.T1* @t1 to i8*), i8* nonnull align 4 dereferenceable(1824) bitcast (%struct.T2* @t2 to i8*), i64 1824, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* noundef nonnull align 4 dereferenceable(1824) bitcast (%struct.T1* @t1 to i8*), i8* noundef nonnull align 4 dereferenceable(1824) bitcast (%struct.T2* @t2 to i8*), i64 1824, i1 false) ; CHECK-NEXT: ret i8* bitcast (%struct.T1* @t1 to i8*) ; %dst = bitcast %struct.T1* @t1 to i8* @@ -29,7 +29,7 @@ define i8* @test_simplify2() { ; CHECK-LABEL: @test_simplify2( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 4 dereferenceable(1824) bitcast (%struct.T1* @t1 to i8*), i8* nonnull align 4 dereferenceable(1824) bitcast (%struct.T3* @t3 to i8*), i64 1824, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* noundef nonnull align 4 dereferenceable(1824) bitcast (%struct.T1* @t1 to i8*), i8* noundef nonnull align 4 dereferenceable(1824) bitcast (%struct.T3* @t3 to i8*), i64 1824, i1 false) ; CHECK-NEXT: ret i8* bitcast (%struct.T1* @t1 to i8*) ; %dst = bitcast %struct.T1* @t1 to i8* @@ -65,7 +65,7 @@ define i8* @test_simplify_return_indcall(i8* ()* %alloc) { ; CHECK-LABEL: @test_simplify_return_indcall( ; CHECK-NEXT: [[DST:%.*]] = call i8* [[ALLOC:%.*]]() -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 dereferenceable(1824) [[DST]], i8* nonnull align 4 dereferenceable(1824) bitcast (%struct.T2* @t2 to i8*), i64 1824, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(1824) [[DST]], i8* noundef nonnull align 4 dereferenceable(1824) bitcast (%struct.T2* @t2 to i8*), i64 1824, i1 false) ; CHECK-NEXT: ret i8* [[DST]] ; %src = bitcast %struct.T2* @t2 to i8* Index: llvm/test/Transforms/InstCombine/mempcpy.ll =================================================================== --- llvm/test/Transforms/InstCombine/mempcpy.ll +++ llvm/test/Transforms/InstCombine/mempcpy.ll @@ -45,7 +45,7 @@ define i8* @memcpy_big_const_n(i8* %d, i8* nocapture readonly %s) { ; CHECK-LABEL: @memcpy_big_const_n( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* nonnull align 1 dereferenceable(1024) [[D:%.*]], i8* nonnull align 1 dereferenceable(1024) [[S:%.*]], i64 1024, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i64(i8* noundef nonnull align 1 dereferenceable(1024) [[D:%.*]], i8* noundef nonnull align 1 dereferenceable(1024) [[S:%.*]], i64 1024, i1 false) ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds i8, i8* [[D]], i64 1024 ; CHECK-NEXT: ret i8* [[TMP1]] ; Index: llvm/test/Transforms/InstCombine/snprintf.ll =================================================================== --- llvm/test/Transforms/InstCombine/snprintf.ll +++ llvm/test/Transforms/InstCombine/snprintf.ll @@ -10,7 +10,7 @@ define void @test_not_const_fmt(i8* %buf, i8* %fmt) #0 { ; CHECK-LABEL: @test_not_const_fmt( -; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* nonnull dereferenceable(1) [[BUF:%.*]], i64 32, i8* [[FMT:%.*]]) +; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* noundef nonnull dereferenceable(1) [[BUF:%.*]], i64 32, i8* [[FMT:%.*]]) ; CHECK-NEXT: ret void ; %call = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %buf, i64 32, i8* %fmt) #2 @@ -47,7 +47,7 @@ define void @test_percentage(i8* %buf) #0 { ; CHECK-LABEL: @test_percentage( -; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* nonnull dereferenceable(1) [[BUF:%.*]], i64 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)) +; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* noundef nonnull dereferenceable(1) [[BUF:%.*]], i64 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)) ; CHECK-NEXT: ret void ; %call = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %buf, i64 32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)) #2 @@ -92,7 +92,7 @@ define i32 @test_char_wrong_size(i8* %buf) #0 { ; CHECK-LABEL: @test_char_wrong_size( -; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* nonnull dereferenceable(1) [[BUF:%.*]], i64 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 65) +; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* noundef nonnull dereferenceable(1) [[BUF:%.*]], i64 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 65) ; CHECK-NEXT: ret i32 [[CALL]] ; %call = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %buf, i64 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 65) #2 @@ -120,7 +120,7 @@ define i32 @test_str_wrong_size(i8* %buf) #0 { ; CHECK-LABEL: @test_str_wrong_size( -; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* nonnull dereferenceable(1) [[BUF:%.*]], i64 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)) +; CHECK-NEXT: [[CALL:%.*]] = call i32 (i8*, i64, i8*, ...) @snprintf(i8* noundef nonnull dereferenceable(1) [[BUF:%.*]], i64 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)) ; CHECK-NEXT: ret i32 [[CALL]] ; %call = call i32 (i8*, i64, i8*, ...) @snprintf(i8* %buf, i64 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0)) #2 Index: llvm/test/Transforms/InstCombine/sprintf-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/sprintf-1.ll +++ llvm/test/Transforms/InstCombine/sprintf-1.ll @@ -22,7 +22,7 @@ define void @test_simplify1(i8* %dst) { ; CHECK-LABEL: @test_simplify1( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(13) [[DST:%.*]], i8* nonnull align 1 dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 13, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(13) [[DST:%.*]], i8* noundef nonnull align 1 dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 13, i1 false) ; CHECK-NEXT: ret void ; %fmt = getelementptr [13 x i8], [13 x i8]* @hello_world, i32 0, i32 0 @@ -68,7 +68,7 @@ define void @test_simplify5(i8* %dst, i8* %str) { ; CHECK-LABEL: @test_simplify5( -; CHECK-NEXT: [[STRCPY:%.*]] = call i8* @strcpy(i8* nonnull dereferenceable(1) [[DST:%.*]], i8* nonnull dereferenceable(1) [[STR:%.*]]) +; CHECK-NEXT: [[STRCPY:%.*]] = call i8* @strcpy(i8* noundef nonnull dereferenceable(1) [[DST:%.*]], i8* noundef nonnull dereferenceable(1) [[STR:%.*]]) ; CHECK-NEXT: ret void ; %fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0 @@ -84,7 +84,7 @@ ; CHECK-IPRINTF-NEXT: ret void ; ; WIN-LABEL: @test_simplify6( -; WIN-NEXT: [[TMP1:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull dereferenceable(1) [[DST:%.*]], i8* nonnull dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187) +; WIN-NEXT: [[TMP1:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* noundef nonnull dereferenceable(1) [[DST:%.*]], i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @percent_d, i32 0, i32 0), i32 187) ; WIN-NEXT: ret void ; %fmt = getelementptr [3 x i8], [3 x i8]* @percent_d, i32 0, i32 0 @@ -103,7 +103,7 @@ ; CHECK-IPRINTF-NEXT: ret i32 [[TMP3]] ; ; WIN-LABEL: @test_simplify7( -; WIN-NEXT: [[STRLEN:%.*]] = call i32 @strlen(i8* nonnull dereferenceable(1) [[STR:%.*]]) +; WIN-NEXT: [[STRLEN:%.*]] = call i32 @strlen(i8* noundef nonnull dereferenceable(1) [[STR:%.*]]) ; WIN-NEXT: [[LENINC:%.*]] = add i32 [[STRLEN]], 1 ; WIN-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 [[DST:%.*]], i8* align 1 [[STR]], i32 [[LENINC]], i1 false) ; WIN-NEXT: ret i32 [[STRLEN]] @@ -116,7 +116,7 @@ ; Check sprintf(dst, "%s", str) -> llvm.memcpy(dest, str, strlen(str) + 1, 1). define i32 @test_simplify8(i8* %dst) { ; CHECK-LABEL: @test_simplify8( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(13) [[DST:%.*]], i8* nonnull align 1 dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 13, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(13) [[DST:%.*]], i8* noundef nonnull align 1 dereferenceable(13) getelementptr inbounds ([13 x i8], [13 x i8]* @hello_world, i32 0, i32 0), i32 13, i1 false) ; CHECK-NEXT: ret i32 12 ; %fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0 @@ -136,7 +136,7 @@ ; CHECK-IPRINTF-NEXT: ret i32 [[TMP3]] ; ; WIN-LABEL: @test_simplify9( -; WIN-NEXT: [[STRLEN:%.*]] = call i32 @strlen(i8* nonnull dereferenceable(1) [[STR:%.*]]) +; WIN-NEXT: [[STRLEN:%.*]] = call i32 @strlen(i8* noundef nonnull dereferenceable(1) [[STR:%.*]]) ; WIN-NEXT: [[LENINC:%.*]] = add i32 [[STRLEN]], 1 ; WIN-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 [[DST:%.*]], i8* align 1 [[STR]], i32 [[LENINC]], i1 false) ; WIN-NEXT: ret i32 [[STRLEN]] @@ -148,7 +148,7 @@ define void @test_no_simplify1(i8* %dst) { ; CHECK-LABEL: @test_no_simplify1( -; CHECK-NEXT: [[TMP1:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull dereferenceable(1) [[DST:%.*]], i8* nonnull dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) +; CHECK-NEXT: [[TMP1:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* noundef nonnull dereferenceable(1) [[DST:%.*]], i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @percent_f, i32 0, i32 0), double 1.870000e+00) ; CHECK-NEXT: ret void ; %fmt = getelementptr [3 x i8], [3 x i8]* @percent_f, i32 0, i32 0 @@ -158,7 +158,7 @@ define void @test_no_simplify2(i8* %dst, i8* %fmt, double %d) { ; CHECK-LABEL: @test_no_simplify2( -; CHECK-NEXT: [[TMP1:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull dereferenceable(1) [[DST:%.*]], i8* nonnull dereferenceable(1) [[FMT:%.*]], double [[D:%.*]]) +; CHECK-NEXT: [[TMP1:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* noundef nonnull dereferenceable(1) [[DST:%.*]], i8* noundef nonnull dereferenceable(1) [[FMT:%.*]], double [[D:%.*]]) ; CHECK-NEXT: ret void ; call i32 (i8*, i8*, ...) @sprintf(i8* %dst, i8* %fmt, double %d) @@ -174,7 +174,7 @@ ; CHECK-IPRINTF-NEXT: ret i32 [[TMP3]] ; ; WIN-LABEL: @test_no_simplify3( -; WIN-NEXT: [[R:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* nonnull dereferenceable(1) [[DST:%.*]], i8* nonnull dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @percent_s, i32 0, i32 0), i8* [[STR:%.*]]) +; WIN-NEXT: [[R:%.*]] = call i32 (i8*, i8*, ...) @sprintf(i8* noundef nonnull dereferenceable(1) [[DST:%.*]], i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @percent_s, i32 0, i32 0), i8* [[STR:%.*]]) ; WIN-NEXT: ret i32 [[R]] ; %fmt = getelementptr [3 x i8], [3 x i8]* @percent_s, i32 0, i32 0 Index: llvm/test/Transforms/InstCombine/stpcpy-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/stpcpy-1.ll +++ llvm/test/Transforms/InstCombine/stpcpy-1.ll @@ -14,7 +14,7 @@ define i8* @test_simplify1() { ; CHECK-LABEL: @test_simplify1( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) ; CHECK-NEXT: ret i8* getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 5) ; @@ -27,7 +27,7 @@ define i8* @test_simplify2() { ; CHECK-LABEL: @test_simplify2( -; CHECK-NEXT: [[STRLEN:%.*]] = call i32 @strlen(i8* nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0)) +; CHECK-NEXT: [[STRLEN:%.*]] = call i32 @strlen(i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0)) ; CHECK-NEXT: [[TMP1:%.*]] = getelementptr inbounds [32 x i8], [32 x i8]* @a, i32 0, i32 [[STRLEN]] ; CHECK-NEXT: ret i8* [[TMP1]] ; @@ -40,7 +40,7 @@ define void @test_simplify3(i8* %dst) { ; CHECK-LABEL: @test_simplify3( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(80) [[DST:%.*]], i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(80) [[DST:%.*]], i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) ; CHECK-NEXT: ret void ; Index: llvm/test/Transforms/InstCombine/strcpy-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/strcpy-1.ll +++ llvm/test/Transforms/InstCombine/strcpy-1.ll @@ -15,7 +15,7 @@ define void @test_simplify1() { ; CHECK-LABEL: @test_simplify1( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) ; CHECK-NEXT: ret void ; @@ -40,7 +40,7 @@ define void @test_simplify3(i8* %dst) { ; CHECK-LABEL: @test_simplify3( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(80) [[DST:%.*]], i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(80) [[DST:%.*]], i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) ; CHECK-NEXT: ret void ; @@ -52,7 +52,7 @@ define i8* @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( -; CHECK-NEXT: [[RET:%.*]] = call i8* @strcpy(i8* nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @b, i32 0, i32 0)) +; CHECK-NEXT: [[RET:%.*]] = call i8* @strcpy(i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @b, i32 0, i32 0)) ; CHECK-NEXT: ret i8* [[RET]] ; Index: llvm/test/Transforms/InstCombine/strlen-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/strlen-1.ll +++ llvm/test/Transforms/InstCombine/strlen-1.ll @@ -141,7 +141,7 @@ define i32 @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( -; CHECK-NEXT: [[A_L:%.*]] = call i32 @strlen(i8* nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0)) +; CHECK-NEXT: [[A_L:%.*]] = call i32 @strlen(i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0)) ; CHECK-NEXT: ret i32 [[A_L]] ; %a_p = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 @@ -154,7 +154,7 @@ define i32 @test_no_simplify2(i32 %x) { ; CHECK-LABEL: @test_no_simplify2( ; CHECK-NEXT: [[HELLO_P:%.*]] = getelementptr inbounds [7 x i8], [7 x i8]* @null_hello, i32 0, i32 [[X:%.*]] -; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* nonnull [[HELLO_P]]) +; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* noundef nonnull [[HELLO_P]]) ; CHECK-NEXT: ret i32 [[HELLO_L]] ; %hello_p = getelementptr inbounds [7 x i8], [7 x i8]* @null_hello, i32 0, i32 %x @@ -165,7 +165,7 @@ define i32 @test_no_simplify2_no_null_opt(i32 %x) #0 { ; CHECK-LABEL: @test_no_simplify2_no_null_opt( ; CHECK-NEXT: [[HELLO_P:%.*]] = getelementptr inbounds [7 x i8], [7 x i8]* @null_hello, i32 0, i32 [[X:%.*]] -; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* [[HELLO_P]]) +; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* noundef [[HELLO_P]]) ; CHECK-NEXT: ret i32 [[HELLO_L]] ; %hello_p = getelementptr inbounds [7 x i8], [7 x i8]* @null_hello, i32 0, i32 %x @@ -179,7 +179,7 @@ ; CHECK-LABEL: @test_no_simplify3( ; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 15 ; CHECK-NEXT: [[HELLO_P:%.*]] = getelementptr inbounds [13 x i8], [13 x i8]* @null_hello_mid, i32 0, i32 [[AND]] -; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* nonnull [[HELLO_P]]) +; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* noundef nonnull [[HELLO_P]]) ; CHECK-NEXT: ret i32 [[HELLO_L]] ; %and = and i32 %x, 15 @@ -192,7 +192,7 @@ ; CHECK-LABEL: @test_no_simplify3_on_null_opt( ; CHECK-NEXT: [[AND:%.*]] = and i32 [[X:%.*]], 15 ; CHECK-NEXT: [[HELLO_P:%.*]] = getelementptr inbounds [13 x i8], [13 x i8]* @null_hello_mid, i32 0, i32 [[AND]] -; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* [[HELLO_P]]) +; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* noundef [[HELLO_P]]) ; CHECK-NEXT: ret i32 [[HELLO_L]] ; %and = and i32 %x, 15 @@ -203,7 +203,7 @@ define i32 @test1(i8* %str) { ; CHECK-LABEL: @test1( -; CHECK-NEXT: [[LEN:%.*]] = tail call i32 @strlen(i8* nonnull dereferenceable(1) [[STR:%.*]]) #1 +; CHECK-NEXT: [[LEN:%.*]] = tail call i32 @strlen(i8* noundef nonnull dereferenceable(1) [[STR:%.*]]) [[ATTR1:#.*]] ; CHECK-NEXT: ret i32 [[LEN]] ; %len = tail call i32 @strlen(i8* %str) nounwind @@ -212,7 +212,7 @@ define i32 @test2(i8* %str) #0 { ; CHECK-LABEL: @test2( -; CHECK-NEXT: [[LEN:%.*]] = tail call i32 @strlen(i8* [[STR:%.*]]) #1 +; CHECK-NEXT: [[LEN:%.*]] = tail call i32 @strlen(i8* noundef [[STR:%.*]]) [[ATTR1]] ; CHECK-NEXT: ret i32 [[LEN]] ; %len = tail call i32 @strlen(i8* %str) nounwind Index: llvm/test/Transforms/InstCombine/strlen-2.ll =================================================================== --- llvm/test/Transforms/InstCombine/strlen-2.ll +++ llvm/test/Transforms/InstCombine/strlen-2.ll @@ -1,3 +1,4 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py ; Test that the strlen library call simplifier works correctly. ; ; RUN: opt < %s -instcombine -S | FileCheck %s @@ -10,9 +11,10 @@ define i32 @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( +; CHECK-NEXT: [[HELLO_L:%.*]] = call i32 @strlen(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 187) +; CHECK-NEXT: ret i32 [[HELLO_L]] +; %hello_p = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 %hello_l = call i32 @strlen(i8* %hello_p, i32 187) -; CHECK-NEXT: %hello_l = call i32 @strlen ret i32 %hello_l -; CHECK-NEXT: ret i32 %hello_l } Index: llvm/test/Transforms/InstCombine/strncmp-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/strncmp-1.ll +++ llvm/test/Transforms/InstCombine/strncmp-1.ll @@ -131,7 +131,7 @@ ; strncmp(x, y, 5) -> strncmp(nonnull x, nonnull y, 5) define i32 @test11(i8* %str1, i8* %str2, i32 %n) { ; CHECK-LABEL: @test11( -; CHECK-NEXT: [[TEMP1:%.*]] = call i32 @strncmp(i8* nonnull dereferenceable(1) [[STR1:%.*]], i8* nonnull dereferenceable(1) [[STR2:%.*]], i32 5) +; CHECK-NEXT: [[TEMP1:%.*]] = call i32 @strncmp(i8* noundef nonnull dereferenceable(1) [[STR1:%.*]], i8* noundef nonnull dereferenceable(1) [[STR2:%.*]], i32 5) ; CHECK-NEXT: ret i32 [[TEMP1]] ; Index: llvm/test/Transforms/InstCombine/strncpy-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/strncpy-1.ll +++ llvm/test/Transforms/InstCombine/strncpy-1.ll @@ -21,10 +21,10 @@ ; CHECK-NEXT: [[TARGET:%.*]] = alloca [1024 x i8], align 1 ; CHECK-NEXT: [[ARG1:%.*]] = getelementptr inbounds [1024 x i8], [1024 x i8]* [[TARGET]], i32 0, i32 0 ; CHECK-NEXT: store i8 0, i8* [[ARG1]], align 1 -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(6) [[ARG1]], i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) -; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* nonnull align 1 dereferenceable(42) [[ARG1]], i8 0, i32 42, i1 false) -; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* nonnull align 1 dereferenceable(42) [[ARG1]], i8 0, i32 42, i1 false) -; CHECK-NEXT: [[TMP1:%.*]] = call i32 @puts(i8* nonnull [[ARG1]]) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(6) [[ARG1]], i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) +; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(42) [[ARG1]], i8 0, i32 42, i1 false) +; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(42) [[ARG1]], i8 0, i32 42, i1 false) +; CHECK-NEXT: [[TMP1:%.*]] = call i32 @puts(i8* noundef nonnull [[ARG1]]) ; CHECK-NEXT: ret i32 0 ; %target = alloca [1024 x i8] @@ -48,7 +48,7 @@ define void @test_simplify2() { ; CHECK-LABEL: @test_simplify2( -; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* nonnull align 1 dereferenceable(32) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8 0, i32 32, i1 false) +; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(32) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8 0, i32 32, i1 false) ; CHECK-NEXT: ret void ; %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 @@ -75,7 +75,7 @@ define void @test_simplify4() { ; CHECK-LABEL: @test_simplify4( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 6, i1 false) ; CHECK-NEXT: ret void ; %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 @@ -87,7 +87,7 @@ define void @test_simplify5(i8* %dst) { ; CHECK-LABEL: @test_simplify5( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(32) [[DST:%.*]], i8* nonnull align 1 dereferenceable(32) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i32 0, i32 0), i32 32, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(32) [[DST:%.*]], i8* noundef nonnull align 1 dereferenceable(32) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i32 0, i32 0), i32 32, i1 false) ; CHECK-NEXT: ret void ; %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 @@ -97,7 +97,7 @@ define void @test_simplify6(i8* %dst) { ; CHECK-LABEL: @test_simplify6( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(80) [[DST:%.*]], i8* nonnull align 1 dereferenceable(32) getelementptr inbounds ([33 x i8], [33 x i8]* @str.1, i32 0, i32 0), i32 32, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(80) [[DST:%.*]], i8* noundef nonnull align 1 dereferenceable(32) getelementptr inbounds ([33 x i8], [33 x i8]* @str.1, i32 0, i32 0), i32 32, i1 false) ; CHECK-NEXT: ret void ; %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 @@ -107,7 +107,7 @@ define void @test_simplify7(i8* %dst, i32 %n) { ; CHECK-LABEL: @test_simplify7( -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @strncpy(i8* nonnull dereferenceable(80) [[DST:%.*]], i8* getelementptr inbounds ([1 x i8], [1 x i8]* @null, i32 0, i32 0), i32 [[N:%.*]]) +; CHECK-NEXT: [[TMP1:%.*]] = call i8* @strncpy(i8* noundef nonnull dereferenceable(80) [[DST:%.*]], i8* getelementptr inbounds ([1 x i8], [1 x i8]* @null, i32 0, i32 0), i32 [[N:%.*]]) ; CHECK-NEXT: ret void ; %src = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 @@ -117,7 +117,7 @@ define i8* @test1(i8* %dst, i8* %src, i32 %n) { ; CHECK-LABEL: @test1( -; CHECK-NEXT: [[RET:%.*]] = call i8* @strncpy(i8* nonnull [[DST:%.*]], i8* nonnull [[SRC:%.*]], i32 [[N:%.*]]) +; CHECK-NEXT: [[RET:%.*]] = call i8* @strncpy(i8* noundef nonnull [[DST:%.*]], i8* nonnull [[SRC:%.*]], i32 [[N:%.*]]) ; CHECK-NEXT: ret i8* [[RET]] ; %ret = call i8* @strncpy(i8* nonnull %dst, i8* nonnull %src, i32 %n) @@ -126,7 +126,7 @@ define i8* @test2(i8* %dst) { ; CHECK-LABEL: @test2( -; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* nonnull align 1 dereferenceable(5) [[DST:%.*]], i8* nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 5, i1 false) +; CHECK-NEXT: call void @llvm.memcpy.p0i8.p0i8.i32(i8* noundef nonnull align 1 dereferenceable(5) [[DST:%.*]], i8* noundef nonnull align 1 dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @hello, i32 0, i32 0), i32 5, i1 false) ; CHECK-NEXT: ret i8* [[DST]] ; %src = getelementptr [6 x i8], [6 x i8]* @hello, i32 0, i32 0 @@ -136,7 +136,7 @@ define i8* @test3(i8* %dst, i32 %n) { ; CHECK-LABEL: @test3( -; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* noalias nonnull align 1 dereferenceable(5) [[DST:%.*]], i8 0, i32 5, i1 false) +; CHECK-NEXT: call void @llvm.memset.p0i8.i32(i8* noalias noundef nonnull align 1 dereferenceable(5) [[DST:%.*]], i8 0, i32 5, i1 false) ; CHECK-NEXT: ret i8* [[DST]] ; %src = getelementptr [1 x i8], [1 x i8]* @null, i32 0, i32 0 @@ -148,7 +148,7 @@ define void @test_no_simplify1() { ; CHECK-LABEL: @test_no_simplify1( -; CHECK-NEXT: [[TMP1:%.*]] = call i8* @strncpy(i8* nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @b, i32 0, i32 0), i32 32) +; CHECK-NEXT: [[TMP1:%.*]] = call i8* @strncpy(i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @a, i32 0, i32 0), i8* noundef nonnull dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @b, i32 0, i32 0), i32 32) ; CHECK-NEXT: ret void ; %dst = getelementptr [32 x i8], [32 x i8]* @a, i32 0, i32 0 Index: llvm/test/Transforms/InstCombine/strstr-1.ll =================================================================== --- llvm/test/Transforms/InstCombine/strstr-1.ll +++ llvm/test/Transforms/InstCombine/strstr-1.ll @@ -27,7 +27,7 @@ define i8* @test_simplify2(i8* %str) { ; CHECK-LABEL: @test_simplify2( -; CHECK-NEXT: [[STRCHR:%.*]] = call i8* @strchr(i8* nonnull dereferenceable(1) [[STR:%.*]], i32 97) +; CHECK-NEXT: [[STRCHR:%.*]] = call i8* @strchr(i8* noundef nonnull dereferenceable(1) [[STR:%.*]], i32 97) ; CHECK-NEXT: ret i8* [[STRCHR]] ; %pat = getelementptr inbounds [2 x i8], [2 x i8]* @.str1, i32 0, i32 0 @@ -61,7 +61,7 @@ define i1 @test_simplify5(i8* %str, i8* %pat) { ; CHECK-LABEL: @test_simplify5( -; CHECK-NEXT: [[STRLEN:%.*]] = call i64 @strlen(i8* nonnull dereferenceable(1) [[PAT:%.*]]) +; CHECK-NEXT: [[STRLEN:%.*]] = call i64 @strlen(i8* noundef nonnull dereferenceable(1) [[PAT:%.*]]) ; CHECK-NEXT: [[STRNCMP:%.*]] = call i32 @strncmp(i8* [[STR:%.*]], i8* [[PAT]], i64 [[STRLEN]]) ; CHECK-NEXT: [[CMP1:%.*]] = icmp eq i32 [[STRNCMP]], 0 ; CHECK-NEXT: ret i1 [[CMP1]] @@ -73,7 +73,7 @@ define i8* @test1(i8* %str1, i8* %str2) { ; CHECK-LABEL: @test1( -; CHECK-NEXT: [[RET:%.*]] = call i8* @strstr(i8* nonnull dereferenceable(1) [[STR1:%.*]], i8* nonnull dereferenceable(1) [[STR2:%.*]]) +; CHECK-NEXT: [[RET:%.*]] = call i8* @strstr(i8* noundef nonnull dereferenceable(1) [[STR1:%.*]], i8* noundef nonnull dereferenceable(1) [[STR2:%.*]]) ; CHECK-NEXT: ret i8* [[RET]] ; %ret = call i8* @strstr(i8* %str1, i8* %str2) @@ -82,7 +82,7 @@ define i8* @test2(i8* %str1, i8* %str2) null_pointer_is_valid { ; CHECK-LABEL: @test2( -; CHECK-NEXT: [[RET:%.*]] = call i8* @strstr(i8* [[STR1:%.*]], i8* [[STR2:%.*]]) +; CHECK-NEXT: [[RET:%.*]] = call i8* @strstr(i8* noundef [[STR1:%.*]], i8* noundef [[STR2:%.*]]) ; CHECK-NEXT: ret i8* [[RET]] ; %ret = call i8* @strstr(i8* %str1, i8* %str2)