This patch adds lowering for an addressing sequence to access TLS symbols using the localexec model.
This required adding a four operand pseudo add instruction, which uses the fourth operand to express a relocation of the symbol. The instruction is expanded in RISCVMCCodeEmitter.cpp to a normal add, with the necessary fixup emitted. Parsing of the extra operand was also added to ensure that a normal add cannot have four operands and still parse correctly.
Depends on D55305
Pattern should be (add (add_tprel (lui %tprel_hi(sym)) tp %tprel_add(sym)) %tprel_lo(sym)) - you missed the %tprel_add operand to add_tprel.