The instructions addis,addi, bl are used to calculate the address of TLS thread local variables. These TLS access code sequences are generated repeatedly every time the thread local variable is accessed. By communicating to Machine CSE that X2 is guaranteed to have the same value within the same function call (so called Caller Preserved Physical Register), the redundant TLS access code sequences are cleaned up.
Note: for the test case included in the patch, before the fix the same TLS access code sequences (addis/addi/bl) is generated twice. After the fix, it is only generated once. The test case tests the new behaviour after the fix.