[llvm-bugs] [Bug 47744] New: Failure to recognise 'equivalent' constant vectors with different undef elements

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Oct 6 11:42:28 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=47744

            Bug ID: 47744
           Summary: Failure to recognise 'equivalent' constant vectors
                    with different undef elements
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Common Code Generator Code
          Assignee: unassignedbugs at nondot.org
          Reporter: llvm-dev at redking.me.uk
                CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
                    spatel+llvm at rotateright.com

As mentioned on D88570:

Looks like a general shortcoming of combining/hoisting constants:

$ cat vec_const.ll 
define <4 x i32> @f(<4 x i32> %x) {
  %a1 = add <4 x i32> %x, <i32 1, i32 2, i32 3, i32 4>
  %a2 = xor <4 x i32> %a1, <i32 1, i32 2, i32 3, i32 undef>
  ret <4 x i32> %a2
}

$ llc -o - vec_const.ll 
LCPI0_0:
  .long 1  ## 0x1
  .long 2  ## 0x2
  .long 3  ## 0x3
  .long 4  ## 0x4
LCPI0_1:
  .long 1  ## 0x1
  .long 2  ## 0x2
  .long 3  ## 0x3
  .space 4
_f:
  paddd LCPI0_0(%rip), %xmm0
  pxor  LCPI0_1(%rip), %xmm0
  retq

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20201006/abc787c6/attachment.html>


More information about the llvm-bugs mailing list