[MC][ARM] Reuse symbol value in constant pool
authorluxufan <luxufan@iscas.ac.cn>
Mon, 6 Jun 2022 13:35:33 +0000 (21:35 +0800)
committerluxufan <luxufan@iscas.ac.cn>
Tue, 7 Jun 2022 05:39:52 +0000 (13:39 +0800)
commita7b154aa1770a2223be2e99735fab54c1c081007
tree3bb404459e317366f8cf3f78faed82251a6e9130
parenta3a4f0335fcc654dc81710e9b46665b44b60de0d
[MC][ARM] Reuse symbol value in constant pool

Fix https://github.com/llvm/llvm-project/issues/55816

Before this patch, MCConstantExpr were reused, but MCSymbolExpr were
not. To reuse symbol value, this patch added a DenseMap to record the
symbol value.

Differential Revision: https://reviews.llvm.org/D127113
llvm/include/llvm/MC/ConstantPools.h
llvm/lib/MC/ConstantPools.cpp
llvm/test/MC/ARM/ldr-pseudo-wide.s