[llvm-bugs] [Bug 50377] New: [CodeGen] Failed to select store instruction with certain operands

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 17 09:38:51 PDT 2021


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: unassignedbugs at nondot.org
          Reporter: minyihh at uci.edu
                CC: glaubitz at physik.fu-berlin.de,
                    llvm-bugs at lists.llvm.org, minyihh at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210517/2fb8a729/attachment.html>


More information about the llvm-bugs mailing list