aboutsummaryrefslogtreecommitdiff
path: root/test/Transforms/NaCl/expand-tls-constexpr.ll
AgeCommit message (Collapse)Author
2013-03-29PNaCl: Fix ExpandTls to handle a couple of corner cases involving PHI nodesMark Seaborn
ExpandTls's use of replaceUsesOfWith() didn't work for PHI nodes containing the same Constant twice (which needs to work for same or differing incoming BasicBlocks). The same applies to ExpandTlsConstantExpr. I noticed this while implementing ExpandConstantExpr. Fix this and factor out some common code that all three passes can use. BUG=https://code.google.com/p/nativeclient/issues/detail?id=2837 TEST=test/Transforms/NaCl/*.ll Review URL: https://codereview.chromium.org/13128002
2012-11-29PNaCl: Add ExpandTls pass for expanding out static TLS variablesMark Seaborn
This replaces each reference to a TLS variable "foo" with the LLVM IR equivalent of the expression: ((struct tls_template *) __nacl_read_tp())->foo This pass fills out the global variables __tls_template_start, __tls_template_end etc. which are used by src/untrusted/nacl/tls.c. These are the symbols that are otherwise defined by a binutils linker script. In order to handle the case of TLS variables that occur inside ConstantExprs, we have a helper pass, ExpandTlsConstantExpr. BUG=http://code.google.com/p/nativeclient/issues/detail?id=2837 TEST=test/Transforms/NaCl/expand-tls*.ll Review URL: https://chromiumcodereview.appspot.com/10896042