summaryrefslogtreecommitdiffstats
path: root/lldb/scripts/Python/prepare_binding_Python.py
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2015-11-19 16:37:10 +0000
committerSanjay Patel <spatel@rotateright.com>2015-11-19 16:37:10 +0000
commit4699b8ab6acf76e595bfb4d525484df7a113f63f (patch)
tree3fda9e24dfe1a0212dbab8d1c4341d2f6dbae348 /lldb/scripts/Python/prepare_binding_Python.py
parentdcc2500452746939988c613e2b6d00513dc2ab3e (diff)
downloadbcm5719-llvm-4699b8ab6acf76e595bfb4d525484df7a113f63f.tar.gz
bcm5719-llvm-4699b8ab6acf76e595bfb4d525484df7a113f63f.zip
[CGP] despeculate expensive cttz/ctlz intrinsics
This is another step towards allowing SimplifyCFG to speculate harder, but then have CGP clean things up if the target doesn't like it. Previous patches in this series: http://reviews.llvm.org/D12882 http://reviews.llvm.org/D13297 D13297 should catch most expensive ops, but speculation of cttz/ctlz requires special handling because of weirdness in the intrinsic definition for handling a zero input (that definition can probably be blamed on x86). For example, if we have the usual speculated-by-select expensive op pattern like this: %tobool = icmp eq i64 %A, 0 %0 = tail call i64 @llvm.cttz.i64(i64 %A, i1 true) ; is_zero_undef == true %cond = select i1 %tobool, i64 64, i64 %0 ret i64 %cond There's an instcombine that will turn it into: %0 = tail call i64 @llvm.cttz.i64(i64 %A, i1 false) ; is_zero_undef == false This CGP patch is looking for that case and despeculating it back into: entry: %tobool = icmp eq i64 %A, 0 br i1 %tobool, label %cond.end, label %cond.true cond.true: %0 = tail call i64 @llvm.cttz.i64(i64 %A, i1 true) ; is_zero_undef == true br label %cond.end cond.end: %cond = phi i64 [ %0, %cond.true ], [ 64, %entry ] ret i64 %cond This unfortunately may lead to poorer codegen (see the changes in the existing x86 test), but if we increase speculation in SimplifyCFG (the next step in this patch series), then we should avoid those kinds of cases in the first place. The need for this patch was originally mentioned here: http://reviews.llvm.org/D7506 with follow-up here: http://reviews.llvm.org/D7554 Differential Revision: http://reviews.llvm.org/D14630 llvm-svn: 253573
Diffstat (limited to 'lldb/scripts/Python/prepare_binding_Python.py')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud