Re: [swift-dev] High-level SIL Optimization: How do I get a FuncRef from the stdlib?

2016-11-27 Thread Michael Gottesman via swift-dev
+CC Slava. He has been messing around with this area in the past bit since many of us have looked at this. He is the person you want. Michael > On Nov 25, 2016, at 8:42 PM, Ben Ng wrote: > > Hi everyone, > > I’ve made good progress with the information in this thread but I can’t > figure ou

Re: [swift-dev] High-level SIL Optimization: How do I get a FuncRef from the stdlib?

2016-11-27 Thread Ben Ng via swift-dev
Slava gave me a hint: create a SubstitutionMap and then use the methods on GenericEnvironment to turn it into ArrayRef. I'll try that out tonight and see how far I get. On Sun, Nov 27, 2016 at 2:12 PM Michael Gottesman wrote: > +CC Slava. > > He has been messing around with this area in the past

Re: [swift-dev] [Pitch] Remove "Default will never be executed" Warning?

2016-11-27 Thread David Sweeris via swift-dev
> On Nov 26, 2016, at 5:25 PM, Robert Widmann via swift-dev > wrote: > > Hello all, > > I’ve seen and been a part of a number of conversations recently where talk of > planning for “resilient enums”, or even just authors that ship frameworks > that will eventually offer a binary option that

Re: [swift-dev] High-level SIL Optimization: How do I get a FuncRef from the stdlib?

2016-11-27 Thread Ben Ng via swift-dev
I managed to create the substitution, and the generated SIL looks right, but I’m failing verification: SIL verification failed: substituted callee type should not be generic: !site.getSubstCalleeType()->isPolymorphic() Verifying instruction: %0 = alloc_stack $Array, scope 0 // users: %22, %

Re: [swift-dev] High-level SIL Optimization: How do I get a FuncRef from the stdlib?

2016-11-27 Thread Slava Pestov via swift-dev
> On Nov 27, 2016, at 6:12 PM, Ben Ng wrote: > > I managed to create the substitution, and the generated SIL looks right, but > I’m failing verification: > > SIL verification failed: substituted callee type should not be generic: > !site.getSubstCalleeType()->isPolymorphic() > Verifying instr

Re: [swift-dev] High-level SIL Optimization: How do I get a FuncRef from the stdlib?

2016-11-27 Thread Slava Pestov via swift-dev
One more thing: > > auto subTy = V->getType(); This is a SILType. > auto &ValLowering = Builder.getModule().getTypeLowering(subTy); > auto copiedVal = ValLowering.emitCopyValue(Builder, SemanticsCall->getLoc(), > V); > auto allocStackInst = Builder.createAllocStack(SemanticsCall->getLoc(), >

Re: [swift-dev] [Pitch] Remove "Default will never be executed" Warning?

2016-11-27 Thread Slava Pestov via swift-dev
> On Nov 26, 2016, at 3:25 PM, Robert Widmann via swift-dev > wrote: > > Hello all, > > I’ve seen and been a part of a number of conversations recently where talk of > planning for “resilient enums”, or even just authors that ship frameworks > that will eventually offer a binary option that

Re: [swift-dev] [Pitch] Remove "Default will never be executed" Warning?

2016-11-27 Thread Slava Pestov via swift-dev
> On Nov 27, 2016, at 4:32 PM, David Sweeris via swift-dev > wrote: > >> >> On Nov 26, 2016, at 5:25 PM, Robert Widmann via swift-dev >> mailto:swift-dev@swift.org>> wrote: >> >> Hello all, >> >> I’ve seen and been a part of a number of conversations recently where talk >> of planning for