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

Unified Diff: LOWERING.rst

Issue 1020853011: Subzero: Fix a lowering bug involving xchg and xadd instructions. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Similar for cmpxchg and cmpxchg8b. Add documentation. Created 5 years, 9 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 | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LOWERING.rst
diff --git a/LOWERING.rst b/LOWERING.rst
index d51cd467b901e15e1d1eea836c62ec4ef8ef98dd..190ff2393b0c52565e3275857c7d43b5a6a520e4 100644
--- a/LOWERING.rst
+++ b/LOWERING.rst
@@ -218,3 +218,22 @@ instruction. Using pseudocode::
If ``v_result_high`` is live but ``v_result_low`` is dead, adding ``t1`` as an
argument to ``InstFakeDef`` suffices to keep the ``call`` instruction live.
+
+Instructions modifying source operands
+--------------------------------------
+
+Some native instructions may modify one or more source operands. For example,
+the x86 ``xadd`` and ``xchg`` instructions modify both source operands. Some
+analysis needs to identify every place a ``Variable`` is modified, and it uses
+the presence of a ``Dest`` variable for this analysis. Since ICE instructions
+have at most one ``Dest``, the ``xadd`` and ``xchg`` instructions need special
+treatment.
+
+A ``Variable`` that is not the ``Dest`` can be marked as modified by adding an
+``InstFakeDef``. However, this is not sufficient, as the ``Variable`` may have
+no more live uses, which could result in the ``InstFakeDef`` being dead-code
+eliminated. The solution is to add an ``InstFakeUse`` as well.
+
+To summarize, for every source ``Variable`` that is not equal to the
+instruction's ``Dest``, append an ``InstFakeDef`` and ``InstFakeUse``
+instruction to provide the necessary analysis information.
« no previous file with comments | « no previous file | src/IceTargetLoweringX8632.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698