diff options
| author | Weiming Zhao <weimingz@codeaurora.org> | 2014-04-30 21:07:24 +0000 |
|---|---|---|
| committer | Weiming Zhao <weimingz@codeaurora.org> | 2014-04-30 21:07:24 +0000 |
| commit | fa1cf8cd6816491cf8b78ae24cce68d640be459f (patch) | |
| tree | f69d0f61155a2fa90f5fe86e5a0e242920181b44 /lib/Bitcode/Reader/BitstreamReader.cpp | |
| parent | 79844fc3d269d2fccee1de3e0b8b6c374ce63ff2 (diff) | |
| download | llvm-fa1cf8cd6816491cf8b78ae24cce68d640be459f.tar.gz llvm-fa1cf8cd6816491cf8b78ae24cce68d640be459f.tar.bz2 llvm-fa1cf8cd6816491cf8b78ae24cce68d640be459f.tar.xz | |
[ARM64] Prevent bit extraction to be adjusted by following shift
For pattern like ((x >> C1) & Mask) << C2, DAG combiner may convert it
into (x >> (C1-C2)) & (Mask << C2), which makes pattern matching of ubfx
more difficult.
For example:
Given
%shr = lshr i64 %x, 4
%and = and i64 %shr, 15
%arrayidx = getelementptr inbounds [8 x [64 x i64]]* @arr, i64 0, %i64 2, i64 %and
%0 = load i64* %arrayidx
With current shift folding, it takes 3 instrs to compute base address:
lsr x8, x0, #1
and x8, x8, #0x78
add x8, x9, x8
If using ubfx, it only needs 2 instrs:
ubfx x8, x0, #4, #4
add x8, x9, x8, lsl #3
This fixes bug 19589
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@207702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitstreamReader.cpp')
0 files changed, 0 insertions, 0 deletions
