[llvm-mca] Fix PR38575: Avoid an invalid implicit truncation of a processor resource...
commit47bbfe3bd01e23ff8fd416cd3fd9223414c5d9f4
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 15 Aug 2018 12:53:38 +0000 (15 12:53 +0000)
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>
Wed, 15 Aug 2018 12:53:38 +0000 (15 12:53 +0000)
tree71a5a66169e40e16470af069e06fb237db2856ef
parent8ae415fb86e374a3f6a4ac618d9fae13e0f18e25
[llvm-mca] Fix PR38575: Avoid an invalid implicit truncation of a processor resource mask (an uint64_t value) to unsigned.

This patch fixes a regression introduced at revision 338702.

A processor resource mask was incorrectly implicitly truncated to an unsigned
quantity. Later on, the truncated mask was used to initialize an element of a
vector of processor resource descriptors.
On targets with more than 32 processor resources, some elements of the vector
are left uninitialized. As a consequence, this bug might have eventually caused
a crash due to null dereference in the Scheduler.

This patch fixes PR38575, and adds a test for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339768 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-mca/AArch64/Exynos/pr38575.s [new file with mode: 0644]
tools/llvm-mca/Scheduler.cpp