Or even for IRS to subpoena such records directly, it's not like NSA is the only agency in the whole USG that can order relevant documents to be turned over for investigations in their bailiwick. Maybe it would need a warrant instead but it can't be too difficult for IRS to just get it themselves.