[all-commits] [llvm/llvm-project] d37db7: [InstCombine] Add a test case for suboptimal handl...

topperc via All-commits all-commits at lists.llvm.org
Sun Nov 10 18:03:38 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: d37db750c25dc3a7da66c97d973f7a64b7bf907b
      https://github.com/llvm/llvm-project/commit/d37db750c25dc3a7da66c97d973f7a64b7bf907b
  Author: Craig Topper <craig.topper at gmail.com>
  Date:   2019-11-10 (Sun, 10 Nov 2019)

  Changed paths:
    M llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll

  Log Message:
  -----------
  [InstCombine] Add a test case for suboptimal handling of (double (bitcast (<1 x i64> (bitcast (x86_mmx)))))

The outer bitcast gets turned into an extractelement and another
bitcast rather than combining away to a single bitcast from mmx
to double.


  Commit: aafde063aaf09285c701c80cd4b543c2beb523e8
      https://github.com/llvm/llvm-project/commit/aafde063aaf09285c701c80cd4b543c2beb523e8
  Author: Craig Topper <craig.topper at gmail.com>
  Date:   2019-11-10 (Sun, 10 Nov 2019)

  Changed paths:
    M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
    M llvm/test/Transforms/InstCombine/bitcast-vec-canon.ll

  Log Message:
  -----------
  [InstCombine] Turn (extractelement <1 x i64/double> (bitcast (x86_mmx))) into a single bitcast from x86_mmx to i64/double.

The _m64 type is represented in IR as <1 x i64>. The x86-64 ABI
on Linux passes <1 x i64> as a double. MMX intrinsics use x86_mmx
type in IR.These things result in a lot of bitcasts in mmx code.
There's another instcombine that tries to turn bitcast <1 x i64>
to double into extractelement and a bitcast.

The combine here tries to reverse this extractelement conversion
if we see an mmx type.


Compare: https://github.com/llvm/llvm-project/compare/d115b9fd4a4b...aafde063aaf0


More information about the All-commits mailing list