diff --git a/llvm/utils/TableGen/CodeGenDAGPatterns.h b/llvm/utils/TableGen/CodeGenDAGPatterns.h index 2e2a9a2b1efc59..d0cf18b7c4c74e 100644 --- a/llvm/utils/TableGen/CodeGenDAGPatterns.h +++ b/llvm/utils/TableGen/CodeGenDAGPatterns.h @@ -200,9 +200,7 @@ struct TypeSetByHwMode : public InfoByHwMode { TypeSetByHwMode(ArrayRef VTList); SetType &getOrCreate(unsigned Mode) { - if (hasMode(Mode)) - return get(Mode); - return Map.insert({Mode,SetType()}).first->second; + return Map[Mode]; } bool isValueTypeByHwMode(bool AllowEmpty) const;