diff options
author | Sanjay Patel <spatel@rotateright.com> | 2016-03-03 19:19:04 +0000 |
---|---|---|
committer | Sanjay Patel <spatel@rotateright.com> | 2016-03-03 19:19:04 +0000 |
commit | 9bba75084b7bde6a6215d616f664d3d2486f4871 (patch) | |
tree | 8be3639147b06fb4a8e05435d20886eb75516436 /lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py | |
parent | dd12e9a8c04eb1cc5b43df4d249273678c5fec6b (diff) | |
download | bcm5719-llvm-9bba75084b7bde6a6215d616f664d3d2486f4871.tar.gz bcm5719-llvm-9bba75084b7bde6a6215d616f664d3d2486f4871.zip |
[InstCombine] transform bitcasted bitwise logic ops with constants (PR26702)
Given that we're not actually reducing the instruction count in the included
regression tests, I think we would call this a canonicalization step.
The motivation comes from the example in PR26702:
https://llvm.org/bugs/show_bug.cgi?id=26702
If we hoist the bitwise logic ahead of the bitcast, the previously unoptimizable
example of:
define <4 x i32> @is_negative(<4 x i32> %x) {
%lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
%not = xor <4 x i32> %lobit, <i32 -1, i32 -1, i32 -1, i32 -1>
%bc = bitcast <4 x i32> %not to <2 x i64>
%notnot = xor <2 x i64> %bc, <i64 -1, i64 -1>
%bc2 = bitcast <2 x i64> %notnot to <4 x i32>
ret <4 x i32> %bc2
}
Simplifies to the expected:
define <4 x i32> @is_negative(<4 x i32> %x) {
%lobit = ashr <4 x i32> %x, <i32 31, i32 31, i32 31, i32 31>
ret <4 x i32> %lobit
}
Differential Revision: http://reviews.llvm.org/D17583
llvm-svn: 262645
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/expression_command/call-function/TestCallUserDefinedFunction.py')
0 files changed, 0 insertions, 0 deletions