mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
[PowerPC/QPX] Fix the load/splat peephole with overlapping reads
If, in between the splat and the load (which does an implicit splat), there is a read of the splat register, then that register must have another earlier definition. In that case, we can't replace the load's destination register with the splat's destination register. Unfortunately, I don't have a small or non-fragile test case. llvm-svn: 268152
This commit is contained in:
parent
bc689dbffb
commit
724aac3fce
@ -130,7 +130,15 @@ bool PPCQPXLoadSplat::runOnMachineFunction(MachineFunction &MF) {
|
||||
}
|
||||
}
|
||||
|
||||
if (MI->modifiesRegister(SplatReg, TRI)) {
|
||||
// If this instruction defines the splat register, then we cannot move
|
||||
// the previous definition above it. If it reads from the splat
|
||||
// register, then it must already be alive from some previous
|
||||
// definition, and if the splat register is different from the source
|
||||
// register, then this definition must not be the load for which we're
|
||||
// searching.
|
||||
if (MI->modifiesRegister(SplatReg, TRI) ||
|
||||
(SrcReg != SplatReg &&
|
||||
MI->readsRegister(SplatReg, TRI))) {
|
||||
SI = Splats.erase(SI);
|
||||
continue;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user