The shortest intrinsics that can be upgraded via remangling have
8 characters (like "llvm.abs"). Make sure these go through the
upgrade code.
I think that currently this change is not observable from in-tree
callers of UpgradeIntrinsicFunction(), because callers do
redundant remangling checks. However, this issue shows up in
existing tests if those checks are removed (which I will do in
followup changes).
// Quickly eliminate it, if it's not a candidate.
StringRef Name = F->getName();
- if (Name.size() <= 8 || !Name.startswith("llvm."))
+ if (Name.size() <= 7 || !Name.startswith("llvm."))
return false;
Name = Name.substr(5); // Strip off "llvm."