I observed that we fail to match patterns because when valueizing
sub-expression operands we fail to canonicalize operand order
and thus try matching (1 + a) - 1 instead of the canonical
(a + 1) - 1. The following fixes this at least for commutative
tree codes. For comparisons which we also cano
The patch also makes us allow to iterate over things in the predicate
position like
(for op (INTEGER_CST REAL_CST)
(simplify
(plus @0 op)
...
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to the
branch.
Richard.
2014-11-13 Richard Biener
* match.pd: Implement mor
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-10-29 Richard Biener
* tree-ssa-sccvn.c (try_to_simplify): Allow
gimple_fold_stmt_to_constant_1 to follow SSA use-def chains.
(visit_use): Likewise.
Index: gcc/tree-ssa-sccvn.c
==
Committed.
Richard.
2014-10-24 Richard Biener
* genmatch.c (capture_info::capture_info): Initialize
force_no_side_effects.
Index: gcc/genmatch.c
===
--- gcc/genmatch.c (revision 216594)
+++ gcc/genmatch.c
This is a second attempt - it fixes the bugs in the previous one
and handles falling back or not separately for the incoming arguments.
What we handle too conservatively right now is non-captured leafs
and captured expressions that are substituted into the result.
Both result in the incoming argu
On October 22, 2014 5:08:50 PM CEST, Jakub Jelinek wrote:
>On Wed, Oct 22, 2014 at 04:20:09PM +0200, Richard Biener wrote:
>> 2014-10-22 Richard Biener
>>
>> * genmatch.c (count_captures): New function.
>> (dt_simplify::gen): Handle preserving side-effects for
>> GENERIC code ge
On Wed, Oct 22, 2014 at 04:20:09PM +0200, Richard Biener wrote:
> 2014-10-22 Richard Biener
>
> * genmatch.c (count_captures): New function.
> (dt_simplify::gen): Handle preserving side-effects for
> GENERIC code generation.
> (decision_tree::gen_generic): Do not reject
On Wed, 22 Oct 2014, Richard Biener wrote:
>
> The following auto-handles preserving of side-effects properly
> for GENERIC simplification instead of simply rejecting operands
> with side-effects. Cases we cannot handle correctly are still
> handled that way.
>
> For example for
>
> /* (x | CS
The following auto-handles preserving of side-effects properly
for GENERIC simplification instead of simply rejecting operands
with side-effects. Cases we cannot handle correctly are still
handled that way.
For example for
/* (x | CST1) & CST2 -> (x & CST2) | (CST1 & CST2) */
(simplify
(bit_a
This adds a generic-match.h header to cover these (even though they
are not public API).
Richard.
2014-10-22 Richard Biener
* generic-match.h: New file.
* generic-match-head.c: Include generic-match.h, not gimple-match.h.
* fold-const.c: Include generic-match.h.
I am testing the following patch to add a location argument
to generic_simplify and properly build GENERIC trees with a
location (oops). The patch also implements special handling
for NON_LVALUE_EXPR by dropping it for GIMPLE and using
non_lvalue_loc to build it for GENERIC. This simplifies
impl
This refactors the code I added to fold_stmt to dispatch to
pattern-based folding to avoid long lines and make error
handling easier (no goto). It also uses the newly introduced
gimple_seq_discard to properly discard an unused simplification
result.
Bootstrapped on x86_64-unknown-linux-gnu, test
Lightly tested, committed.
Richard.
2014-10-17 Richard Biener
Merge from trunk r216316 through r216394.
On Fri, 17 Oct 2014, Richard Biener wrote:
> On Thu, 16 Oct 2014, Jeff Law wrote:
>
> > On 10/16/14 05:06, Richard Biener wrote:
> > >
> > > This patch (also applicable to trunk) makes us canoncialize operand
> > > order for comparisons at the same time we canonicalize other
> > > operand order,
On Thu, 16 Oct 2014, Jeff Law wrote:
> On 10/16/14 05:06, Richard Biener wrote:
> >
> > This patch (also applicable to trunk) makes us canoncialize operand
> > order for comparisons at the same time we canonicalize other
> > operand order, in particular before dispatching to generic_simplify.
> >
On 10/16/14 05:06, Richard Biener wrote:
This patch (also applicable to trunk) makes us canoncialize operand
order for comparisons at the same time we canonicalize other
operand order, in particular before dispatching to generic_simplify.
It also adds operand canonicalization to ternary ops and
Bootstrapped on x86_64-unknown-linux-gnu.
Richard.
2014-10-16 Richard Biener
Merge from trunk r216235 through r216315.
This patch (also applicable to trunk) makes us canoncialize operand
order for comparisons at the same time we canonicalize other
operand order, in particular before dispatching to generic_simplify.
It also adds operand canonicalization to ternary ops and adds
FMA_EXPR and DOT_PROD_EXPR to the list
This removes duplicate/not needed code from generic-match-head.c
and removes integral_op_p (if needed these new predicates should
go to tree.h). It also revers one unnecessary Makefile.in change.
Applied.
Richard.
2014-10-14 Richard Biener
* Makefile.in (BUILD_RTL): Revert not need
On Tue, 14 Oct 2014, Richard Biener wrote:
> On Tue, 14 Oct 2014, Richard Biener wrote:
>
> >
> > This changes default behavior of fold_stmt back to _not_ following
> > SSA use-def chains when trying to simplify things. I had to force
> > that already for one caller and for the merge to trunk I
On Tue, 14 Oct 2014, Richard Biener wrote:
>
> This changes default behavior of fold_stmt back to _not_ following
> SSA use-def chains when trying to simplify things. I had to force
> that already for one caller and for the merge to trunk I'd rather
> not track down issues in every other existin
This fixes an ICE that occurs when valueziation returns NULL and
we are looking at single-rhs REALPART_EXPR. We should check
for is_gimple_min_invariant before valueization.
Bootstrapped on x86_64-unknown-linux-gnu, applied.
Richard.
2014-10-14 Richard Biener
* genmatch.c (dt_opera
This updates it with changed/added features.
pfd-build checked and inspected, applied.
Richard.
2014-10-14 Richard Biener
* doc/match-and-simplify.texi: Update.
Index: gcc/doc/match-and-simplify.texi
===
--- gcc/doc/ma
This applies more comment / whitespace TLC to genmatch and does
minor refactoring on-the-fly.
Bootstrap running on x86_64-unknown-linux-gnu.
Richard.
2014-10-14 Richard Biener
* genmatch.c: Whitespace and comment fixes, some minor
refactoring.
Index: gcc/genmatch.c
This changes default behavior of fold_stmt back to _not_ following
SSA use-def chains when trying to simplify things. I had to force
that already for one caller and for the merge to trunk I'd rather
not track down issues in every other existing caller.
This means that fold_stmt will not become m
After internal discussion this changes
(match logical_inverted_value
(ne truth_valued_p@0 integer_onep)
(if (INTEGRAL_TYPE_P (TREE_TYPE (@0)))
(logical_inverted_value @0)))
to
(match (logical_inverted_value @0)
(ne truth_valued_p@0 integer_onep)
(if (INTEGRAL_TYPE_P (TREE_TYPE (@0)
t
On 09/26/2014 06:54 AM, Richard Biener wrote:
It also uncovers that the C++ FE uses a mix of NOP_EXPR and
CONVERT_EXPR both when building expressions and when checking
for them. Jason - is there any difference between NOP_EXPR and
CONVERT_EXPR as far as the C++ FE is concerned?
There are a few
This fixes a ??? and handles NOP_EXPR and CONVERT_EXPR matching
similar to GIMPLE by using CASE_CONVERT. This uncovers a
mismatch between fold-const.c and tree-ssa-forwprop.c transforms
which try to do opposite things with ((T) X) & CST vs.
(T) (X & CST). I have disabled the forwprop transform o
Bootstrapped on x86_64-unknown-linux-gnu, applied.
Richard.
2014-09-26 Richard Biener
* genmatch.c (struct dt_node): Merge gen_gimple and gen_generic
into gen, merge gen_gimple_kids and gen_generic_kids into
gen_kids.
(struct dt_operand): Likewise.
Index: gcc
Of course I missed c-exprs... The following patch fixes that.
Now bootstrapped (building stage3 target libs now).
Applied.
Richard.
2014-09-25 Richard Biener
* genmatch.c (struct c_expr): Also record capture identifier
to index map.
(c_expr::gen_transform): Use it.
The following makes us assign capture indexes dynamically which
easily allows handling of identifiers. I've used std::map
for this.
Applied.
Note that this may make debugging a little bit harder as
@0 now no longer necessarily corresponds to captures[0]
(I don't think it necessarily did before
$subject.
Still not the full-blown idea of dynamically assigning the (internal)
IDs from any number or identifier. Somebody said it would be nice
to write (plus @a @b) instead of (plus @1 @2).
Applied.
Richard.
2014-09-25 Richard Biener
* genmatch.c: Keep track of the maximum capt
The following wraps lexing and parsing into a parser class, simplifying
state management. It also removes the need to forward declare
matchers as we now keep a vector of them filled in declaration order.
Committed.
Richard.
2014-09-25 Richard Biener
* genmatch.c: Put all AST parsin
This shuffles routines around, grouping them properly and adding
function comments. Applies minor code TLC.
Applied.
Richard.
2014-09-25 Richard Biener
* genmatch.c: TLC.
Index: gcc/genmatch.c
===
--- gcc/genmatch.c
It no longer works in the face of (with { } which would
need to pass down all named temporaries. Instead we can
simply inline all C exprs now that we pass 'output' to all
gen_transform calls.
Boostrap pending on x86_64-unknown-linux-gnu.
Richard.
2014-09-24 Richard Biener
* ge
The following removes a bunch of code dealing with "late" verifying
of operator presence and matching arity. This can now all be
verified at parsing, giving proper locations and operator names.
Bootstrap pending.
Richard.
2014-09-24 Richard Biener
* genmatch.c (struct id_base): Mov
This delays for lowering by recording fors to apply in
simplify similar to how we record ifs.
Bootstrapped on x86_64-unknown-linux-gnu.
Richard.
2014-09-24 Richard Biener
* genmatch.c (id_base): Derive from typed_noop_remove.
(struct user_id): New id_base derivative.
The following implements very simple caret diagnostics. A
slow implementation is possible as we're only emitting
fatal errors (and thus at most one).
Committed.
Richard.
2014-09-23 Richard Biener
* genmatch.c (error_cb): Implement simple caret diagnostics.
Index: gcc/genmatch.c
==
This is a first cleanup step towards lowering for late, not during
parsing.
This intermediate step removes the e_operation indirection and
makes parse_for temporarily insert operators it defines so we
can avoid lazily accepting anything as user-defined and thus
report proper error locations.
Boo
This restructures outer if parsing to maintain a stack of active
ifs. This gets rid of all the reverse if stuff and fixes outer ifs
on (match ...)es.
What is left to be done is delaying 'for' lowering.
Richard.
2014-09-23 Richard Biener
* genmatch.c
(dt_simplify::gen): Adj
As promised this allows you to define custom predicate expressions
(or operators), like one modeled after
tree-ssa-forwprop.c:lookup_logical_inverted_value:
(match logical_inverted_value
(bit_not truth_valued_p@0)
(logical_inverted_value @0))
(match logical_inverted_value
(eq @0 integer_zerop
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-09-22 Richard Biener
* gimple-match-head.c (gimple_resimplify2): Also swap
comparison operands.
(gimple_simplify): Likewise.
Index: gcc/gimple-match-head.c
===
On Tue, 16 Sep 2014, Marc Glisse wrote:
> On Tue, 16 Sep 2014, Richard Biener wrote:
>
> > The following adds the ability to write predicates using patterns
> > with an example following negate_expr_p which already has a
> > use in comparison folding (via its if c-expr).
> >
> > The syntax is as
On Tue, 16 Sep 2014, Richard Biener wrote:
The following adds the ability to write predicates using patterns
with an example following negate_expr_p which already has a
use in comparison folding (via its if c-expr).
The syntax is as follows:
(match negate_expr_p
INTEGER_CST
(if (TYPE_OVERFLOW_
The following adds the ability to write predicates using patterns
with an example following negate_expr_p which already has a
use in comparison folding (via its if c-expr).
The syntax is as follows:
(match negate_expr_p
INTEGER_CST
(if (TYPE_OVERFLOW_WRAPS (type)
|| may_negate_without_ov
The following patch makes the parser know known predicates via
us defining them in match.pd with a new (define_predicates ...)
construct. This will allow (in a followup patch) to define
our own predicates via sth like
(match negate_expr_p
(negate @0))
(match negate_expr_p
INTEGER_CST@0
(if
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-09-16 Richard Biener
* genmatch.c (operator_id): Add tcc member.
(get_operand_type): New function, split out from ...
(expr::gen_transform): ... here. Treat comparisons
properly.
To get desired transforms from tree-ssa-forwprop.c which uses
fold_stmt.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-09-15 Richard Biener
* gimple-fold.c: Include tree-eh.c.
(fold_stmt_1): Handle GIMPLE_CONDs for gimple_simplify.
* gim
On Fri, 12 Sep 2014, Marc Glisse wrote:
> On Fri, 12 Sep 2014, Richard Biener wrote:
>
> > +/* x ^ ~0 -> ~x */
> > (simplify
> > (bit_and @0 integer_all_onesp)
> > @0)
>
> The comment doesn't seem to match.
Thanks - fixed below which also implements simplify_mult and
simplify_not_neg_expr.
On Fri, 12 Sep 2014, Richard Biener wrote:
+/* x ^ ~0 -> ~x */
(simplify
(bit_and @0 integer_all_onesp)
@0)
The comment doesn't seem to match.
--
Marc Glisse
Committed.
Richard.
2014-09-12 Richard Biener
* genmatch.c (expr::gen_transform): Properly autocompute
type of REALPART_EXPR and IMAGPART_EXPR.
Index: gcc/genmatch.c
===
--- gcc/genmatch.c (revision 215210)
And some more.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-09-12 Richard Biener
* match-bitwise.pd: Complete tree-ssa-forwprop.c patterns
from simplify_bitwise_binary. Implement some from fold_binary.
* match-constant-folding.pd: Add
On Thu, 11 Sep 2014, Marc Glisse wrote:
> /* ~A + 1 -> -A */
> (simplify
>(plus (bit_not @0) integer_onep@1)
>(if (TREE_CODE (TREE_TYPE (@1)) != COMPLEX_TYPE
> || (TREE_CODE (@1) == COMPLEX_CST
> && integer_onep (TREE_REALPART (@1))
> && integer_onep (TR
/* ~A + 1 -> -A */
(simplify
(plus (bit_not @0) integer_onep@1)
(if (TREE_CODE (TREE_TYPE (@1)) != COMPLEX_TYPE
|| (TREE_CODE (@1) == COMPLEX_CST
&& integer_onep (TREE_REALPART (@1))
&& integer_onep (TREE_IMAGPART (@1
(negate @0)))
the complex par
Applied.
Richard.
2014-09-11 Richard Biener
* match-plusminus.pd: Fix typo.
* match-conversions.pd: Add pattern for
simplify_conversion_from_bitmask.
Index: gcc/match-conversions.pd
===
--- gcc/match-con
More closely match-up to tree-ssa-forwprop.c code.
Committed.
Richard.
2014-09-11 Richard Biener
* match-plusminus.pd: More closely match tree-ssa-forwprop.c code.
Index: gcc/match-plusminus.pd
===
--- gcc/match-plusmi
On Thu, 11 Sep 2014, Marc Glisse wrote:
> On Thu, 11 Sep 2014, Richard Biener wrote:
>
> > + /* We can't reassociate floating-point or fixed-point plus or minus
> > +because of saturation to +-Inf. */
> > + (if (!FLOAT_TYPE_P (type) && !FIXED_POINT_TYPE_P (type))
>
> Do you remember if ther
On Thu, 11 Sep 2014, Richard Biener wrote:
+ /* We can't reassociate floating-point or fixed-point plus or minus
+because of saturation to +-Inf. */
+ (if (!FLOAT_TYPE_P (type) && !FIXED_POINT_TYPE_P (type))
Do you remember if there was a particular reason not to add
|| flag_associative
The following patch completes transitioning
tree-ssa-forwprop.c:associate_* to patterns.
Bootstrapped and tested on x86_64-unknown-linux-gnu.
Richard.
2014-09-11 Richard Biener
* match-plusminus.pd: Complete associate_plusminus patterns.
Properly guard all patterns. Add as
So I managed to re-introduce PR41043 by implementing the
fold_unary (T1)(X * Y) -> (T1)X * (T1)Y pattern on GIMPLE.
That is because it re-applies recursively on a large
multiplication tree and because if there are multiple uses
of SSA names doing that will expand (aka un-CSE) the
multiplication tr
The following adds dumping what patterns get applied with -details.
This is useful for tracking down which patterns cause a miscompile.
Applied.
Richard.
2014-09-11 Richard Biener
* genmatch.c (output_line_directive): Add variant for dump files.
(dt_simplify::gen): Write to
This completes match-builtins.pd by handling all builtin variants
in all present patterns. That requires a little more flexibility
in the 'for' handling to support for example
/* Optimize sqrt(expN(x)) = expN(x*0.5). */
(for expfn (BUILT_IN_EXP10F BUILT_IN_EXP10 BUILT_IN_EXP10L
B
Committed.
Richard.
2014-09-10 Richard Biener
* match-conversions.pd: Fix unsigned type used for
shortened multiplication.
Index: gcc/match-conversions.pd
===
--- gcc/match-conversions.pd(revision 215057)
++
This adds the capability to specify a type to be used when building
an expression.
Committed.
2014-09-09 Richard Biener
* genmatch.c (struct expr): Add expr_type member.
(expr::gen_transform): Honor explicitely specified type.
(parse_expr): Parse ':' on the operator a
The following patch makes use of the new multi-id for in builtin
math fn patterns related to POW to show how we can address the
usual triplets of fnF, fn, fnL simplifications with it. It's
still quite explicit of course.
The patch also supplies locations to some parser error calls
and removes a
The pattern (and the fold_unary code it was derived from) stripping
inner conversions from VIEW_CONVERT_EXPRs is bogus as in that it
doesn't make sure the the size of the types match. This triggers
a IL verification for gfortran.fortran-torture/compile/forall-1.f90
otherwise.
Committed to the br
The following patch adds more comparison patterns (with comments
on what is missing still).
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
Richard.
2014-09-02 Richard Biener
* fold-const.h (negate_expr_p): Declare.
* fold-const.c (negate_expr_p): Export.
Appearantly we didn't exercise this before and thus it has gone
unnoticed that we don't properly special case single-RHSs on
GIMPLE.
Fixed as follows.
Bootstrapped on x86_64-unknown-linux-gnu, applied.
Richard.
2014-09-02 Richard Biener
* gimple-match-head.c (maybe_build_generic_op
This completes conversion patterns (apart from commented case
which needs a new IL feature).
Bootstrapped on x86_64-unknown-linux-gnu, applied.
Richard.
2014-09-02 Richard Biener
* match-conversions.pd: Add more patterns.
Index: gcc/match-conversions.pd
Now as the fold_stmt re-org is merged from trunk this moves the
simplify dispatch first before doing the legacy stuff. It also
adds dumping to this place and removes dumping from
tree-ssa-forwprop.c (as there it catches all fold_stmt transforms
done). I now also dump the associated sequence whic
This tries to prevent NON_LVALUE_EXPR from leaking in to GIMPLE
(happens on trunk also, but mostly savaged by re-gimplifying
GENERIC folding results which strips them). We need a better
solution in the end (fix the C++ frontend), but for now the
following should fix things enough. (fingers cross
The following fixes a few ICEs and C++ testsuite fails.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-08-28 Richard Biener
* match-constant-folding.pd (x + 0 -> x): Wrap result in
a NON_LVALUE_EXPR to account for the C++ frontend folding
The following fixes type guessing by handling VIEW_CONVERT_EXPR
and by properly passing down "unknown" for outermost conversions.
Btw, a case where we need some explicit type specification support
is Convert (T1)(X * Y) into (T1)X * (T1)Y which needs to eventually
use an unsigned type for the mul
This fixes the segfaults when an unexpected EOF occurs.
Committed.
Richard.
2014-08-27 Richard Biener
* genmatch.c (peek): Fail at unexpected EOF.
(main): Do not peek at the next token as we do expect
EOF at some point.
Index: gcc/genmatch.c
The following fixes C++ testsuite FAILs. First in fold_binary
we should delay the dispatch to generic_simplify until after
const OP const folding which generic_simplify isn't supposed
to do. (I note that neither fold_unary nor fold_ternary has
such clear const operand path...)
Second, the C++ F
The following is needed to allow building libada if the conversion
simplifications go in. Currently IVOPTs replaces IV uses in
arbitrary order which can result in intermediate code that
still refers to IVs that are going to be removed. As it folds
replacement statements via force_gimple_operand
The following patch introduces a new syntax to initialize temporaries
used in c-exprs (such as if conditionals). So a simplify pattern is now
'simplify' [ ]
with
= | |
= '(' 'if' '(' ')' ')'
= '(' 'with' '{' '}' ')'
which allows nearly literal translation of
On Thu, 21 Aug 2014, Marc Glisse wrote:
> On Thu, 21 Aug 2014, Richard Biener wrote:
>
> > 2014-08-21 Richard Biener
> >
> > * match.pd ((T1)(~(T2) X) -> ~(T1) X): Paste all comment
> > from fold-const.c, fix simplification result.
> >
> > Index: gcc/match.pd
> >
On Thu, 21 Aug 2014, Richard Biener wrote:
2014-08-21 Richard Biener
* match.pd ((T1)(~(T2) X) -> ~(T1) X): Paste all comment
from fold-const.c, fix simplification result.
Index: gcc/match.pd
===
--- gcc/match.p
On Thu, 21 Aug 2014, Marc Glisse wrote:
> On Thu, 21 Aug 2014, Richard Biener wrote:
>
> > +/* From fold_unary. */
> > +
> > +/* (T1)(~(T2) X) -> ~(T1) X */
> > +(simplify
> > + (convert (bit_not@0 (convert @1)))
> > + (if (INTEGRAL_TYPE_P (type)
> > + && INTEGRAL_TYPE_P (TREE_TYPE (@0))
>
Committed.
Richard.
2014-08-21 Richard Biener
Merge from trunk r213754 through r214265.
On Thu, 21 Aug 2014, Richard Biener wrote:
+/* From fold_unary. */
+
+/* (T1)(~(T2) X) -> ~(T1) X */
+(simplify
+ (convert (bit_not@0 (convert @1)))
+ (if (INTEGRAL_TYPE_P (type)
+ && INTEGRAL_TYPE_P (TREE_TYPE (@0))
+ && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0))
+
This merges the two functions that have much in common and prettifies
the code-gen.
Committed.
Richard.
2014-08-21 Richard Biener
* genmatch.c (dt_simplify::gen): New function merged
from ...
(dt_simplify::gen_gimple, dt_simplify::gen_generic): ... these,
mad
This adds the capability to auto-guess the type of non-outermost
conversions by looking at the parent expression type. This also
adds fatal () to the cases we can't auto-detect.
Bootstrapped on x86_64-unknown-linux-gnu, testing in progress.
Richard.
2014-08-21 Richard Biener
* genm
This avoids matching loads in the signle-rhs matching logic.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-08-21 Richard Biener
* genmatch.c (dt_operand::gen_gimple_expr): Only match
non-reference-like GIMPLE single RHS.
Index: gcc/genmatch.c
=
On Wed, 20 Aug 2014, Marc Glisse wrote:
> On Wed, 20 Aug 2014, Richard Biener wrote:
>
> > On Wed, 20 Aug 2014, Marc Glisse wrote:
> >
> > > On Wed, 20 Aug 2014, Richard Biener wrote:
> > >
> > > > Committed.
> > > >
> > > > Also makes visible a desirable change I plan for if-exprs. They
> >
Committed.
Richard.
2014-08-20 Richard Biener
* match-and-simplify.texi: Fix errors during pdf build.
Index: gcc/doc/match-and-simplify.texi
===
--- gcc/doc/match-and-simplify.texi (revision 214220)
+++ gcc/doc/matc
$subject.
Bootstrap ongoing on x86_64-unknown-linux-gnu.
Richard.
2014-08-20 Richard Biener
* genmatch.c (copy_reverse): New function.
(parse_simplify): Support nested inner ifs.
* match-comparison.pd: Use nested inner ifs.
Index: match-and-simplify/gcc/genmatch.c
=
This changes inner ifs to have a result operand and to allow
a simplify pattern to have multiple such ifs, thus:
(simplify
(match-expression...)
(if (cond1)
result1)
(if (cond2)
result2)
...
resultdefault)
I'm not sure a default makes sense when a previous if failed
This refactors GIMPLE code-gen to use switch ()es similar to
the GENERIC version. This should provide all of the
backtracking avoidance we need (I think so at least).
Bootstrap and regtest ongoing on x86_64-unknown-linux-gnu.
Richard.
2014-08-20 Richard Biener
* genmatch.c (dt_node
On Wed, 20 Aug 2014, Richard Biener wrote:
On Wed, 20 Aug 2014, Marc Glisse wrote:
On Wed, 20 Aug 2014, Richard Biener wrote:
Committed.
Also makes visible a desirable change I plan for if-exprs. They
should behave like outer ifs and allow us to write that series
of pattern as
(for op in
Bootstrapped / tested on x86_64-unknown-linux-gnu, applied.
Richard.
2014-08-20 Richard Biener
* gimple-fold.c (fold_stmt_1): Use gsi_replace_with_seq_vops
helper to insert gimple_simplify result.
Index: gcc/gimple-fold.c
=
On Wed, 20 Aug 2014, Marc Glisse wrote:
> On Wed, 20 Aug 2014, Richard Biener wrote:
>
> > Committed.
> >
> > Also makes visible a desirable change I plan for if-exprs. They
> > should behave like outer ifs and allow us to write that series
> > of pattern as
> >
> > (for op in eq ne
> > /* Si
On Wed, 20 Aug 2014, Richard Biener wrote:
Committed.
Also makes visible a desirable change I plan for if-exprs. They
should behave like outer ifs and allow us to write that series
of pattern as
(for op in eq ne
/* Simplify X * C1 CMP 0 to X CMP 0 if C1 is not zero. */
(simplify
(op (mu
Committed.
Also makes visible a desirable change I plan for if-exprs. They
should behave like outer ifs and allow us to write that series
of pattern as
(for op in eq ne
/* Simplify X * C1 CMP 0 to X CMP 0 if C1 is not zero. */
(simplify
(op (mult @0 INTEGER_CST@1) integer_zerop@2)
Committed.
Richard.
2014-08-19 Richard Biener
* genmatch.c (dt_operand::gen_gimple): Remove excessive
braces.
(dt_operand::gen_generic): Likewise.
Index: gcc/genmatch.c
===
--- gcc/genmatch.c (revis
on the outermost level.
Committed.
Richard.
2014-08-19 Richard Biener
* genmatch.c (decision_tree::gen_gimple): Use a switch statement
for the outermost level.
* gimple-match.h (code_helper::get_rep): New method.
Index: gcc/genmatch.c
===
Applied.
Richard.
2014-08-19 Richard Biener
* genmatch.c (c_expr::output_code): New method.
(c_expr::gen_transform): Call it.
(outline_c_exprs): Likewise.
Index: gcc/genmatch.c
===
--- gcc/genmatch.c
This makes us accept
(plus @0 INTEGER_CST)
and parse it as (plus @0 (INTEGER_CST)), that is, handle operator
names in predicate position as expression with zero operands.
This makes those leafs better integrate with the decision tree
and also removes the need to define all those INTEGER_CST_P
p
We shouldn't use the type of the operand but the type requested.
This otherwise triggers asserts for (eq @0 @1) which requires
boolean type, not whatever type @0 has.
Applied.
Richard.
2014-08-19 Richard Biener
* genmatch.c (dt_simplify::gen_generic): Properly use the
specif
1 - 100 of 164 matches
Mail list logo