phoebewang wrote:

> I assume that's what you're doing in the place I asked for a comment is 
> trying to avoid redundantly generating TLSDESC accesses for 
> _TLS_MODULE_BASE_. I see that we don't generate multiple accesses for 
> _TLS_MODULE_BASE_ in the test cases, but I thought that was only safe to do 
> when an earlier access dominates a later access.
> 
> Is my understanding here correct, or is there an interaction with
> 
> https://github.com/llvm/llvm-project/blob/04bbbba271ebe4c2421f34a4fbf34c328df9f111/llvm/lib/Target/X86/X86InstrInfo.cpp#L10245
> 
> ?

Yes, you are correct.

I think SelectionDAG takes care of it. I checked it locally, it will generate 
two pairs of `_TLS_MODULE_BASE_` in `if ... else ...` branches respectively and 
one `_TLS_MODULE_BASE_` otherwise.

I admit I didn't know the code here when adding it to GetTLSADDR. But I think 
not to create the nodes at the beginning is slightly better than to remove it 
later if they have the same output. Not to mention dominator iteration is 
expensive.

https://github.com/llvm/llvm-project/pull/83136
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to