@@ -471,15 +471,16 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
471471 Value *simplifyNonNullOperand (Value *V, bool HasDereferenceable,
472472 unsigned Depth = 0 );
473473
474- SelectInst *createSelectInst (Value *C, Value *S1, Value *S2,
475- const Twine &NameStr = " " ,
476- InsertPosition InsertBefore = nullptr ,
477- Instruction *MDFrom = nullptr ) {
478- SelectInst *SI =
479- SelectInst::Create (C, S1, S2, NameStr, InsertBefore, MDFrom);
480- if (!MDFrom)
481- setExplicitlyUnknownBranchWeightsIfProfiled (*SI, F, DEBUG_TYPE);
482- return SI;
474+ // / Create `select C, S1, S2`. Use only when the profile cannot be calculated
475+ // / from existing profile metadata: if the Function has profiles, this will
476+ // / set the profile of this select to "unknown".
477+ SelectInst *
478+ createSelectInstWithUnknownProfile (Value *C, Value *S1, Value *S2,
479+ const Twine &NameStr = " " ,
480+ InsertPosition InsertBefore = nullptr ) {
481+ auto *Sel = SelectInst::Create (C, S1, S2, NameStr, InsertBefore, nullptr );
482+ setExplicitlyUnknownBranchWeightsIfProfiled (*Sel, F, DEBUG_TYPE);
483+ return Sel;
483484 }
484485
485486public:
0 commit comments