Re: [swift-dev] Protocol Devirtualizer Pass

2018-01-17 Thread Raj Barik via swift-dev
() -> Int : nil } On Thu, Dec 21, 2017 at 2:50 PM, Raj Barik <rkba...@gmail.com> wrote: > Sure, I can :) > > On Thu, Dec 21, 2017 at 12:24 PM, Michael Gottesman <mgottes...@apple.com> > wrote: > >> Is it possible to merge them? >> >> &g

Re: [swift-dev] DebugScope Verification Error

2018-01-16 Thread Raj Barik via swift-dev
On Jan 16, 2018, at 1:20 PM, Vedant Kumar <v...@apple.com> 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 <swift-dev@swift.org> > wrote: > > Thanks Mark. You are righ

Re: [swift-dev] DebugScope Verification Error

2018-01-15 Thread Raj Barik via swift-dev
> someone more knowledgable can chime in. > > Mark > > > > > > Best, > Raj > > > > On Mon, Jan 15, 2018 at 9:52 AM, Mark Lacey <mark.la...@apple.com> wrote: > >> I’d suggest looking at SILCloner.h as well as ScopeCloner in >> SILBasicBl

Re: [swift-dev] DebugScope Verification Error

2018-01-15 Thread Raj Barik via swift-dev
opeCloner in > SILBasicBlock.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

[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);

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
ntial cannot be expressed in Swift, 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) > > } > >

Re: [swift-dev] Protocol Devirtualizer Pass

2017-12-13 Thread Raj Barik via swift-dev
point you have a call of a > 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 tr

Re: [swift-dev] Protocol Devirtualizer Pass

2017-12-12 Thread Raj Barik via swift-dev
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, and the generic > specializer can produce a specialization of it. > > Notice how this approach combines seve

[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

[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

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 &&

[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 &&