[llvm-commits] [Patch] Make GlobalOpt conservative with TLS vars (PR14309, 3.2-blocker)

Duncan Sands baldrick at free.fr
Wed Nov 14 00:22:23 PST 2012


Hi Hans, any suggestions for a redesign of TLS that makes this kind of
problem impossible?

Ciao, Duncan.

> The attached patch takes a stab at fixing PR14309 which was marked as
> a 3.2-blocker.
>
> For global variables which get the same value stored into them
> everywhere, GlobalOpt will replace them with a constant. The problem
> is that a thread-local GlobalVariable looks like one value, but is
> different between threads.
>
> My patch introduces Constant::isThreadDependent() which returns true
> for thread-local variables and constants which depend on them (e.g. a
> GEP into a thread-local array), and teaches GlobalOpt not to track
> such values.
>
> Please take a look!
>
> Also, if anyone thinks there are more passes which assume that
> thread-local GlobalVariables have the same value everywhere, please
> let me know.
>
> Thanks,
> Hans
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>




More information about the llvm-commits mailing list