FunctionAttrs incorrectly infers that the following function returns nonnull (https://llvm.godbolt.org/z/49Kbq15xn): ```llvm define ptr @test(ptr nonnull %arg) { %res = getelementptr i8, ptr %arg, i64 -8 ret ptr %res } ``` This is because the code assumes that the result of a GEP is non-null if the source is non-null here: https://github.com/llvm/llvm-project/blob/d98a78590f4f9e43fdfb69fde7d154a985e4560f/llvm/lib/Transforms/IPO/FunctionAttrs.cpp#L1189 This is not correct for non-inbounds GEPs.