diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-23 16:43:08 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-11-01 00:40:57 +0100 |
| commit | 226b62bc2ee4779447ce788d83aa0b409e384ec8 (patch) | |
| tree | ace913c378dd4085c34112c9e8602a7b39f75c27 /validation/optim | |
| parent | 594c7389969f79919f1170693c970fb25b8bfe4d (diff) | |
| download | sparse-dev-226b62bc2ee4779447ce788d83aa0b409e384ec8.tar.gz | |
eval_insn: give an explicit type to compare's operands
The return type of IR instructions is stored in the field
::type of struct instruction and this struct has no space
to hold the type of the operand(s). This is not a problem
for most instructions because there is an easy way to get
the operands' type. For example, for binops both types
must be the same so they are used interchangeably.
However, for compare instructions both types can be different
and there is no easy way to get the type of the operands.
Currently, this is ignored and creates some errors. It
also blocks simplifications that need this type information.
But compares instructions need only 2 operands, there is
thus one 'slot' left. So, use this slot for the operands' type.
This solves the current errors, allows new simplifications
and has very little impact on existing code. Of course,
this type information needs now to be tracked and adjusted
whenever the operands change or an instruction is changed
into a compare.
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/optim')
| -rw-r--r-- | validation/optim/cmp-type0.c | 1 | ||||
| -rw-r--r-- | validation/optim/cmp-type1.c | 1 |
2 files changed, 0 insertions, 2 deletions
diff --git a/validation/optim/cmp-type0.c b/validation/optim/cmp-type0.c index ab9d53d4..15115b9f 100644 --- a/validation/optim/cmp-type0.c +++ b/validation/optim/cmp-type0.c @@ -6,7 +6,6 @@ static int foo(long long a) /* * check-name: cmp-type0 * check-command: test-linearize $file - * check-known-to-fail * * check-output-ignore * check-output-returns: 1 diff --git a/validation/optim/cmp-type1.c b/validation/optim/cmp-type1.c index ee0bd75a..6df6376b 100644 --- a/validation/optim/cmp-type1.c +++ b/validation/optim/cmp-type1.c @@ -9,7 +9,6 @@ int foo(void) /* * check-name: cmp-type1 * check-command: test-linearize -Wno-decl $file - * check-known-to-fail * * check-output-ignore * check-output-returns: 1 |
