Skip to content

Commit 0e385b4

Browse files
committed
[NFC][InstCombine] Use the Builder's CreateSelectWithUnknownProfile
1 parent 416d1f0 commit 0e385b4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineInternal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,6 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
471471
Value *simplifyNonNullOperand(Value *V, bool HasDereferenceable,
472472
unsigned Depth = 0);
473473

474-
public:
475474
/// Create `select C, S1, S2`. Use only when the profile cannot be calculated
476475
/// from existing profile metadata: if the Function has profiles, this will
477476
/// set the profile of this select to "unknown".
@@ -484,6 +483,7 @@ class LLVM_LIBRARY_VISIBILITY InstCombinerImpl final
484483
return Sel;
485484
}
486485

486+
public:
487487
/// Create and insert the idiom we use to indicate a block is unreachable
488488
/// without having to rewrite the CFG from within InstCombine.
489489
void CreateNonTerminatorUnreachable(Instruction *InsertAt) {

llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ static Value *simplifyShiftSelectingPackedElement(Instruction *I,
110110
ShrAmt->getName() + ".z");
111111
// There is no existing !prof metadata we can derive the !prof metadata for
112112
// this select.
113-
Value *Select = IC.createSelectInstWithUnknownProfile(ShrAmtZ, Lower, Upper);
114-
IC.Builder.Insert(Select);
113+
Value *Select = IC.Builder.CreateSelectWithUnknownProfile(ShrAmtZ, Lower,
114+
Upper, DEBUG_TYPE);
115115
Select->takeName(I);
116116
return Select;
117117
}

0 commit comments

Comments
 (0)