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

    <tr>
        <th>Summary</th>
        <td>
            [PowerPC][Backend] Assertion `llvm::isIntN(BitWidth, val) && "Value is not an N-bit signed value"' failed.
        </td>
    </tr>

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

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

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

<pre>
    bash> cat test.ll

```
%0 = type <{ double }>

@dvar = external global [2352637 x %0]

define void @Test() {
bb:
        %i9 = load <2 x double>, ptr getelementptr inbounds (i8, ptr @dvar, i64 -152758), align 8
 store <2 x double> %i9, ptr null, align 8
        ret void
}
```
bash>llc -verify-machineinstrs -mtriple=powerpc-aix- -mcpu=pwr10 test.ll

```
llc: /home/zhijian/llvm/dev/digger-llvm-project/llvm/include/llvm/ADT/APInt.h:121: llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isIntN(BitWidth, val) && "Value is not an N-bit signed value"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /home/zhijian/llvm/dev/build1/bin/llc -verify-machineinstrs -mtriple=powerpc-aix- -mcpu=pwr10 ../llvm-project/test.ll
1.      Running pass 'Function Pass Manager' on module '../llvm-project/test.ll'.
2. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@Test'
 #0 0x000005e88469e76c llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/home/zhijian/llvm/dev/build1/bin/llc+0x78ae76c)
 #1 0x000005e88469eeb4 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #2 0x000005e88469b820 llvm::sys::RunSignalHandlers() (/home/zhijian/llvm/dev/build1/bin/llc+0x78ab820)
 #3 0x000005e88469f11c SignalHandler(int) Signals.cpp:0:0
 #4 0x00007e0f8cd804c8 (linux-vdso64.so.1+0x4c8)
 #5 0x00007e0f8c54d168 __libc_signal_restore_set /build/glibc-GVyp00/glibc-2.31/signal/../sysdeps/unix/sysv/linux/internal-signals.h:86:3
 #6 0x00007e0f8c54d168 raise /build/glibc-GVyp00/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:48:3
 #7 0x00007e0f8c524850 abort /build/glibc-GVyp00/glibc-2.31/stdlib/abort.c:79:7
 #8 0x00007e0f8c53c49c __assert_fail_base /build/glibc-GVyp00/glibc-2.31/assert/assert.c:92:3
 #9 0x00007e0f8c53c540 __assert_fail /build/glibc-GVyp00/glibc-2.31/assert/assert.c:101:3
#10 0x000005e8843c0398 llvm::SelectionDAG::getSignedConstant(long, llvm::SDLoc const&, llvm::EVT, bool, bool) (/home/zhijian/llvm/dev/build1/bin/llc+0x75d0398)
#11 0x000005e882293900 llvm::PPCTargetLowering::SelectOptimalAddrMode(llvm::SDNode const*, llvm::SDValue, llvm::SDValue&, llvm::SDValue&, llvm::SelectionDAG&, llvm::MaybeAlign) const PPCISelLowering.cpp:0:0
#12 0x000005e8822d6dc4 (anonymous namespace)::PPCDAGToDAGISel::CheckComplexPattern(llvm::SDNode*, llvm::SDNode*, llvm::SDValue, unsigned int, llvm::SmallVectorImpl<std::pair<llvm::SDValue, llvm::SDNode*>>&) PPCISelDAGToDAG.cpp:0:0
#13 0x000005e88443d808 llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*, unsigned int) (/home/zhijian/llvm/dev/build1/bin/llc+0x764d808)
#14 0x000005e8822d3fc0 (anonymous namespace)::PPCDAGToDAGISel::Select(llvm::SDNode*) PPCISelDAGToDAG.cpp:0:0
#15 0x000005e8844355b8 llvm::SelectionDAGISel::DoInstructionSelection() (/home/zhijian/llvm/dev/build1/bin/llc+0x76455b8)
#16 0x000005e884434274 llvm::SelectionDAGISel::CodeGenAndEmitDAG() (/home/zhijian/llvm/dev/build1/bin/llc+0x7644274)
#17 0x000005e88443277c llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, llvm::ilist_iterator_w_bits<llvm::ilist_detail::node_options<llvm::Instruction, true, false, void, true, llvm::BasicBlock>, false, true>, bool&) (/home/zhijian/llvm/dev/build1/bin/llc+0x764277c)
#18 0x000005e8844317a8 llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) (/home/zhijian/llvm/dev/build1/bin/llc+0x76417a8)
#19 0x000005e88442e720 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) (/home/zhijian/llvm/dev/build1/bin/llc+0x763e720)
#20 0x000005e8822cc0e8 (anonymous namespace)::PPCDAGToDAGISel::runOnMachineFunction(llvm::MachineFunction&) PPCISelDAGToDAG.cpp:0:0
#21 0x000005e88442b774 llvm::SelectionDAGISelLegacy::runOnMachineFunction(llvm::MachineFunction&) (/home/zhijian/llvm/dev/build1/bin/llc+0x763b774)
#22 0x000005e8833d528c llvm::MachineFunctionPass::runOnFunction(llvm::Function&) (/home/zhijian/llvm/dev/build1/bin/llc+0x65e528c)
#23 0x000005e883a5c290 llvm::FPPassManager::runOnFunction(llvm::Function&) (/home/zhijian/llvm/dev/build1/bin/llc+0x6c6c290)
#24 0x000005e883a66828 llvm::FPPassManager::runOnModule(llvm::Module&) (/home/zhijian/llvm/dev/build1/bin/llc+0x6c76828)
#25 0x000005e883a5cedc llvm::legacy::PassManagerImpl::run(llvm::Module&) (/home/zhijian/llvm/dev/build1/bin/llc+0x6c6cedc)
#26 0x000005e883a66e0c llvm::legacy::PassManager::run(llvm::Module&) (/home/zhijian/llvm/dev/build1/bin/llc+0x6c76e0c)
#27 0x000005e88113579c compileModule(char**, llvm::LLVMContext&) llc.cpp:0:0
#28 0x000005e881132cdc main (/home/zhijian/llvm/dev/build1/bin/llc+0x4342cdc)
#29 0x00007e0f8c524ccc generic_start_main /build/glibc-GVyp00/glibc-2.31/csu/../csu/libc-start.c:308:16
#30 0x00007e0f8c524ea4 __libc_start_main /build/glibc-GVyp00/glibc-2.31/csu/../sysdeps/unix/sysv/linux/powerpc/libc-start.c:98:10
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzUmd1u2zgWx5-GuSFsUNT3hS8UO84WSGaMSZC9NCiKsTmlSEOk0mSffnEo2bLUZBrU01lskKYyv87v_Hl4SNHMWrnTQixQfI0oreRuJxolNaIUxasr1rq9aRan4qvSVG-Lktk9Cm8wZw47Yd1cKUQK-E1I_0sKRGOCUbjC7u0gMAqXKL3GlWlLJTBKVyi86ftEpHphjW8qXp1oNFN4p0zJFEbxNQ1jmoQpfsUwIIpXXa9KPEst8IuRFUYReRTWIZohmmOUXiNSlCUKoR3ufxCNZe5tKMMqwKH4tccBFLrEB9fgnXBCiVpoB5-kLk2rK4sRzWR2bNMDw0eZRHgWxDSNwTSUMCV3Gmdg2TrTiO8sdSTHsXSr1KRb_9MI570Dd9PVRNt-ApTiePYiGvn8NqsZ30stpLausXhWu0YewODqYL6J5sBnTL7O8KzmhxYKvzUB-XjulOIoLDCi672pBaLr_-zln5JpRNdKvdSIrivxAn99XMygbHZozJ-Cu6GJ1Fy1lRgKitUj_N180W6-R2ER0ACs-NqwQGHhq84fadZqH58VlvBxiVupXRJt_XNpjBr-z2GswlrROGk0RgkZBpb2i3a_IZpdS_dvWbk9dHthyscLTRBNMKL0ialWYGmxNg4zjX-bldLh3v4LVMKqoCl-ZlKJao5Isbm7KR5usG3LWjrMcNnucCMOpnHYGbx37mCBgK4RXe-k27flnJt6kGSinLS2FRbRNWYaXPYCYrcXmDfM7nHJ-FfXMC7A9oNj_Cuu2vrQhTqZd5GzacyuYTVmza6FSLafmsqylaoK4EF2dZeF1nz-vXdDuAU96h-t1lLv8IFZWGTputXcz94GCu6ZZjvRgOJG49pULaQOmv7V2DQFaej8u6E3wLpZ4lVxO0Phzaq4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