[llvm] [ARM] Implement CRC32 const folding (PR #230751)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 10 01:04:09 PDT 2026


================
@@ -0,0 +1,549 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -mtriple=armv7 -mattr=+crc -passes=instcombine -S | FileCheck %s --check-prefix=ARMV7
+; RUN: opt < %s -mtriple=armv8a -mattr=+crc -passes=instcombine -S | FileCheck %s --check-prefix=ARMV8
+
+define i32 @crc32c_i8_1() {
+; CHECK-LABEL: define i32 @crc32c_i8_1(
+; CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
+; CHECK-NEXT:    [[CRC:%.*]] = call i32 @llvm.arm.crc32cb(i32 -1, i32 -1)
+; CHECK-NEXT:    ret i32 [[CRC]]
----------------
kazutakahirata wrote:

Do you mean to add a `RUN` line above for `CHECK`?  Currently, we have `ARMV7` and `ARMV8`, but we do not check for `CHECK`.

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


More information about the llvm-commits mailing list