[llvm] [AggressiveInstCombine] Inline strcmp/strncmp (PR #89371)

Franklin Zhang via llvm-commits llvm-commits at lists.llvm.org
Thu May 2 03:24:15 PDT 2024


================
@@ -0,0 +1,216 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt -S -passes=aggressive-instcombine -strncmp-inline-threshold=3 < %s | FileCheck %s
+
+; check whether we generate the right IR
+
+declare i32 @strncmp(ptr nocapture, ptr nocapture, i64)
+declare i32 @strcmp(ptr nocapture, ptr nocapture)
+
+ at s2 = constant [2 x i8] c"a\00"
+ at s3 = constant [3 x i8] c"ab\00"
+
+define i1 @test_strncmp_1(ptr nocapture readonly %s) {
----------------
FLZ101 wrote:

done. These are removed.

https://github.com/llvm/llvm-project/pull/89371


More information about the llvm-commits mailing list