[PATCH] D107509: Disable LibFuncs for stpcpy and stpncpy for Android < 21
Shoaib Meenai via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 4 17:16:55 PDT 2021
smeenai 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]]
;
----------------
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.
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