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

            Bug ID: 50377
           Summary: [CodeGen] Failed to select store instruction with
                    certain operands
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Backend: M68k
          Assignee: unassignedb...@nondot.org
          Reporter: miny...@uci.edu
                CC: glaub...@physik.fu-berlin.de,
                    llvm-bugs@lists.llvm.org, miny...@uci.edu

Here is the IR code to reproduce the problem:
```
@var = global [2 x i16] zeroinitializer

define void @foo() {
  %1 = load volatile [2 x i16], [2 x i16]* @var
  store volatile [2 x i16] %1, [2 x i16]* @var
  ret void
}
```
With this command: `llc -mtriple=m68k input.ll`
It will give us the following error message:
```
LLVM ERROR: Cannot select: t11: ch = store<(volatile store 2 into @var + 2)>
t8, t7, t6, undef:i32
  t7: i16,ch = load<(volatile dereferenceable load 2 from @var + 2)> t0, t6,
undef:i32
    t6: i32 = add nuw t16, Constant:i32<2>
      t16: i32 = M68kISD::WrapperPC TargetGlobalAddress:i32<[2 x i16]* @var> 0
        t15: i32 = TargetGlobalAddress<[2 x i16]* @var> 0
      t5: i32 = Constant<2>
    t3: i32 = undef
  t6: i32 = add nuw t16, Constant:i32<2>
    t16: i32 = M68kISD::WrapperPC TargetGlobalAddress:i32<[2 x i16]* @var> 0
      t15: i32 = TargetGlobalAddress<[2 x i16]* @var> 0
    t5: i32 = Constant<2>
  t3: i32 = undef
In function: foo
```

After some quick study, it seems like it fail to replace `t6` with one of the
supported addressing modes (operand). So my hand-waving guess is that there are
bugs in ISel regarding pc-relative addressing modes like PCI or PCD.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to