[PATCH] D107509: Disable LibFuncs for stpcpy and stpncpy for Android < 21

Paul Robinson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 6 06:22:46 PDT 2021


probinson added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/sprintf-1.ll:113-118
+; ANDROID-LABEL: @test_simplify7(
+; ANDROID-NEXT:    [[STRLEN:%.*]] = call i32 @strlen(i8* noundef nonnull dereferenceable(1) [[STR:%.*]])
+; ANDROID-NEXT:    [[LENINC:%.*]] = add i32 [[STRLEN]], 1
+; ANDROID-NEXT:    call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 1 [[DST:%.*]], i8* align 1 [[STR]], i32 [[LENINC]], i1 false)
+; ANDROID-NEXT:    ret i32 [[STRLEN]]
 ;
----------------
smeenai wrote:
> This is identical to the Windows case, right? Can we just combine the cases and use a more generic label (e.g. NOSTPCPY or something)?
> 
> You should also add a test using an Android 21 triple and verify that the `stpcpy` transform triggers for it.
Yes, please make this a generic label; PS4 is going to have to do the same thing, we just had somebody trip over it.  (Not asking you to do the PS4 change, just make the test easier for us to add our case later.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107509/new/

https://reviews.llvm.org/D107509



More information about the llvm-commits mailing list