diff options
| author | Tobias Grosser <tobias@grosser.es> | 2015-06-03 06:31:30 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2015-06-03 06:31:30 +0000 |
| commit | cb73f150d4dee783784b5c3bb9deac4d3357624a (patch) | |
| tree | 8d4b46ce7e30c33debf031afeb6cd4ee4a01330a /clang/lib/Format/UnwrappedLineFormatter.cpp | |
| parent | dc9293d051e290ed3f3438a082cbf0d10c773245 (diff) | |
| download | bcm5719-llvm-cb73f150d4dee783784b5c3bb9deac4d3357624a.tar.gz bcm5719-llvm-cb73f150d4dee783784b5c3bb9deac4d3357624a.zip | |
Translate power-of-two floor-division into ashr
Power-of-two floor divisions can be translated into an arithmetic shift
operation. This allows us to replace a complex lowering that requires division
operations:
%pexp.fdiv_q.0 = sub i64 %21, 128
%pexp.fdiv_q.1 = add i64 %pexp.fdiv_q.0, 1
%pexp.fdiv_q.2 = icmp slt i64 %21, 0
%pexp.fdiv_q.3 = select i1 %pexp.fdiv_q.2, i64 %pexp.fdiv_q.1, i64 %21
%pexp.fdiv_q.4 = sdiv i64 %pexp.fdiv_q.3, 128
with a simple ashr:
%polly.fdiv_q.shr = ashr i64 %21, 7
llvm-svn: 238905
Diffstat (limited to 'clang/lib/Format/UnwrappedLineFormatter.cpp')
0 files changed, 0 insertions, 0 deletions

