Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions llvm/lib/CodeGen/CodeGenPrepare.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4672,8 +4672,8 @@ class TypePromotionHelper {
static void addPromotedInst(InstrToOrigTy &PromotedInsts,
Instruction *ExtOpnd, bool IsSExt) {
ExtType ExtTy = IsSExt ? SignExtension : ZeroExtension;
InstrToOrigTy::iterator It = PromotedInsts.find(ExtOpnd);
if (It != PromotedInsts.end()) {
auto [It, Inserted] = PromotedInsts.try_emplace(ExtOpnd);
if (!Inserted) {
// If the new extension is same as original, the information in
// PromotedInsts[ExtOpnd] is still correct.
if (It->second.getInt() == ExtTy)
Expand All @@ -4684,7 +4684,7 @@ class TypePromotionHelper {
// BothExtension.
ExtTy = BothExtension;
}
PromotedInsts[ExtOpnd] = TypeIsSExt(ExtOpnd->getType(), ExtTy);
It->second = TypeIsSExt(ExtOpnd->getType(), ExtTy);
}

/// Utility function to query the original type of instruction \p Opnd
Expand Down