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tRy40_LOF3R32B_HfkPr07fsbzJCJVlvw5nx9ffaeXMxdwSpLG9DypX03tCmWcSDYofp1lfubRskNgMn-nope-pZsrVSbkENBwftPgwE-dd3JHlzQf1swvuj8TM9xSqzExDzJ8EUaWrOy9ButvE4S_t7jk3_s2XPfVWe6MQP9Z9K3rR7HjVY8Nt8wAhuE_DuM4jKIszJI4Q6C9y5b5SvJc5HGWBtFscS0fO_o5G5gkq3mWjoUnvxUS9hdKF4faFB37ma8e0MBOW_U4dPl0rmHblTKTggk5YMpRq2mTWrPTxZQ11vdcE3vnxbIXSztLS7kXQM5Zv3eaanGosPMXy1hrhxvm_iiGUWHhVPLK3tHdeu4e3SzD3Xw5rUrtlNv3xRxOHGPrEGJQ_ocUWBluSBxd0RerPE3zZLyse4HHLBqIcr6oZw8FPSMbfS-HsmArD6VBAS59AfC3VciL8jKheyS_4L3ba3P5XVFFRuneJhe9qS9fbYqytve20MUou9hfLkWYhfkCB_ZC5qtFmWW4pFQioa1M5MvFRc0LWdtLsDiL41Y-MC8C7yDz4u0I1OUQsvEqWoHbxbxclkUVLpK4KqJslUowJLH61MfK4YW59CKpnEj0KetOZcUL3AKQeFJ6wEDolKvl5e2xyDSk91B8oiikpB2Lz7iRSoO8pRo0nGTlhcd66YH-F8bnEh4>53485</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Instrumentation profiling failing to lower simple case
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
Victorious3
</td>
</tr>
</table>
<pre>
I'm trying to implement code coverage for my programming language. In order to do that I first started with appending `@llvm.instrprof.increment` to the start of every function, without generating any of the other metadata.
This seems to work fine when I do it less than three times but on the fourth function it fails with the following message:
```
clang-13 -fprofile-instr-generate -fcoverage-mapping out.ll
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /usr/lib/llvm-13/bin/clang -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -disable-llvm-verifier -discard-value-names -main-file-name out.ll -mrelocation-model static -mframe-pointer=all -fmath-errno -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fprofile-instrument=clang -fcoverage-mapping -fcoverage-compilation-dir=/home/vic/Documents/Programming/Princess/test -resource-dir /usr/lib/llvm-13/lib/clang/13.0.1 -fdebug-compilation-dir=/home/vic/Documents/Programming/Princess/test -ferror-limit 19 -fgnuc-version=4.2.1 -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/out-bda8bc.o -x ir out.ll
1. Optimizer
#0 0x00007fe7f0fe4791 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0xd95791)
#1 0x00007fe7f0fe2940 llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0xd93940)
#2 0x00007fe7f0fe4c92 (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0xd95c92)
#3 0x00007fe7f98ac3c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#4 0x00007fe7f2146998 llvm::LazyCallGraph::Node::populateSlow() (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0x1ef7998)
#5 0x00007fe7f215348e llvm::LazyCallGraph::buildRefSCCs() (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0x1f0448e)
#6 0x00007fe7f209dc8d llvm::ModuleToPostOrderCGSCCPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0x1e4ec8d)
#7 0x00007fe7f1eab09d (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0x1c5c09d)
#8 0x00007fe7f114b1fe llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/x86_64-linux-gnu/libLLVM-13.so.1+0xefc1fe)
#9 0x00007fe7f7ae064a (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.13+0x195c64a)
#10 0x00007fe7f7ada6b4 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.13+0x19566b4)
#11 0x00007fe7f7d9b8be clang::CodeGenAction::ExecuteAction() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.13+0x1c178be)
#12 0x00007fe7f85df706 clang::FrontendAction::Execute() (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.13+0x245b706)
#13 0x00007fe7f855a0e6 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.13+0x23d60e6)
#14 0x00007fe7f8652576 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/x86_64-linux-gnu/libclang-cpp.so.13+0x24ce576)
#15 0x0000000000413189 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm-13/bin/clang+0x413189)
#16 0x00000000004111a6 (/usr/lib/llvm-13/bin/clang+0x4111a6)
#17 0x000000000041100e main (/usr/lib/llvm-13/bin/clang+0x41100e)
#18 0x00007fe7efd360b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#19 0x000000000040e23e _start (/usr/lib/llvm-13/bin/clang+0x40e23e)
clang: error: unable to execute command: Segmentation fault
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Ubuntu clang version 13.0.1-++20220115053259+5869ea6c6254-1~exp1~20220115053339.54
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
clang: note: diagnostic msg: Error generating preprocessed source(s) - no preprocessable inputs.
```
Attached source file:
[test.txt](https://github.com/llvm/llvm-project/files/7964463/test.txt)
It works when I remove any one of the calls to `@llvm.instrprof.increment`
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNWNly2zoS_Rr5BUUVd0kPflBkO3FVMknFmcy8qUAQlHAvSXAA0Mv9-jkNUgsdJxmX78O4XBSJpfv06W4sXejy6fJ2Fi8a5syTanfMaaaarpaNbB0TupR43EvDd5JV2rDmiXVG7wxvGhpd83bXo2_OblumTSkNCSg1c3vu2C2rlLGOWceNkyV7UG7PeNfJtqTJszycpWFd3zdz1VpnILjCmzBeOXpJltvLYT7TFZNA8sSqvhVO6XYWb7xI3Tu2ky1AOhLL2ycaSxM1HsAsHS-54_NZeDUL19_2yjIrZWNJ_oM2fwJmK9nDXraADPDKsVpaS0a0eBgpmVONtKyAJt160ZXuDaw5YKE5FVe1HYwcRtS1fiBEmGpB0ixZDwjI8OHffwpiMYgSFlREgapl4PkIRqMkOg5OCBrwRzJh9LyuBwFfPl6v766Z7YsGMDhg7piRnQZpsHDvXGdJd3yDf_TZuedcmx2-QVfJQHrdw9UEWxhu96zg4k9nuJBEcgdhRgtYASdaGD4000xurRaKk3dN3zIrjOrcSPSdgxBW9k13tDxE1-rLEECMm11PniZwDFB6a_CsVUFPIAQlBFjB0TeeIxYIEbHAQUct2eMy3-Zp0ImgVm3_GOzangUSDAS6-IMFjZE1fwx4XbPg8IGnFpz8ZVlQKssLcF2Rf49fXjG4VpVC6FCz4KYM7nndy6DlFAXwgWoD7ydqGF0xaBzFBw0yp6bAdUqgp4K9Mui0ap00s-TKo6oa7vaBNKbV-Gh1YHTvMyOgDswSmsKgF04b2KG49cr7FkFVBo7g4hu5sZMuEF1PjAR5iqa-lb7BBxABKCX8vpOGuqAACHZl8TzevDPQNXL9Y8ydNQnddKoebC0Vm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