Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Zwinkau
libfirm
Commits
cf930869
Commit
cf930869
authored
Sep 10, 2006
by
Michael Beck
Browse files
add config.h to allow Win32 compile
add missing #endif cleaned up pnc handling [r8202]
parent
ac1022e7
Changes
2
Hide whitespace changes
Inline
Side-by-side
ir/opt/condeval.c
View file @
cf930869
#include <assert.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_ALLOCA_H
#include <alloca.h>
#endif
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#include <assert.h>
#include "array.h"
#include "debug.h"
#include "ircons.h"
...
...
@@ -9,6 +19,9 @@
DEBUG_ONLY
(
static
firm_dbg_module_t
*
dbg
);
/**
* Block-walker:
*/
static
void
cond_eval
(
ir_node
*
block
,
void
*
env
)
{
int
n_block
=
get_Block_n_cfgpreds
(
block
);
...
...
@@ -73,6 +86,7 @@ static void cond_eval(ir_node* block, void* env)
tarval
*
tv_cnst
;
ir_node
**
ins
;
int
k
;
pn_Cmp
cmp_val
;
pred
=
get_Phi_pred
(
phi
,
j
);
// TODO handle Phi cascades
...
...
@@ -81,33 +95,11 @@ static void cond_eval(ir_node* block, void* env)
tv_phi
=
get_Const_tarval
(
pred
);
tv_cnst
=
get_Const_tarval
(
cnst
);
switch
(
tarval_cmp
(
tv_phi
,
tv_cnst
))
{
case
pn_Cmp_Lt
:
if
(
pnc
!=
pn_Cmp_Lt
&&
pnc
!=
pn_Cmp_Le
&&
pnc
!=
pn_Cmp_Lg
)
{
continue
;
}
break
;
case
pn_Cmp_Eq
:
if
(
pnc
!=
pn_Cmp_Le
&&
pnc
!=
pn_Cmp_Ge
&&
pnc
!=
pn_Cmp_Eq
)
{
continue
;
}
break
;
case
pn_Cmp_Gt
:
if
(
pnc
!=
pn_Cmp_Gt
&&
pnc
!=
pn_Cmp_Ge
&&
pnc
!=
pn_Cmp_Lg
)
{
continue
;
}
break
;
default:
continue
;
}
cmp_val
=
tarval_cmp
(
tv_phi
,
tv_cnst
);
if
(
cmp_val
==
pn_Cmp_False
)
continue
;
if
((
cmp_val
&
pnc
)
!=
cmp_val
)
continue
;
DB
((
dbg
,
LEVEL_1
,
...
...
@@ -132,6 +124,7 @@ static void cond_eval(ir_node* block, void* env)
void
opt_cond_eval
(
ir_graph
*
irg
)
{
FIRM_DBG_REGISTER
(
dbg
,
"firm.opt.condeval"
);
firm_dbg_set_mask
(
dbg
,
SET_LEVEL_5
);
DB
((
dbg
,
LEVEL_1
,
"===> Performing condition evaluation on %+F
\n
"
,
irg
));
...
...
ir/opt/condeval.h
View file @
cf930869
...
...
@@ -2,3 +2,5 @@
#define FIRM_COND_EVAL_H
void
opt_cond_eval
(
ir_graph
*
irg
);
#endif
/* FIRM_COND_EVAL_H */
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment