File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
llvm/lib/Transforms/Utils Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -367,16 +367,16 @@ void IRNormalizer::foldInstructionName(Instruction *I) const {
367
367
}
368
368
369
369
// Don't fold if it is an output instruction or has no op prefix.
370
- if (isOutput (I) || I->getName ().substr ( 0 , 2 ) != " op" )
370
+ if (isOutput (I) || ! I->getName ().starts_with ( " op" ) )
371
371
return ;
372
372
373
373
// Instruction operands.
374
374
SmallVector<SmallString<64 >, 4 > Operands;
375
375
376
376
for (auto &Op : I->operands ()) {
377
377
if (const auto *I = dyn_cast<Instruction>(Op)) {
378
- bool HasNormalName = I-> getName (). substr ( 0 , 2 ) == " op " ||
379
- I->getName ().substr ( 0 , 2 ) == " vl" ;
378
+ bool HasNormalName =
379
+ I->getName ().starts_with ( " op " ) || I-> getName (). starts_with ( " vl" ) ;
380
380
381
381
Operands.push_back (HasNormalName ? I->getName ().substr (0 , 7 )
382
382
: I->getName ());
You can’t perform that action at this time.
0 commit comments