IR parser & AutoUpdate of '@llvm.memcpy'

In working on chaning llvm.memcpy’s i1 isVolatile parm to an i8 volatileflags operand, I noticed the following apparent inconsistency.

  1. one testcase (llvm/test/Transforms/Attributor/value-simplify.l) declares ‘@llvm.memcpy(p0, p0, i32, i1)’, and has it recognized as the intrinsic
  2. llvm/lib/IR/AutoUpdater.cpp recognizes the functions to update by looking at the name (not any intrinsic ID), and requires a ‘.’ after the name. For instance (after skipping the llvm. prefix) Name.startswith("memcpy.").

Currently not upgrading plain llvm.memcpy is ok, as the declaration is correct. But changing the final parm from i1 to i8 makes this significant.

There seems to be an inconsistency in how the LLVM IR parser (at least) recognizes intrinics and how the auto updater checks for them. Should the parser be more restrictive, or should the auto updater be less restrictive? In either case, should the testcase be changed?

It’s okay to break such cases (that is, just fix the test case). It’s an artifact of intrinsic remangling auto-upgrade that it’s possible to write intrinsics without the mangling suffix if you have just one of them, but it’s not an intentional feature.