mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-15 23:06:32 +00:00
[CodeGen] Avoid repeated hash lookups (NFC) (#130543)
This commit is contained in:
parent
5addbf0c60
commit
b2b267ea7a
@ -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)
|
||||
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user