[llvm-bugs] [Bug 29121] New: instcombine triggers verifier error on atomic load/store types

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Aug 24 08:47:23 PDT 2016


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

            Bug ID: 29121
           Summary: instcombine triggers verifier error on atomic
                    load/store types
           Product: new-bugs
           Version: 3.9
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
          Assignee: unassignedbugs at nondot.org
          Reporter: stevenwu at apple.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Testcase below:

$ cat test.ll
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios10.0.0"

define <2 x float> @no_atomic_vector_load(i8* %p) {
  %retval = alloca <2 x float>, align 8
  %1 = bitcast i8* %p to <2 x float>*
  %2 = bitcast <2 x float>* %1 to i64*
  %load = load atomic i64, i64* %2 unordered, align 8
  %3 = bitcast <2 x float>* %retval to i64*
  store i64 %load, i64* %3, align 8
  %4 = load <2 x float>, <2 x float>* %retval, align 8
  ret <2 x float> %4
}

define void @no_atomic_vector_store(<2 x float> %p, i8* %p2) {
  %1 = bitcast <2 x float> %p to i64
  %2 = bitcast i8* %p2 to i64*
  store atomic i64 %1, i64* %2 unordered, align 8
  ret void
}

$ opt -instcombine test.ll -o bad.bc
atomic load operand must have integer, pointer, or floating point type!
 <2 x float>  %load1 = load atomic <2 x float>, <2 x float>* %1 unordered,
align 8
LLVM ERROR: Broken function found, compilation aborted!

This is a legit verifier error because SelectionDAG cannot handle that:
$ opt -instcombine test.ll -o bad.bc -disable-verify
$ llc bad.bc -disable-verify
LLVM ERROR: Cannot select: t3: v2f32,ch = AtomicLoad<Volatile LD8[%1]> t0, t2
  t2: i64,ch = CopyFromReg t0, Register:i64 %vreg0
    t1: i64 = Register %vreg0
In function: no_atomic_vector_load

-- 
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/20160824/099d7593/attachment.html>


More information about the llvm-bugs mailing list