This is an archive of the discontinued LLVM Phabricator instance.

[MC][ARM] Reuse symbol value in constant pool
ClosedPublic

Authored by StephenFan on Jun 6 2022, 7:22 AM.

Details

Summary

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.

Diff Detail

Event Timeline

StephenFan created this revision.Jun 6 2022, 7:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 7:22 AM
StephenFan requested review of this revision.Jun 6 2022, 7:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 7:22 AM
StephenFan updated this revision to Diff 434468.Jun 6 2022, 7:23 AM

Delete unused header

This patch trys to fix https://github.com/llvm/llvm-project/issues/55816

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

llvm/lib/MC/ConstantPools.cpp
48
if (C) {
  auto CItr = CachedConstantEntries.find(C->getValue());
  if (CItr != CachedConstantEntries.end())
    return CItr->second;
}
if (S) {
  ...
}
StephenFan updated this revision to Diff 434679.Jun 6 2022, 7:54 PM

Replace ? : statement to if statement

StephenFan edited the summary of this revision. (Show Details)Jun 6 2022, 7:54 PM
StephenFan marked an inline comment as done.Jun 6 2022, 7:57 PM
MaskRay accepted this revision.Jun 6 2022, 8:02 PM

Looks great!

This revision is now accepted and ready to land.Jun 6 2022, 8:02 PM
This revision was landed with ongoing or failed builds.Jun 6 2022, 10:40 PM
This revision was automatically updated to reflect the committed changes.