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

David Woodhouse dwmw2 at infradead.org
Tue Jan 28 08:52:23 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.

Updated again at http://git.infradead.org/users/dwmw2/llvm.git — after
all, I was responsible for a reasonable proportion of the breakage when
you try to apply it to today's tree, since I've been messing with the
X86 target.

In doing so, I note that you didn't change the EmitInstruction() method
of the AsmPrinter classes to take the additional MCSubtargetInfo& as an
argument. Is that something we might want to do, even if only for
symmetry?

-- 
David Woodhouse                            Open Source Technology Centre
David.Woodhouse at intel.com                              Intel Corporation
-------------- 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/20140128/de45701a/attachment.bin>


More information about the llvm-commits mailing list