Lines Matching refs:Copy
1 //===- MachineCopyPropagation.cpp - Machine Copy Propagation Pass ---------===//
10 // This is an extremely simple MachineInstr-level copy propagation pass.
65 bool eraseIfRedundant(MachineInstr &Copy, unsigned Src, unsigned Def);
82 "Machine Copy Propagation Pass", false, false)
89 // Source of copy is no longer available for propagation.
123 /// Return true if \p PreviousCopy did copy register \p Src to register \p Def.
127 /// isNopCopy("ecx = COPY eax", AX, CX) == true
128 /// isNopCopy("ecx = COPY eax", AH, CL) == false
143 /// Remove instruction \p Copy if there exists a previous copy that copies the
146 bool MachineCopyPropagation::eraseIfRedundant(MachineInstr &Copy, unsigned Src,
148 // Avoid eliminating a copy from/to a reserved registers as we cannot predict
153 // Search for an existing copy.
158 // Check that the existing copy uses the correct sub registers.
163 DEBUG(dbgs() << "MCP: copy is a NOP, removing: "; Copy.dump());
165 // Copy was redundantly redefining either Src or Def. Remove earlier kill
166 // flags between Copy and PrevCopy because the value will be reused now.
167 assert(Copy.isCopy());
168 unsigned CopyDef = Copy.getOperand(0).getReg();
171 make_range(PrevCopy.getIterator(), Copy.getIterator()))
174 Copy.eraseFromParent();
195 // The two copies cancel out and the source of the first copy
197 // %ECX<def> = COPY %EAX
199 // %EAX<def> = COPY %ECX
201 // %ECX<def> = COPY %EAX
205 // %ECX<def> = COPY %EAX
207 // %ECX<def> = COPY %EAX
209 // %ECX<def> = COPY %EAX
213 // If Src is defined by a previous copy, the previous copy cannot be
218 DEBUG(dbgs() << "MCP: Copy is no longer dead: "; CI->second->dump());
223 DEBUG(dbgs() << "MCP: Copy is a deletion candidate: "; MI->dump());
225 // Copy is now a candidate for deletion.
229 // If 'Def' is previously source of another copy, then this earlier copy's
231 // %xmm9<def> = copy %xmm2
233 // %xmm2<def> = copy %xmm0
235 // %xmm2<def> = copy %xmm9
238 // Remember Def is defined by the copy.
246 // it's no longer available for copy propagation.
254 // Not a copy.
274 // If 'Reg' is defined by a copy, the copy is no longer a candidate
279 DEBUG(dbgs() << "MCP: Copy is used - not dead: "; CI->second->dump());
283 // Treat undef use like defs for copy propagation but not for
284 // dead copy. We would need to do a liveness check to be sure the copy
310 DEBUG(dbgs() << "MCP: Removing copy due to regmask clobbering: ";
333 // Any previous copy definition or reading the Defs is no longer available.