<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/116133>116133</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [AMDGPU] LLVM ERROR: Cannot select: t70: i64 = FrameIndex<0>
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            backend:AMDGPU
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          weiweichen
      </td>
    </tr>
</table>

<pre>
    Input LLVM IR:
```
; test.ll
source_filename = "test"
target datalayout = "e-p:64:64-p1:64:64-p2:32:32-p3:32:32-p4:64:64-p5:32:32-p6:32:32-p7:160:256:256:32-p8:128:128-p9:192:256:256:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-v2048:2048-n32:64-S32-A5-G1-ni:7:8:9"
target triple = "amdgcn-amd-amdhsa"

define dso_local amdgpu_kernel void @vec_func(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #0 {
  %5 = alloca ptr, i64 1, align 8
  %6 = alloca ptr, i64 1, align 8
  %7 = alloca ptr, i64 1, align 8
  %8 = alloca ptr, i64 1, align 8
  %9 = alloca ptr, i64 1, align 8
  %10 = alloca ptr, i64 1, align 8
  %11 = getelementptr inbounds float, ptr %0, i32 9
  store ptr %11, ptr %10, align 8
  store ptr %11, ptr %8, align 8
  store ptr %11, ptr %9, align 8
  store ptr %2, ptr %7, align 8
  store ptr %2, ptr %5, align 8
  store ptr %2, ptr %6, align 8
  %12 = load float, ptr %11, align 4
  store float %12, ptr %2, align 4
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

attributes #0 = { "target-cpu"="gfx942" "target-features" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }

!llvm.module.flags = !{!0}

!0 = !{i32 2, !"Debug Info Version", i32 3}
```
Command:
```
 llc -mcpu=gfx942 -o test.o test.ll -filetype=obj
```
Error:
```
(autovenv) (autovenv) ubuntu@ip-10-250-101-136:~/playground/mario/moco-1410🍔 $ llc -mcpu=gfx942 -o dump.o dump.opt.ll -filetype=obj
LLVM ERROR: Cannot select: t40: i64 = FrameIndex<6>
In function: vec_func
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: llc -mcpu=gfx942 -o dump.o dump.opt.ll -filetype=obj
1.      Running pass 'CallGraph Pass Manager' on module 'dump.opt.ll'.
2.      Running pass 'AMDGPU DAG->DAG Pattern Instruction Selection' on function '@vec_func'
 #0 0x000060d9faa0325b llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) ./external/llvm-project/llvm/lib/Support/Unix/Signals.inc:723:13
 #1 0x000060d9faa01445 llvm::sys::RunSignalHandlers() ./external/llvm-project/llvm/lib/Support/Signals.cpp:106:18
 #2 0x000060d9faa038bd SignalHandler(int) ./external/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #3 0x00007f398e842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x00007f398e8969fc pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x969fc)
 #5 0x00007f398e842476 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x42476)
 #6 0x00007f398e8287f3 abort (/lib/x86_64-linux-gnu/libc.so.6+0x287f3)
 #7 0x000060d9fa9d62f6 llvm::report_fatal_error(llvm::Twine const&, bool) ./external/llvm-project/llvm/lib/Support/ErrorHandling.cpp:126:5
 #8 0x000060d9f962429b getValueType ./external/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1043:5
 #9 0x000060d9f962429b getValueType ./external/llvm-project/llvm/include/llvm/CodeGen/SelectionDAGNodes.h:1198:16
#10 0x000060d9f962429b llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) ./external/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:4429:43
#11 0x000060d9f9623353 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) ./external/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:4157:9
#12 0x000060d9f8574dd9 llvm::AMDGPUDAGToDAGISel::Select(llvm::SDNode*) ./external/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:708:1
#13 0x000060d9f9618301 begin ./external/llvm-project/llvm/include/llvm/ADT/SmallVector.h:267:45
#14 0x000060d9f9618301 end ./external/llvm-project/llvm/include/llvm/ADT/SmallVector.h:269:27
#15 0x000060d9f9618301 ~SmallVector ./external/llvm-project/llvm/include/llvm/ADT/SmallVector.h:1202:46
#16 0x000060d9f9618301 llvm::SelectionDAGISel::DoInstructionSelection() ./external/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1351:5
#17 0x000060d9f9617273 ~TimeRegion ./external/llvm-project/llvm/include/llvm/Support/Timer.h:155:9
#18 0x000060d9f9617273 llvm::SelectionDAGISel::CodeGenAndEmitDAG() ./external/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1120:3
#19 0x000060d9f96151e3 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) ./external/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1647:8
#20 0x000060d9f9612655 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) ./external/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:0:3
#21 0x000060d9f85729d7 llvm::AMDGPUDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) ./external/llvm-project/llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp:130:3
#22 0x000060d9f96100bb llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) ./external/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:374:20
#23 0x000060d9f924ac59 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) ./external/llvm-project/llvm/lib/CodeGen/MachineFunctionPass.cpp:94:13
#24 0x000060d9fa835980 llvm::FPPassManager::runOnFunction(llvm::Function&) ./external/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1406:27
#25 0x000060d9fa34c965 RunPassOnSCC ./external/llvm-project/llvm/lib/Analysis/CallGraphSCCPass.cpp:180:25
#26 0x000060d9fa34c965 RunAllPassesOnSCC ./external/llvm-project/llvm/lib/Analysis/CallGraphSCCPass.cpp:469:9
#27 0x000060d9fa34c965 (anonymous namespace)::CGPassManager::runOnModule(llvm::Module&) ./external/llvm-project/llvm/lib/Analysis/CallGraphSCCPass.cpp:534:18
#28 0x000060d9fa8360e2 runOnModule ./external/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:0:27
#29 0x000060d9fa8360e2 llvm::legacy::PassManagerImpl::run(llvm::Module&) ./external/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:539:44
#30 0x000060d9f815f0ff compileModule ./external/llvm-project/llvm/tools/llc/llc.cpp:755:17
#31 0x000060d9f815f0ff main ./external/llvm-project/llvm/tools/llc/llc.cpp:412:22
#32 0x00007f398e829d90 (/lib/x86_64-linux-gnu/libc.so.6+0x29d90)
#33 0x00007f398e829e40 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x29e40)
#34 0x000060d9f8156fe5 _start (/home/ubuntu/.cache/bazel/_bazel_ubuntu/a8246705211370f9a29d0c6e94adcf5a/execroot/_main/bazel-out/k8-fastbuild-default/bin/external/llvm-project/llvm/llc+0x2920fe5)
Aborted (core dumped)
```

Any AMD GPU backend experts know what's missing here? Thanks!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llv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