[llvm] r328687 - [ORC] Fix ORC on platforms without indirection support.

Andres Freund via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 27 22:46:49 PDT 2018


Hi,

On 2018-03-28 03:41:45 -0000, Lang Hames via llvm-commits wrote:
> Author: lhames
> Date: Tue Mar 27 20:41:45 2018
> New Revision: 328687
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=328687&view=rev
> Log:
> [ORC] Fix ORC on platforms without indirection support.
> 
> Previously this crashed because a nullptr (returned by
> createLocalIndirectStubsManagerBuilder() on platforms without
> indirection support) functor was unconditionally invoked.
> 
> Patch by Andres Freund. Thanks Andres!
>  namespace llvm {
> @@ -59,15 +61,20 @@ public:
>        // If we found a TargetMachine, check that it's one that Orc supports.
>        const Triple& TT = TM->getTargetTriple();
>  
> -      if ((TT.getArch() != Triple::x86_64 && TT.getArch() != Triple::x86) ||
> -          TT.isOSWindows())
> -        TM = nullptr;
> +      // Target can JIT?
> +      SupportsJIT = TM->getTarget().hasJIT();
> +      // Use ability to create callback manager to detect whether Orc
> +      // has indirection support on this platform. This way the test
> +      // and Orc code do not get out of sync.
> +      SupportsIndirection = !!orc::createLocalCompileCallbackManager(TT, 0);
>      }

It seems this was, for a reason unknown to me, overly aggressive. The
windows check appears to have been critical:
http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/16121/steps/test/logs/stdio

Sorry for that.

- Andres


More information about the llvm-commits mailing list