[Patch] Kill LDTLSCleanup, let MachineCSE clean up local-dynamic TLS (PR13783)
Hans Wennborg
hans at chromium.org
Mon Feb 11 09:25:03 PST 2013
On Fri, Feb 8, 2013 at 5:58 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk> wrote:
>
> On Feb 8, 2013, at 9:40 AM, Hans Wennborg <hans at chromium.org> wrote:
>
>> Hi all,
>>
>> The attached patch attempts to fix PR13783. The idea is to make it
>> possible for MachineCSE (and cse during sdag construction) to clean up
>> redundant TLS_base_addr instructions, rather than having a custom pass
>> do it.
>>
>> To accomplish this, I have changed TLS_base_addr to define a vreg
>> rather than placing its result in a physical register, and then expand
>> to a call and a mov in MC lowering.
>>
>> I'm not super confident about the codegen parts of LLVM, so please
>> take a close look.
>
> Looks good to me.
>
> Are there existing tests checking that CSE is working?
Yes, CodeGen/X86/tls-local-dynamic.ll tests this.
But I now realize it only tests the 64-bit case, and my patch seems to
break the 32-bit case. It seems the patch will need another iteration.
Thanks,
Hans
More information about the llvm-commits
mailing list