History log of /art/test/442-checker-constant-folding/src/Main.java
Revision Date Author Comments
138b48583fa89e8ced7513f2f6a2548e79273db9 31-Aug-2017 Alan Leung <acleung@google.com> Make checker-constant-folding less dexer dependent.

In IntAddition2, D8 either folds everything or folds nothing depending
on locals debug information. Furthermore, it likes to use 3 registers
when local debug information is needed.

Bug: 65168732
Test: art/test/run-test ... 442-checker-constant-folding

Change-Id: I72adec8f55db005c9fcae63d8b5db344cc91c00d
bd44132f680430d44790015b42edffc05797e19c 23-Jun-2017 Igor Murashkin <iam@google.com> test: Fix 4 checker tests to pass with javac/dx

Acts as a partial revert of commit f02c3cf66c2c24533f6da43970e7b766b2ca9938.

Revert only the failing javac/dx checker tests. Update files to match
new checker syntax
(e.g. constant_folding_after_inling -> constant_folding$after_inlining).

Add build scripts to force these tests to use javac/dx even if
the platform build was using jack.

Fixes following tests:
* 442-checker-constant-folding
* 450-checker-types
* 463-checker-boolean-simplifier
* 537-checker-inline-and-unverified

Bug: 62950048
Bug: 36902714
Change-Id: I89dc039e3746b4b9f7d3eced43d1e0113662e812
a341f352ca944d848ebf39b54d0ad353ff9ebaff 31-Aug-2016 Vladimir Marko <vmarko@google.com> Constant fold Equal/NotEqual between null and non-null.

Test: Add new test cases to 442-checker-constant-folding.
Test: m test-art-host
Change-Id: I14509d5e13d30a66b3c2ac3d76d514f58501c9ab
5319d3cca5a9b8e9e3f59421818272b966575172 02-Aug-2016 Wojciech Staszkiewicz <staszkiewicz@google.com> Implement running user defined list of passes

This change introduces new dex2oat switch --run-passes=. This switch
accepts path to a text file with names of passes to run.
Compiler will run optimization passes specified in the file rather
then the default ones.

There is no verification implemented on the compiler side. It is user's
responsibility to provide a list of passes that leads to successful
generation of correct code. Care should be taken to prepare a list
that satisfies all dependencies between optimizations.

We only take control of the optional optimizations. Codegen (builder),
and all passes required for register allocation will run unaffected
by this mechanism.

Change-Id: Ic3694e53515fefcc5ce6f28d9371776b5afcbb4f
f02c3cf66c2c24533f6da43970e7b766b2ca9938 29-Feb-2016 David Brazdil <dbrazdil@google.com> ART: Switch Checker run-tests to Jack

Bug: 25635944
Change-Id: Ic6774028025b51f54589e9625003e8f69cf39dea
31dd3d60491148d345c1edae1ccd090a1b67dd2b 16-Feb-2016 Roland Levillain <rpl@google.com> Extend constant folding to float and double operations.

Change-Id: I2837064b2ceea587bc171fc520507f13355292c6
74eb1b264691c4eb399d0858015a7fc13c476ac6 14-Dec-2015 David Brazdil <dbrazdil@google.com> ART: Implement HSelect

This patch adds a new HIR instruction to Optimizing. HSelect returns
one of two inputs based on the outcome of a condition.

This is only initial implementation which:
- defines the new instruction,
- repurposes BooleanSimplifier to emit it,
- extends InstructionSimplifier to statically resolve it,
- updates existing code and tests accordingly.

Code generators currently emit fallback if/then/else code and will be
updated in follow-up CLs to use platform-specific conditional moves
when possible.

Change-Id: Ib61b17146487ebe6b55350c2b589f0b971dcaaee
57e863c3739c310380e19252ad5746ff08d219c7 11-Jan-2016 David Brazdil <dbrazdil@google.com> ART: Do not build Checker tests with `dx --no-optimize`

Change-Id: Ice9298b92cde5486db40ccdef43cca6d36179d2c
9e23df5c21bed53ead79e3131b67105abc8871e4 10-Nov-2015 Vladimir Marko <vmarko@google.com> Optimizing: Improve constant folding + DCE for inlining.

Run constant folding before DCE in inliner to eliminate more
code that can prevent inlining. Improve the constant folding
to evaluate Equals and NotEquals for null inputs.

Change-Id: I876ffb903ef39484370b6c8793f0f8467a977362
9867bc722f7c41e07a95397bc08b790cd21dc758 05-Aug-2015 Roland Levillain <rpl@google.com> Have constant folding be more flexible.

- Have Evaluate methods take as argument(s) and return value
instances of HConstant (instead of built-in 32- or 64-bit
integer values), to let the evaluated instruction choose
the type of the statically evaluated node; for instance,
art::HEqual::Evaluate shall return a HIntConstant
node (as implementation of a Boolean constant) whatever
the type of its inputs (a pair of HIntConstant or a pair
of HLongConstant).
- Split the evaluation job from the operation logic: the
former is addressed by Evaluate methods, while the latter
is done by a generic Compute method.
- Adress valid BinOp(int, long) and BinOp(long, int) cases.
- Add a constructor to art::HIntConstant to build an integer
constant from a `bool` value.

Change-Id: If84b6fe8406bb94ddb1aa8b02e36628dff526db3
c90bc7c07f9bd24b5424cfb1e3f064fbae5334d6 11-Dec-2014 Roland Levillain <rpl@google.com> Add constant folding for long unary operations in opt. compiler.

Add tests to exercise the constant folding of these
instructions.

Also, prevent Java methods from run-tests exercising the
code generation of these instruction from being inlined,
so that they continue to check the generated code (and
not the code produced by the constant folding pass).

Change-Id: I28efca7cdb5142ac2b6d158ba296fb9136d62481
f7746ad0063b02f19f3448c5ef4db7e4925d4f16 22-Jul-2015 Roland Levillain <rpl@google.com> Exercise constant folding of int & long mul, div and rem.

Change-Id: Ic70b56dbcb4a660a4c8ca04f7b2b5201ad29952a
6a92a033c33e383541d77607fbe8cd982875d13d 23-Jul-2015 Roland Levillain <rpl@google.com> Cosmetic changes in ART run-tests.

Perform a copyright headers clean up mostly.

Change-Id: I26c855b2f54d0887676d9b9b8281b14b7978ab29
b65eb5058dd6178d329e51e9dfd6d8cf58c6a0bb 23-Jul-2015 Roland Levillain <rpl@google.com> Fix & add Checker assertions in 442-checker-constant-folding.

Change-Id: Id4165b14816c04961d5c274f24861d0e7856d95e
a06d66a4ee60926127b9498b7ff0b3e37a24fccf 28-May-2015 David Brazdil <dbrazdil@google.com> ART: Distinguish Checker lines from comments

In order to prevent tests passing due to lines with hard-to-spot
formatting errors begin ignored, e.g. by forgetting the colon after
"//CHECK", Checker will now require its assertions to start with "///"
or "##", respectivelly for Java and Smali. Such lines will never be
ignored and will fail the test unless successfully parsed.

Change-Id: I0da9a8f13eb96d950af8c85df17d1899a853a299
c57397b2b87c7e6f28f4eee3c996d091e7dc0b01 15-May-2015 David Brazdil <dbrazdil@google.com> ART: Print C1vis lists as [v1,...,vN]

Checker interprets whitespace as a don't-care placeholder, making it
easier to write assertions which test only parts of the output (e.g.
"//CHECK: Add liveness:44" does not test the inputs or any other
attributes apart from "liveness").

However, since the GraphVisualizer prints lists with elements
separated by spaces ("[ v1 ... vN ]"), this allows for false positives
caused by an occurrence elsewhere in the output. For example, the
assertion: "//CHECK: [ x y ]" will match "[ x y ]" but also
"[ x a y b ]" or even "[ x ] abc [ y ]".

Switching to comma-separated lists works around this issue.

This patch updates all test files, fixes one false positive that this
change revealed (test 442, line 337) and two occurrences of a wrong
match (test 462, lines 121, 149).

Bug: 21189305
Change-Id: I3b22503be3d92529dac0b13f66bccbcfabea6721
c2c48ffdd623b4e58b34115d1521b0988a42b217 15-May-2015 David Brazdil <dbrazdil@google.com> ART: Change Checker syntax for variables

This patch changes the syntax for defining and referencing variables
from square brackets '[[VAR]]' to angle brackets '<<VAR>>'. This is
done in order to avoid clashes when matching against lists enclosed
in square brackets.

Change-Id: Ib9560b07bdc7bd641fd1eb6143c0063e0783f1eb
e82549b14c7def0a45461183964f7e6a34cbb70c 06-May-2015 Mark Mendell <mark.p.mendell@intel.com> [optimizing] Fold HTypeConversion of constants

While looking into optimizing long shifts on x86, I found that the
compiler wasn't folding HTypeConversion of constants. Add simple
conversions of constants, taking care of float/double values
with NaNs and small/large values, ensuring Java conversion semantics.

Add checker cases to see that constant folding of HTypeConversion is
done.

Ensure 422-type-conversion type conversion routiness don't get
inlined to avoid compile time folding.

Change-Id: I5a4eb376b64bc4e41bf908af5875bed312efb228
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
3b55ebb22156e1f3496cd1ee4a05e03b4780e579 08-May-2015 Roland Levillain <rpl@google.com> Simplify floating-point comparisons with NaN in Optimizing.

This change was suggested by Ian.

Also, simplify some art::HFloatConstant and
art::HDoubleConstant methods.

Change-Id: I7908df23581a7f61c8ec79c290fe5f70798ac3be
b2fd7bca70b580921eebf7c45769c39d2dfd8a5a 11-Mar-2015 Alexandre Rames <alexandre.rames@arm.com> Opt compiler: Basic simplification for arithmetic operations.

The optimisations in this patch do not look further than the
inputs of each operation.

Change-Id: Iddd0ab6b360b9e7bb042db22086d51a31be85530
4846d13744f07e82571d2882acc823d811ec942d 15-Jan-2015 David Brazdil <dbrazdil@google.com> ART: Invoke Checker from run-test scripts

This patch moves Checker-based tests of the optimizing compiler into
the art/test directory and modifies the run-test scripts to dump
the CFG during compilation and to verify the graph using Checker as
part of the "running" stage. Outputs generated by running the test
and running Checker are concatenated and compared with expected.txt.

Checker is invoked only if the test's name name matches the format
"<number>-checker-*" and it's currently enabled only for optimizing +
host configs. The tests are still invoked on other configs but
without Checker.

Change-Id: Ib24da808cd4bca66f07e0dbeb913a418065f2859