This patch is a preparation for "Extends the scope of optimizeMemoryInst optimization".
It just a NFC to separate combining of Select and Phi nodes.
|  Differential  D38535  
[CGP] Separate Select and Phi case in optimizeMemoryInst AbandonedPublic Authored by skatkov on Oct 4 2017, 3:15 AM. 
Details 
 Summary This patch is a preparation for "Extends the scope of optimizeMemoryInst optimization". It just a NFC to separate combining of Select and Phi nodes. 
Diff Detail Event Timelineskatkov added a parent revision: D38533: [CGP]Restrict complex select/phi case for optimizeMemoryInst. 
Revision Contents 
 
 
Diff 117649 lib/CodeGen/CodeGenPrepare.cpp
 
 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
You could instead figure out if we have a select or phi by passing through Addr and checking its type. Or alternatively attach the select/phi to each ExtAddrMode that came from it (similar to what D38133 does with AddrModeUser) and examine the type of that.