Skip to content

Commit a86a72f

Browse files
committed
Added takeName calls to take name from existing instructions
1 parent 71d1be0 commit a86a72f

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3736,11 +3736,13 @@ static Value *foldSelectIntoAddConstant(SelectInst &SI,
37363736
if (!match(FAdd, m_FAdd(m_Specific(X), m_Specific(C))))
37373737
return nullptr;
37383738

3739-
Value *NewSelect =
3740-
Builder.CreateSelect(SI.getCondition(), X, Z, SI.getName(), &SI);
3739+
Value *NewSelect = Builder.CreateSelect(SI.getCondition(), X, Z, "", &SI);
37413740
cast<Instruction>(NewSelect)->setFastMathFlags(SI.getFastMathFlags());
3741+
NewSelect->takeName(&SI);
37423742

3743-
return Builder.CreateFAddFMF(NewSelect, C, FAdd, FAdd->getName());
3743+
Value *NewFAdd = Builder.CreateFAddFMF(NewSelect, C, FAdd);
3744+
NewFAdd->takeName(FAdd);
3745+
return NewFAdd;
37443746
}
37453747

37463748
return nullptr;

0 commit comments

Comments
 (0)