[DebugInfo] Check DIEnumerator bit width when comparing for equality
authorArthur Eubanks <aeubanks@google.com>
Fri, 3 Dec 2021 19:01:25 +0000 (11:01 -0800)
committerArthur Eubanks <aeubanks@google.com>
Fri, 3 Dec 2021 21:40:22 +0000 (13:40 -0800)
commit93a20ecee4b6c6618e0a8e1112f4f929d55ffcbb
tree2059cf101e7d58e31de1b4aaa014dce9f638638d
parent97eb3bb80ff9caa705c174c9adc2d683d8da79a3
[DebugInfo] Check DIEnumerator bit width when comparing for equality

As mentioned in D106585, this causes non-determinism, which can also be
shown by this test case being flaky without this patch.

We were using the APSInt's bit width for hashing, but not for checking
for equality. APInt::isSameValue() does not check bit width.

Reviewed By: rnk

Differential Revision: https://reviews.llvm.org/D115054
llvm/lib/IR/LLVMContextImpl.h
llvm/unittests/IR/DebugInfoTest.cpp