Chromium Code Reviews| Index: src/IceTargetLoweringX86BaseImpl.h |
| diff --git a/src/IceTargetLoweringX86BaseImpl.h b/src/IceTargetLoweringX86BaseImpl.h |
| index 245861cce9e7aac0533bc3f49570f1248a0c6168..73c0075ad26c5de9cca67979823ca1426c151ae5 100644 |
| --- a/src/IceTargetLoweringX86BaseImpl.h |
| +++ b/src/IceTargetLoweringX86BaseImpl.h |
| @@ -3804,6 +3804,10 @@ void TargetX86Base<Machine>::lowerMemset(Operand *Dest, Operand *Val, |
| // eax, ax and al. |
| if (IsCountConst && IsValConst) { |
| Variable *Base = legalizeToReg(Dest); |
| + // Add a FakeUse in case Base is ultimately not used, e.g. it falls back to |
| + // calling memset(). Otherwise Om1 register allocation fails because this |
| + // infinite-weight variable has a definition but no uses. |
| + Context.insert(InstFakeUse::create(Func, Base)); |
|
ascull
2015/08/05 23:15:16
I'm doing some refactoring as I'm writing memcpy s
Jim Stichnoth
2015/08/05 23:22:30
That sounds great, thanks!
I originally tried to
|
| // 3 is the awkward size as it is too small for the vector or 32-bit |
| // operations and will not work with lowerLeftOvers as there is no valid |