Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000159 [libFirm] x86 ia32 backend feature N/A 2015-10-01 22:38 2016-01-18 22:22
Reporter Matze View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version
Summary 0000159: Use mul flags for overflow checking
Description 13:25 < dalias> | hey
13:25 < dalias> | interesting optimization i'd like to see in firm:
13:26 < dalias> | if (a > INT_MAX/b) goto error; else c = a*b;
13:26 < dalias> | optimized to mul, branch on overflow
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000233)
Matze (administrator)
2015-10-01 22:44

Some brainstorming from my side on how to implement it:
Match the Cmp and the Mul in some sort of late-localopt and replace both with a ia32_l_Mul
(This is probably the first time where we have a localopt rule matching 2 nodes and replacing it with a single mode_T node so we may need some enhancements to localopt to support that or in the worst case create a new pass for such situations)
(0000257)
Tron (administrator)
2016-01-18 22:22

We could always do the transformation 'a > INT_MAX/b' -> 'a * b with overflow check'.
This is cheaper than doing the division.

- Issue History
Date Modified Username Field Change
2015-10-01 22:38 Matze New Issue
2015-10-01 22:44 Matze Note Added: 0000233
2016-01-18 22:22 Tron Note Added: 0000257
2016-01-18 22:22 Tron Severity minor => feature


Mantis 1.1.5[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker