<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - LLVM ERROR: Cannot select: intrinsic %llvm.objc.clang.arc.use"
   href="https://bugs.llvm.org/show_bug.cgi?id=49717">49717</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>LLVM ERROR: Cannot select: intrinsic %llvm.objc.clang.arc.use
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Common Code Generator Code
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>luis15gomez@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=24691" name="attach_24691" title="ObjectiveC and IR">attachment 24691</a> <a href="attachment.cgi?id=24691&action=edit" title="ObjectiveC and IR">[details]</a></span>
ObjectiveC and IR

I'm facing the next error:

LLVM ERROR: Cannot select: intrinsic %llvm.objc.clang.arc.use
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0.      Program arguments:
/Users/luis.gomez/Documents/llvm-project-11.0.1/BASELINE/bin/llc
GTMSessionFetcher.ll -enable-objc-arc-opts -o
/Users/luis.gomez/Documents/issue/GTMSessionFetcher.o 
1.      Running pass 'Function Pass Manager' on module 'GTMSessionFetcher.ll'.
2.      Running pass 'AArch64 Instruction Selection' on function
'@"\01-[GTMSessionFetcher completionHandlerWithTarget:didFinishSelector:]"'
0  llc                      0x000000010c807275
llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  llc                      0x000000010c806118 llvm::sys::RunSignalHandlers() +
248
2  llc                      0x000000010c807876 SignalHandler(int) + 262
3  libsystem_platform.dylib 0x00007fff6d4aa5fd _sigtramp + 29
4  llc                      0x000000010e5a8210 _dyld_private + 0
5  libsystem_c.dylib        0x00007fff6d380808 abort + 120
6  llc                      0x000000010c76748b
llvm::report_fatal_error(llvm::Twine const&, bool) + 427
7  llc                      0x000000010c7674ab
llvm::report_fatal_error(std::__1::basic_string<char,
std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool) + 27
8  llc                      0x000000010c6c5d1b
llvm::SelectionDAGISel::CannotYetSelect(llvm::SDNode*) + 923
9  llc                      0x000000010c6c4d32
llvm::SelectionDAGISel::SelectCodeCommon(llvm::SDNode*, unsigned char const*,
unsigned int) + 15682
10 llc                      0x000000010ad96208 (anonymous
namespace)::AArch64DAGToDAGISel::Select(llvm::SDNode*) + 22680
11 llc                      0x000000010c6bc9af
llvm::SelectionDAGISel::DoInstructionSelection() + 399
12 llc                      0x000000010c6bc03a
llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1434
13 llc                      0x000000010c6bb687
llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 6855
14 llc                      0x000000010c6b8ea8
llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 2120
15 llc                      0x000000010be9387d
llvm::MachineFunctionPass::runOnFunction(llvm::Function&) + 285
16 llc                      0x000000010c1b5418
llvm::FPPassManager::runOnFunction(llvm::Function&) + 1064
17 llc                      0x000000010c1bb243
llvm::FPPassManager::runOnModule(llvm::Module&) + 67
18 llc                      0x000000010c1b5a29
llvm::legacy::PassManagerImpl::run(llvm::Module&) + 937
19 llc                      0x000000010abea12a compileModule(char**,
llvm::LLVMContext&) + 9466
20 llc                      0x000000010abe771c main + 1308
21 libdyld.dylib            0x00007fff6d2b1cc9 start + 1
22 libdyld.dylib            0x0000000000000005 start + 18446603338684621629

Initially I got the error in a large project with mixed swift, objective-c,
c++, but I was able to get the minimum scope to reproduce it:

Language:
Objective-C

Reproducible in:
LLVM: 10.0.1
LLVM: 11.0.1

Steps to reproduce it:

.../llvm-project-11.0.1/BASELINE/bin/clang -x objective-c \
-target arm64-apple-ios12.0 \
-fobjc-arc -S -Os -flto=thin \
-isysroot
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.1.sdk
\
-fembed-bitcode \
-c GTMSessionFetcher.m \
-o GTMSessionFetcher.ll

.../llvm-project-11.0.1/BASELINE/bin/llc \
GTMSessionFetcher.ll \
-enable-objc-arc-opts \
-o GTMSessionFetcher.o

Notes:

This doesn't happen with O0 optimizer flag (llvm.objc.clang.arc.use is not
present in .ll file)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>