llvm-project/llvm/test/CodeGen/X86/GlobalISel
Roman Tereshin 6d26638c90 [GlobalISel][Legalizer] Widening the second src op of shifts bug fix
The second source operand of G_SHL, G_ASHR, and G_LSHR must preserve its
value as a (small) unsigned integer, therefore its incorrect to widen it
in any way but by zero extending it.

G_SHL was using G_ANYEXT and G_ASHR - G_SEXT (which is correct for their
destination and first source operands, but not the "number of bits to
shift" operand).

Generally, shifts aren't as similar to regular binary operations as it
might seem, for instance, they aren't commutative nor associative and
the second source operand usually requires a special treatment.

Reviewers: bogner, javed.absar, aivchenk, rovka

Reviewed By: bogner

Subscribers: igorb, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D46413

llvm-svn: 331926
2018-05-09 21:43:30 +00:00
..
GV.ll
add-scalar.ll [x86] Introduce a pass to begin more systematically fixing PR36028 and similar issues. 2018-04-10 01:41:17 +00:00
add-vec.ll
and-scalar.ll
ashr-scalar.ll [GlobalISel][Legalizer] Widening the second src op of shifts bug fix 2018-05-09 21:43:30 +00:00
avoid-matchtable-crash.mir GlobalISel: Always check operand types when executing match table 2018-02-07 02:44:51 +00:00
binop.ll
br.ll
brcond.ll Correct dwarf unwind information in function epilogue 2018-04-24 10:32:08 +00:00
callingconv.ll Correct dwarf unwind information in function epilogue 2018-04-24 10:32:08 +00:00
cmp.ll
constant.ll
ext-x86-64.ll [GlobalISel][X86] Support G_LSHR/G_ASHR/G_SHL 2018-03-14 11:23:57 +00:00
ext.ll [GlobalISel][X86] Support G_LSHR/G_ASHR/G_SHL 2018-03-14 11:23:57 +00:00
fadd-scalar.ll
fconstant.ll
fdiv-scalar.ll
fmul-scalar.ll
fpext-scalar.ll
frameIndex.ll Correct dwarf unwind information in function epilogue 2018-04-24 10:32:08 +00:00
fsub-scalar.ll
gep.ll [GlobalISel][X86] Support G_LSHR/G_ASHR/G_SHL 2018-03-14 11:23:57 +00:00
inttoptr.ll [GlobalIsel][X86] Support G_INTTOPTR instruction. 2018-02-28 12:11:53 +00:00
irtranslator-callingconv.ll [GlobalISel][X86] Fixing failures after https://reviews.llvm.org/D37775 2018-02-08 22:41:47 +00:00
legalize-add-v128.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-add-v256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-add-v512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-add.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-and-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-ashr-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-brcond.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-cmp.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-constant.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-ext-x86-64.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-ext.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-fadd-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-fdiv-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-fmul-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-fpext-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-fsub-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-gep.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-insert-vec256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-insert-vec512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-lshr-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-memop-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-mul-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-mul-v128.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-mul-v256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-mul-v512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-or-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-phi.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-shl-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-sub-v128.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-sub-v256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-sub-v512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-sub.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-trunc.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-undef.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
legalize-xor-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
lit.local.cfg
lshr-scalar.ll [GlobalISel][X86] Support G_LSHR/G_ASHR/G_SHL 2018-03-14 11:23:57 +00:00
memop-scalar-x32.ll
memop-scalar.ll
memop-vec.ll
mul-scalar.ll
mul-vec.ll
or-scalar.ll
phi.ll
ptrtoint.ll [GlobalIsel][X86] Support G_PTRTOINT instruction. 2018-02-28 09:18:47 +00:00
regbankselect-AVX2.mir Followup on Proposal to move MIR physical register namespace to '$' sigil. 2018-01-31 22:04:26 +00:00
regbankselect-AVX512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
regbankselect-X32.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
regbankselect-X86_64.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-GV.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-add-v128.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-add-v256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-add-v512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-add-x32.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-add.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-and-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-ashr-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-blsi.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-blsr.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-br.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-brcond.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-cmp.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-constant.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-copy.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-ext-x86-64.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-ext.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-extract-vec256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-extract-vec512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-fadd-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-fconstant.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-fdiv-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-fmul-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-fpext-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-fsub-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-gep.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-inc.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-insert-vec256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-insert-vec512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-intrinsic-x86-flags-read-u32.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-leaf-constant.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-lshr-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-memop-scalar-x32.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-memop-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-memop-v128.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-memop-v256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-memop-v512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-merge-vec256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-merge-vec512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-mul-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-mul-vec.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-or-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-phi.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-shl-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-sub-v128.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-sub-v256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-sub-v512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-sub.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-trunc.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-undef.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-unmerge-vec256.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-unmerge-vec512.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
select-xor-scalar.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
shl-scalar-widening.ll [GlobalISel][Legalizer] Widening the second src op of shifts bug fix 2018-05-09 21:43:30 +00:00
shl-scalar.ll [GlobalISel][Legalizer] Widening the second src op of shifts bug fix 2018-05-09 21:43:30 +00:00
sub-scalar.ll
sub-vec.ll
trunc.ll
undef.ll
x32-select-frameIndex.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-legalize-GV.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-legalize-inttoptr.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-legalize-ptrtoint.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-legalize-sdiv.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-select-frameIndex.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-select-inttoptr.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-select-ptrtoint.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86-select-sdiv.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-fallback.ll [CodeGen] Use MIR syntax for MachineMemOperand printing 2018-03-14 21:52:13 +00:00
x86_64-irtranslator.ll [GlobalIsel][X86] Support for G_SDIV instruction 2018-03-14 15:41:11 +00:00
x86_64-legalize-GV.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-legalize-inttoptr.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-legalize-ptrtoint.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-legalize-sdiv.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-legalize-zext.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-select-frameIndex.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-select-inttoptr.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-select-ptrtoint.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-select-sdiv.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
x86_64-select-zext.mir [globalisel] Remove redundant -global-isel option from tests that use -run-pass. NFC 2018-05-05 21:19:59 +00:00
xor-scalar.ll