The attached patch modified MachineInstr::isIdenticalTo to consider information stored in MachineMemOperand when determining if two machine instructions are identical.  Specifically, the MachineMemOperands much agree on the pointer flags, memory size, and the fold-ability of the address spaces involved.  A new target hook is added which is called to determine if memory-touching instructions in two different address spaces are foldable.  The default implementation assumes all address spaces are foldable to match the current behavior.<br clear="all">
<div><br></div><div>This fixes a problem we've been having where post-isel passes are combining loads that are really to different address spaces.  These instructions share the same opcode, but the MachineMemOperand is used to specify address space flags during instruction emission.</div>
<div><br></div>-- <br><br><div>Thanks,</div><div><br></div><div>Justin Holewinski</div><br>