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

    <tr>
        <th>Summary</th>
        <td>
            [CRASH][CODEGEN][17.0.1] LLVM object code generation crashes with zeroinitializer on large fixed-sized array
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    Version: LLVM 17.0.1
Platform: macOS 13.2.1 (although this seems to also be issue on other platforms)

Try to compile the following with `llc llvmir.ll` crashes:

```llvm
; ModuleID = 'main.adept'
source_filename = "main.adept"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-darwin22.3.0"

; Function Attrs: nounwind
define i32 @main() #0 {
  %1 = alloca [100000 x i32], align 4
  store [100000 x i32] zeroinitializer, [100000 x i32]* %1, align 4
  ret i32 0
}

attributes #0 = { nounwind }
```

Stack dump:
```
Stack dump:
0.      Program arguments: /opt/homebrew/opt/llvm@17/bin/llc llvmir.ll
1.      Running pass 'Function Pass Manager' on module 'llvmir.ll'.
2.      Running pass 'AArch64 Instruction Selection' on function '@main'
 #0 0x000000010d1d3e0c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x3df3e0c)
 #1 0x000000010d1d420c SignalHandler(int) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x3df420c)
 #2 0x000000018d02c2a4 (/usr/lib/system/libsystem_platform.dylib+0x1803fc2a4)
 #3 0x0000000109c73b08 (anonymous namespace)::DAGCombiner::visitSTORE(llvm::SDNode*) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x893b08)
 #4 0x0000000109bfd5dc (anonymous namespace)::DAGCombiner::combine(llvm::SDNode*) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x81d5dc)
 #5 0x0000000109bf6ba4 llvm::SelectionDAG::Combine(llvm::CombineLevel, llvm::AAResults*, llvm::CodeGenOpt::Level) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x816ba4)
 #6 0x0000000109f0a714 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0xb2a714)
 #7 0x0000000109f08bb0 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0xb28bb0)
 #8 0x0000000109f06320 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0xb26320)
 #9 0x0000000109934110 llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x554110)
#10 0x000000010965d89c llvm::FPPassManager::runOnModule(llvm::Module&) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x27d89c)
#11 0x00000001096503b4 llvm::legacy::PassManagerImpl::run(llvm::Module&) (/opt/homebrew/Cellar/llvm/17.0.1/lib/libLLVM.dylib+0x2703b4)
#12 0x0000000100a49730 compileModule(char**, llvm::LLVMContext&) (/opt/homebrew/Cellar/llvm/17.0.1/bin/llc+0x100005730)
#13 0x0000000100a47984 main (/opt/homebrew/Cellar/llvm/17.0.1/bin/llc+0x100003984)
#14 0x000000018ccd3e50 
zsh: segmentation fault /opt/homebrew/opt/llvm@17/bin/llc llvmir.ll
```

[bugpoint-bc-files.zip](https://github.com/llvm/llvm-project/files/12771848/bugpoint-bc-files.zip)


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy8V12P46gS_TXkBcXC-PshD05nMtvSzHZrMtrXETYVm7sYIsDTnf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