Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/Transforms/Utils/IRNormalizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,16 +367,16 @@ void IRNormalizer::foldInstructionName(Instruction *I) const {
}

// Don't fold if it is an output instruction or has no op prefix.
if (isOutput(I) || I->getName().substr(0, 2) != "op")
if (isOutput(I) || !I->getName().starts_with("op"))
return;

// Instruction operands.
SmallVector<SmallString<64>, 4> Operands;

for (auto &Op : I->operands()) {
if (const auto *I = dyn_cast<Instruction>(Op)) {
bool HasNormalName = I->getName().substr(0, 2) == "op" ||
I->getName().substr(0, 2) == "vl";
bool HasNormalName =
I->getName().starts_with("op") || I->getName().starts_with("vl");

Operands.push_back(HasNormalName ? I->getName().substr(0, 7)
: I->getName());
Expand Down