[LoongArch] Support 'generic' as a valid CPU name
authorWANG Xuerui <git@xen0n.name>
Mon, 26 Sep 2022 02:18:46 +0000 (10:18 +0800)
committerWeining Lu <luweining@loongson.cn>
Mon, 26 Sep 2022 02:20:13 +0000 (10:20 +0800)
commitad6fe32032a6229e0c40510e9bed419a01c695b3
tree35e4cb767fe0e0b8173bc40696c3fda77f061af6
parentbf25a48985ac54e4c0727507435705dade84b3ee
[LoongArch] Support 'generic' as a valid CPU name

As the LoongArch port is largely modeled after RISCV it has the same
behavior of not accepting `generic` as a CPU name. For better
compatibility with consumers of LLVM (e.g. mesa) follow D121149's suit
and treat `generic` the same as an empty CPU name.

Differential Revision: https://reviews.llvm.org/D134412
llvm/lib/Target/LoongArch/LoongArch.td
llvm/lib/Target/LoongArch/LoongArchSubtarget.cpp
llvm/lib/Target/LoongArch/MCTargetDesc/LoongArchMCTargetDesc.cpp
llvm/test/CodeGen/LoongArch/cpu-name-generic.ll [new file with mode: 0644]