Re: [swift-dev] Protocol Devirtualizer Pass

2018-01-17 Thread Raj Barik via swift-dev
ent!1: (Self) -> () -> Int : nil } On Thu, Dec 21, 2017 at 2:50 PM, Raj Barik wrote: > Sure, I can :) > > On Thu, Dec 21, 2017 at 12:24 PM, Michael Gottesman > wrote: > >> Is it possible to merge them? >> >> > On Dec 21, 2017, at 11:07 AM,

Re: [swift-dev] DebugScope Verification Error

2018-01-16 Thread Raj Barik via swift-dev
M, Vedant Kumar wrote: > > + Adrian and Davide, since they work in this area. > > Hi Raj, > > On Jan 15, 2018, at 4:48 PM, Raj Barik via swift-dev > wrote: > > Thanks Mark. You are right, the following assertion fails > > require(!DS || DS->getParentFunctio

Re: [swift-dev] DebugScope Verification Error

2018-01-15 Thread Raj Barik via swift-dev
an chime in. > > Mark > > > > > > Best, > Raj > > > > On Mon, Jan 15, 2018 at 9:52 AM, Mark Lacey wrote: > >> I’d suggest looking at SILCloner.h as well as ScopeCloner in >> SILBasicBlock.cpp to see how they are dealing with debug scopes. >> &g

Re: [swift-dev] DebugScope Verification Error

2018-01-15 Thread Raj Barik via swift-dev
Block.cpp to see how they are dealing with debug scopes. > > Mark > > > On Jan 15, 2018, at 9:24 AM, Raj Barik via swift-dev < > swift-dev@swift.org> wrote: > > > > Hi, > > > > I am running into a debug scope SIL Verifier error when creating a new &g

[swift-dev] DebugScope Verification Error

2018-01-15 Thread Raj Barik via swift-dev
Hi, I am running into a debug scope SIL Verifier error when creating a new function (NF) from an existing one (F). Can someone point me where I am going wrong? NF = M.createFunction(, F->getDebugScope()); SILBasicBlock *NFBody = NF->createBasicBlock(); SILBuilder NFBuilder(NFBody); SILOpenedA

Re: [swift-dev] Protocol Devirtualizer Pass

2017-12-21 Thread Raj Barik via swift-dev
Sure, I can :) On Thu, Dec 21, 2017 at 12:24 PM, Michael Gottesman wrote: > Is it possible to merge them? > > > On Dec 21, 2017, at 11:07 AM, Raj Barik via swift-dev < > swift-dev@swift.org> wrote: > > > > Hi, > > > > Thanks. > > > > >

Re: [swift-dev] Protocol Devirtualizer Pass

2017-12-21 Thread Raj Barik via swift-dev
t; >> (@owned τ_0_0, Int) -> Int >> >> >> Probably, you have to pass the right SubstitutionList to the >> createApplyInst call. >> >> >> The peephole that propagates types from an init existential Slava >> referred to is here: >> >>

Re: [swift-dev] Protocol Devirtualizer Pass

2017-12-20 Thread Raj Barik via swift-dev
ft, but it can in > SIL… > > let _a = a open as T > > > > return _wrap_inc(_a, val) > > } > > > > @inline(never) internal func _wrap_inc(_a:T, val:Int) > -> Int{ > > return _a.increment(i:val) > > } > > > > Now, if I have a c

Re: [swift-dev] Protocol Devirtualizer Pass

2017-12-13 Thread Raj Barik via swift-dev
> generic function _wrap_inc with a concrete type SumClass, and the generic > specializer can produce a specialization of it. > > Notice how this approach combines several existing optimizations and only > requires adding a relatively simple new transformation, and possibly > im

Re: [swift-dev] Protocol Devirtualizer Pass

2017-12-12 Thread Raj Barik via swift-dev
; > Then the optimizer will inline the thunk, giving you a call to _wrap_inc. > The existential value built from the SumClass instance is immediately > opened so it will be peepholed away. At this point you have a call of a > generic function _wrap_inc with a concrete type SumClass, a

[swift-dev] Create SILType from GenericTypeParamType

2017-12-11 Thread Raj Barik via swift-dev
Hi, I am trying to create a new generic function in the Swift compiler (as part of a pass). Although I am able to create the generic function signature fairly easily, I do not find an easy way to create a SILType from a GenericTypeParamType, which is needed to be passed to createFunctionArgument.

[swift-dev] Protocol Devirtualizer Pass

2017-11-29 Thread Raj Barik via swift-dev
Hi, I am thinking about writing a Protocol Devirtualizer Pass that specializes functions that take Protocols as arguments to transform them with concrete types instead of protocol types when the concrete types can be determined statically by some compiler analysis. This is the first step of the tr

[swift-dev] Module verifier error with master branch

2017-08-29 Thread Raj Barik via swift-dev
OS: 10.12.6 (16G29) Steps: 1) Checkout swift and build master branch git clone https://github.com/apple/swift.git ./swift/utils/update-checkout --clone 2) Edit swift/utils/build-presets.ini to remove tests [preset: buildbot_osx_package] mixin-preset= mixin_osx_package_base

[swift-dev] Build toolchain failure for swift-4.0-branch on Mac OSX 10.12.6

2017-08-29 Thread Raj Barik via swift-dev
OSx version: 10.12.6 (16G29) Steps to reproduce the error: 1) git clone https://github.com/apple/swift.git ./swift/utils/update-checkout --clone --scheme swift-4.0-branch 2) Edit build-preset.ini to remove tests and assertions: [preset: mixin_lightweight_assertions] #assertions #no-swift-stdlib-

Re: [swift-dev] Swift 3.1 build error on MacOS Sierra v10.12.6

2017-08-08 Thread Raj Barik via swift-dev
​Hi, I am trying to build swift-3.1-branch from github (https://github.com/apple/ swift) on my new Macbook Pro with OS Sierra v10.12.6. I get the following error during doc generation using the command "sudo ./swift/utils/build-toolchain local-swift": """ [4193/4193] cd .../swift/docs && /usr/loc

[swift-dev] Swift 3.1 build error on MacOS Sierra v10.12.6

2017-08-08 Thread Raj Barik via swift-dev
Hi, I am trying to build swift-3.1-branch from github ( https://github.com/apple/swift) on my new Macbook pro with Sierra v10.12.6. I get the following error during doc generation which I use the command sudo ./swift/utils/build-toolchain local-swift: """ [4193/4193] cd .../swift/docs && /usr/loc