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 {
367367 }
368368
369369 // 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" ) )
371371 return ;
372372
373373 // Instruction operands.
374374 SmallVector<SmallString<64 >, 4 > Operands;
375375
376376 for (auto &Op : I->operands ()) {
377377 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" ) ;
380380
381381 Operands.push_back (HasNormalName ? I->getName ().substr (0 , 7 )
382382 : I->getName ());
You can’t perform that action at this time.
0 commit comments