[PATCHES] PR18303: Use appropriate Feature flags for encoding instructions

David Woodhouse dwmw2 at infradead.org
Wed Jan 15 08:57:06 PST 2014


On Fri, 2014-01-10 at 15:33 -0800, David Peixotto wrote:
> I've attached the patch that gets rid of the MCSubtargetInfo data member in
> the MCCodeEmitter objects. I do this by adding a MCSubtargetInfo parameter
> to the MCStreamer::EmitInstruction() interface. The subtarget info is then
> threaded down to the MCCodeEmitter::EncodeInstruction() function.
> 
> I followed David's lead by storing the MCSubtargetInfo in the
> MCRelaxableFragment and using it to re-encode the instruction when it is
> relaxed. This makes the fragment object larger now because it is storing the
> whole subtarget info object, but it could be made smaller by keeping the
> subtargets const and uniquing them as David suggested.
> 
> This change fixes the encoding of relaxable instructions and mode switching
> in inlineasm. The change was fairly straightforward to make, but it required
> touching all the backends.
> 
> Patches are attached in logical steps I took and as one big smashed patch.

This looks good to me (without capitals since I'm not qualified to opine).

I'd like to see this go in, and then perhaps we can follow up afterwards
with reducing the memory usage by uniquifying the SubtargetInfo and
storing only a reference in the MCRelaxableFragment...?

Since the first patch is fairly intrusive, it already fails to apply to
today's HEAD. Here's an updated version...

-- 
dwmw2
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Change-MCStreamer-EmitInstruction-interface-to-take-.patch
Type: text/x-patch
Size: 63615 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140115/668d832c/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 5745 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140115/668d832c/attachment-0001.bin>


More information about the llvm-commits mailing list