Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
8299dd5c
Commit
8299dd5c
authored
Aug 11, 2015
by
Nathan Sidwell
Committed by
Nathan Sidwell
Aug 11, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* tree-vrp.c (simplify_abs_using_ranges): Simplify.
From-SVN: r226779
parent
a6810021
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
21 deletions
+11
-21
gcc/ChangeLog
+2
-0
gcc/tree-vrp.c
+9
-21
No files found.
gcc/ChangeLog
View file @
8299dd5c
2015
-
08
-
11
Nathan
Sidwell
<
nathan
@
acm
.
org
>
*
tree
-
vrp
.
c
(
simplify_abs_using_ranges
):
Simplify
.
*
tree
-
ssa
-
phiopt
.
c
(
minmax_replacement
):
Create
new
ssa
name
if
we
're not the only contributor to target phi.
...
...
gcc/tree-vrp.c
View file @
8299dd5c
...
...
@@ -9152,37 +9152,25 @@ simplify_div_or_mod_using_ranges (gimple stmt)
static
bool
simplify_abs_using_ranges
(
gimple
stmt
)
{
tree
val
=
NULL
;
tree
op
=
gimple_assign_rhs1
(
stmt
);
tree
type
=
TREE_TYPE
(
op
);
value_range_t
*
vr
=
get_value_range
(
op
);
if
(
TYPE_UNSIGNED
(
type
))
{
val
=
integer_zero_node
;
}
else
if
(
vr
)
if
(
vr
)
{
tree
val
=
NULL
;
bool
sop
=
false
;
val
=
compare_range_with_value
(
LE_EXPR
,
vr
,
integer_zero_node
,
&
sop
);
if
(
!
val
)
{
/* The range is neither <= 0 nor > 0. Now see if it is
either < 0 or >= 0. */
sop
=
false
;
val
=
compare_range_with_value
(
GE
_EXPR
,
vr
,
integer_zero_node
,
val
=
compare_range_with_value
(
LT
_EXPR
,
vr
,
integer_zero_node
,
&
sop
);
if
(
val
)
{
if
(
integer_zerop
(
val
))
val
=
integer_one_node
;
else
if
(
integer_onep
(
val
))
val
=
integer_zero_node
;
}
}
if
(
val
&&
(
integer_onep
(
val
)
||
integer_zerop
(
val
)))
if
(
val
)
{
if
(
sop
&&
issue_strict_overflow_warning
(
WARN_STRICT_OVERFLOW_MISC
))
{
...
...
@@ -9198,10 +9186,10 @@ simplify_abs_using_ranges (gimple stmt)
}
gimple_assign_set_rhs1
(
stmt
,
op
);
if
(
integer_onep
(
val
))
gimple_assign_set_rhs_code
(
stmt
,
NEGATE_EXPR
);
else
if
(
integer_zerop
(
val
))
gimple_assign_set_rhs_code
(
stmt
,
SSA_NAME
);
else
gimple_assign_set_rhs_code
(
stmt
,
NEGATE_EXPR
);
update_stmt
(
stmt
);
return
true
;
}
...
...
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