[SystemZ] Fix invalid assumption in getCPUNameFromS390Model
authorUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 20 Jul 2021 11:36:33 +0000 (13:36 +0200)
committerUlrich Weigand <ulrich.weigand@de.ibm.com>
Tue, 20 Jul 2021 11:39:22 +0000 (13:39 +0200)
commite04c05e8230e383493774cb3636587d3c0b5f288
treedbd6c569d8ef30eaeb7a8d9785664ff49133c619
parent669275f8a0fc85d9b352d91bbf4f4ee1886f96b1
[SystemZ] Fix invalid assumption in getCPUNameFromS390Model

Code in getCPUNameFromS390Model currently assumes that the
numerical value of the model number always increases with
future hardware.  While this has happened to be the case
with the last few machines, it is not guaranteed -- that
assumption was violated with (much) older machines, and
it can be violated again with future machines.

Fix by explicitly listing model numbers for all supported
machine models.
llvm/lib/Support/Host.cpp
llvm/unittests/Support/Host.cpp