For purposes of applying any exemption from, or reduction of, any tax provided by any treaty to which the United States is a party with respect to income which is not effectively connected with the conduct of a trade or business within the United States, a nonresident alien individual or a foreign corporation shall be deemed not to have a permanent establishment in the United States at any time during the taxable year. This subsection shall not apply in respect of the tax computed under section 877(b).
The Secretary shall prescribe such regulations as may be necessary or appropriate to determine the extent to which a taxpayer to which paragraph (1) does not apply shall not be entitled to benefits under any income tax treaty of the United States with respect to any payment received by, or income attributable to any activities of, an entity organized in any jurisdiction (including the United States) that is treated as a partnership or is otherwise treated as fiscally transparent for purposes of this title (including a common investment trust under section 584, a grantor trust, or an entity that is disregarded for purposes of this title) and is treated as fiscally nontransparent for purposes of the tax laws of the jurisdiction of residence of the taxpayer.