gimplifying via force_gimple_operand
@end enumerate
-To address these the project introduces a simple domain specific language
+To address these the project introduces a simple domain-specific language
to write expression simplifications from which code targeting GIMPLE
and GENERIC is auto-generated. The GENERIC variant follows the
fold_buildN API while for the GIMPLE variant and to address 2) new
@deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, gimple_seq *, tree (*)(tree))
@deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, tree, gimple_seq *, tree (*)(tree))
@deftypefnx {GIMPLE function} tree gimple_simplify (enum built_in_function, tree, tree, tree, tree, gimple_seq *, tree (*)(tree))
-The main GIMPLE API entry to the expression simplifications mimicing
+The main GIMPLE API entry to the expression simplifications mimicking
that of the GENERIC fold_@{unary,binary,ternary@} functions.
@end deftypefn
@end deftypefn
-Ontop of these a @code{fold_buildN}-like API for GIMPLE is introduced:
+On top of these a @code{fold_buildN}-like API for GIMPLE is introduced:
@deftypefn {GIMPLE function} tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree (*valueize) (tree) = NULL);
@deftypefnx {GIMPLE function} tree gimple_build (gimple_seq *, location_t, enum tree_code, tree, tree, tree, tree (*valueize) (tree) = NULL);
@section The Language
@cindex The Language
-The language to write expression simplifications in resembles other
-domain-specific languages GCC uses. Thus it is lispy. Lets start
-with an example from the match.pd file:
+The language in which to write expression simplifications resembles
+other domain-specific languages GCC uses. Thus it is lispy. Let's
+start with an example from the match.pd file:
@smallexample
(simplify
@code{@@n} denotes a so-called capture. It captures the operand and lets
you refer to it in other places of the match-and-simplify. In the
-above example it is refered to in the replacement expression. Captures
+above example it is referred to in the replacement expression. Captures
are @code{@@} followed by a number or an identifier.
@smallexample
@end smallexample
In this example @code{@@0} is mentioned twice which constrains the matched
-expression to have two equal operands. Usually matches are constraint
-to equal types. If operands may be constants and conversions are involved
+expression to have two equal operands. Usually matches are constrained
+to equal types. If operands may be constants and conversions are involved,
matching by value might be preferred in which case use @code{@@@@0} to
-denote a by value match and the specific operand you want to refer to
+denote a by-value match and the specific operand you want to refer to
in the result part. This example also introduces
operands written in C code. These can be used in the expression
replacements and are supposed to evaluate to a tree node which has to
Here @code{@@0} captures the first operand of the trunc_mod expression
which is also predicated with @code{integer_zerop}. Expression operands
may be either expressions, predicates or captures. Captures
-can be unconstrained or capture expresions or predicates.
+can be unconstrained or capture expressions or predicates.
This example introduces an optional operand of simplify,
the if-expression. This condition is evaluated after the
@end smallexample
In the above example, @code{@@2} captures the result of the expression
-@code{(addr @@0)}. For outermost expression only its type can be captured,
-and the keyword @code{type} is reserved for this purpose. The above
-example also gives a way to conditionalize patterns to only apply
+@code{(addr @@0)}. For the outermost expression only its type can be
+captured, and the keyword @code{type} is reserved for this purpose. The
+above example also gives a way to conditionalize patterns to only apply
to @code{GIMPLE} or @code{GENERIC} by means of using the pre-defined
preprocessor macros @code{GIMPLE} and @code{GENERIC} and using
preprocessor directives.
So this example iterates over @code{plus}, @code{minus}, @code{mult}
and @code{trunc_div}.
-Using operator lists can also remove the need to explicitely write
+Using operator lists can also remove the need to explicitly write
a @code{for}. All operator list uses that appear in a @code{simplify}
-or @code{match} pattern in operator positions will implicitely
+or @code{match} pattern in operator positions will implicitly
be added to a new @code{for}. For example
@smallexample
@code{type} needs to be an identifier that refers to the desired type.
Usually the types of the generated result expressions are
determined from the context, but sometimes like in the above case
-it is required that you specify them explicitely.
+it is required that you specify them explicitly.
Another modifier for generated expressions is @code{!} which
tells the machinery to only consider the simplification in case
including predicates you declare yourself with @code{match}.
Predicates available from the GCC middle-end need to be made
-available explicitely via @code{define_predicates}:
+available explicitly via @code{define_predicates}:
@smallexample
(define_predicates