This is an archive of the discontinued LLVM Phabricator instance.

Recommit "Add a heap alloc site marker field to the ExtraInfo in MachineInstrs"
ClosedPublic

Authored by akhuang on Oct 28 2019, 3:12 PM.

Details

Summary

Fixes some things from original commit at https://reviews.llvm.org/D69136. The main
change is that the heap alloc marker is always stored as ExtraInfo in the machine
instruction instead of in the PointerSumType because it cannot hold more than
4 pointer types.

Add instruction marker to MachineInstr ExtraInfo. This does almost the
same thing as Pre/PostInstrSymbols, except that it doesn't create a label until
printing instructions. This allows for labels to be put around instructions that
are deleted/duplicated somewhere.
Use this marker to track heap alloc site call instructions.

Diff Detail

Event Timeline

akhuang created this revision.Oct 28 2019, 3:12 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2019, 3:12 PM
rnk accepted this revision.Oct 28 2019, 3:47 PM

lgtm

llvm/unittests/CodeGen/MachineInstrTest.cpp
142

Seems like a reasonable fix.

144–145

Why is the "bogus" derived class needed anyway? It seems like you could make a regular MCContext and it would be fine.

This revision is now accepted and ready to land.Oct 28 2019, 3:47 PM
akhuang marked an inline comment as done.Oct 28 2019, 4:00 PM
akhuang added inline comments.
llvm/unittests/CodeGen/MachineInstrTest.cpp
144–145

Good point. It is just a regular MCContext.

akhuang updated this revision to Diff 226774.Oct 28 2019, 4:01 PM

Remove bogus class wrapper

This revision was automatically updated to reflect the committed changes.

I get a build error with this patch (b288f7d6bb8fdd21d27ba755302db194c181fdaf) It looks like what got committed is a little different from above. The committed patch partially changed updateCallSiteInfo with moveCallSiteInfo

/local/mnt/workspace/tmp/tipcheck/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:825:23: error: 
      out-of-line definition of 'moveCallSiteInfo' does not match any declaration in
      'llvm::MachineFunction'; did you mean 'updateCallSiteInfo'?
void MachineFunction::moveCallSiteInfo(const MachineInstr *Old,
                      ^~~~~~~~~~~~~~~~
                      updateCallSiteInfo

I get a build error with this patch (b288f7d6bb8fdd21d27ba755302db194c181fdaf) It looks like what got committed is a little different from above. The committed patch partially changed updateCallSiteInfo with moveCallSiteInfo

/local/mnt/workspace/tmp/tipcheck/llvm-project/llvm/lib/CodeGen/MachineFunction.cpp:825:23: error: 
      out-of-line definition of 'moveCallSiteInfo' does not match any declaration in
      'llvm::MachineFunction'; did you mean 'updateCallSiteInfo'?
void MachineFunction::moveCallSiteInfo(const MachineInstr *Old,
                      ^~~~~~~~~~~~~~~~
                      updateCallSiteInfo

Sorry, I guess I messed this up when merging.