Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(28)

Unified Diff: src/IceTargetLoweringX86BaseImpl.h

Issue 1272823004: Subzero: Fix an Om1 crash from memset lowering. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add a comment. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/nacl-mem-intrinsics.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/nacl-mem-intrinsics.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698