@@ -279,8 +279,6 @@ class ScalarizerVisitor : public InstVisitor<ScalarizerVisitor, bool> {
279279
280280 bool visit (Function &F);
281281
282- bool isTriviallyScalarizable (Intrinsic::ID ID);
283-
284282 // InstVisitor methods. They return true if the instruction was scalarized,
285283 // false if nothing changed.
286284 bool visitInstruction (Instruction &I) { return false ; }
@@ -683,19 +681,6 @@ bool ScalarizerVisitor::splitBinary(Instruction &I, const Splitter &Split) {
683681 return true ;
684682}
685683
686- bool ScalarizerVisitor::isTriviallyScalarizable (Intrinsic::ID ID) {
687- if (isTriviallyVectorizable (ID))
688- return true ;
689- // TODO: Move frexp to isTriviallyVectorizable.
690- // https://github.com/llvm/llvm-project/issues/112408
691- switch (ID) {
692- case Intrinsic::frexp:
693- return true ;
694- }
695- return Intrinsic::isTargetIntrinsic (ID) &&
696- TTI->isTargetIntrinsicTriviallyScalarizable (ID);
697- }
698-
699684// / If a call to a vector typed intrinsic function, split into a scalar call per
700685// / element if possible for the intrinsic.
701686bool ScalarizerVisitor::splitCall (CallInst &CI) {
@@ -715,7 +700,7 @@ bool ScalarizerVisitor::splitCall(CallInst &CI) {
715700
716701 Intrinsic::ID ID = F->getIntrinsicID ();
717702
718- if (ID == Intrinsic::not_intrinsic || !isTriviallyScalarizable (ID))
703+ if (ID == Intrinsic::not_intrinsic || !isTriviallyScalarizable (ID, TTI ))
719704 return false ;
720705
721706 // unsigned NumElems = VT->getNumElements();
@@ -1088,7 +1073,7 @@ bool ScalarizerVisitor::visitExtractValueInst(ExtractValueInst &EVI) {
10881073 if (!F)
10891074 return false ;
10901075 Intrinsic::ID ID = F->getIntrinsicID ();
1091- if (ID == Intrinsic::not_intrinsic || !isTriviallyScalarizable (ID))
1076+ if (ID == Intrinsic::not_intrinsic || !isTriviallyScalarizable (ID, TTI ))
10921077 return false ;
10931078 // Note: Fall through means Operand is a`CallInst` and it is defined in
10941079 // `isTriviallyScalarizable`.
0 commit comments