Skip to content

Commit d25ef09

Browse files
committed
[AutoUpgrade] Fix length check for intrinsic upgrade
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).
1 parent 9cb4e90 commit d25ef09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/IR/AutoUpgrade.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ static bool UpgradeIntrinsicFunction1(Function *F, Function *&NewFn) {
583583

584584
// Quickly eliminate it, if it's not a candidate.
585585
StringRef Name = F->getName();
586-
if (Name.size() <= 8 || !Name.startswith("llvm."))
586+
if (Name.size() <= 7 || !Name.startswith("llvm."))
587587
return false;
588588
Name = Name.substr(5); // Strip off "llvm."
589589

0 commit comments

Comments
 (0)