diff --git a/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/llvm/lib/Analysis/StackSafetyAnalysis.cpp --- a/llvm/lib/Analysis/StackSafetyAnalysis.cpp +++ b/llvm/lib/Analysis/StackSafetyAnalysis.cpp @@ -397,7 +397,10 @@ for (Argument &A : make_range(F.arg_begin(), F.arg_end())) { Info.Params.emplace_back(PointerSize); UseInfo &PS = Info.Params.back(); - analyzeAllUses(&A, PS); + if (A.getType()->isPointerTy()) + analyzeAllUses(&A, PS); + else + PS.updateRange(UnknownRange); } LLVM_DEBUG(Info.print(dbgs(), F.getName(), &F)); @@ -415,7 +418,6 @@ DenseMap> Callers; SetVector WorkList; - bool updateOneUse(UseInfo &US, bool UpdateToFullSet); void updateOneNode(const GlobalValue *Callee, FunctionInfo &FS); void updateOneNode(const GlobalValue *Callee) { diff --git a/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll b/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll --- a/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/ipa.ll @@ -317,7 +317,7 @@ ; CHECK-NEXT: args uses: ; LOCAL-NEXT: p[]: empty-set, @RecursiveNoOffset(arg0, [0,1)){{$}} ; GLOBAL-NEXT: p[]: full-set, @RecursiveNoOffset(arg0, [0,1)){{$}} -; CHECK-NEXT: size[]: empty-set, @RecursiveNoOffset(arg1, [0,1)){{$}} +; CHECK-NEXT: size[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NEXT: sum[4]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}} ; CHECK-NOT: ]: @@ -333,7 +333,7 @@ define void @TestRecursiveWithOffset(i32 %size) { ; CHECK-LABEL: @TestRecursiveWithOffset dso_preemptable{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: size[]: empty-set, @RecursiveWithOffset(arg0, [0,1)){{$}} +; CHECK-NEXT: size[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; LOCAL-NEXT: sum[64]: empty-set, @RecursiveWithOffset(arg1, [0,1)){{$}} ; GLOBAL-NEXT: sum[64]: full-set, @RecursiveWithOffset(arg1, [0,1)){{$}} @@ -434,14 +434,14 @@ ; CHECK-NEXT: args uses: ; LOCAL-NEXT: p[]: [0,4), @RecursiveNoOffset(arg0, [4,5)){{$}} ; GLOBAL-NEXT: p[]: full-set, @RecursiveNoOffset(arg0, [4,5)){{$}} -; CHECK-NEXT: size[]: empty-set, @RecursiveNoOffset(arg1, [-1,0)){{$}} +; CHECK-NEXT: size[]: full-set{{$}} ; CHECK-NEXT: acc[]: [0,4), @RecursiveNoOffset(arg2, [0,1)){{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NOT: ]: ; CHECK-LABEL: @RecursiveWithOffset{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: size[]: empty-set, @RecursiveWithOffset(arg0, [-1,0)){{$}} +; CHECK-NEXT: size[]: full-set{{$}} ; LOCAL-NEXT: acc[]: [0,4), @RecursiveWithOffset(arg1, [4,5)){{$}} ; GLOBAL-NEXT: acc[]: full-set, @RecursiveWithOffset(arg1, [4,5)){{$}} ; CHECK-NEXT: allocas uses: diff --git a/llvm/test/Analysis/StackSafetyAnalysis/local.ll b/llvm/test/Analysis/StackSafetyAnalysis/local.ll --- a/llvm/test/Analysis/StackSafetyAnalysis/local.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/local.ll @@ -265,7 +265,7 @@ define void @DynamicAllocaUnused(i64 %size) { ; CHECK-LABEL: @DynamicAllocaUnused dso_preemptable{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: size[]: empty-set{{$}} +; CHECK-NEXT: size[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NEXT: x[0]: empty-set{{$}} ; CHECK-NOT: ]: @@ -278,7 +278,7 @@ define void @DynamicAlloca(i64 %size) { ; CHECK-LABEL: @DynamicAlloca dso_preemptable{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: size[]: [-9223372036854775808,9223372036854775796){{$}} +; CHECK-NEXT: size[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NEXT: x[0]: [0,4){{$}} ; CHECK-NOT: ]: @@ -293,7 +293,7 @@ define void @DynamicAllocaFiniteSizeRange(i1 zeroext %z) { ; CHECK-LABEL: @DynamicAllocaFiniteSizeRange dso_preemptable{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: z[]: [-9223372036854775808,9223372036854775796){{$}} +; CHECK-NEXT: z[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NEXT: x[0]: [0,4){{$}} ; CHECK-NOT: ]: @@ -359,7 +359,7 @@ define dso_local void @SizeCheck(i32 %sz) { ; CHECK-LABEL: @SizeCheck{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: sz[]: empty-set{{$}} +; CHECK-NEXT: sz[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NEXT: x1[128]: [0,4294967295){{$}} ; CHECK-NOT: ]: diff --git a/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll b/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll --- a/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll +++ b/llvm/test/Analysis/StackSafetyAnalysis/memintrin.ll @@ -53,7 +53,7 @@ define void @MemsetNonConst(i32 %size) { ; CHECK-LABEL: MemsetNonConst dso_preemptable{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: size[]: empty-set{{$}} +; CHECK-NEXT: size[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NEXT: x[4]: [0,4294967295){{$}} ; CHECK-NOT: ]: @@ -69,7 +69,7 @@ define void @MemsetNonConstInBounds(i1 zeroext %z) { ; CHECK-LABEL: MemsetNonConstInBounds dso_preemptable{{$}} ; CHECK-NEXT: args uses: -; CHECK-NEXT: z[]: empty-set{{$}} +; CHECK-NEXT: z[]: full-set{{$}} ; CHECK-NEXT: allocas uses: ; CHECK-NEXT: x[4]: [0,4294967295){{$}} ; CHECK-NOT: ]: diff --git a/llvm/test/Bitcode/thinlto-function-summary-stacksafety.ll b/llvm/test/Bitcode/thinlto-function-summary-stacksafety.ll --- a/llvm/test/Bitcode/thinlto-function-summary-stacksafety.ll +++ b/llvm/test/Bitcode/thinlto-function-summary-stacksafety.ll @@ -42,10 +42,8 @@ } ; SSI-LABEL: function 'IntParam' -; SSI: x[]: empty-set -; BC-NEXT: ; BC-NEXT: