Well, hello hackers. I was going and the last one no other track at the same time than me So I'm feeling the pressure and after this talk you have the party So I try to be as fast as I can so first of all, thank you for for having the time to be here and This is the first the third time that I'm speaking here in in this conference Which is very good because that means that I'm still the chief data officer of telephonica I've been there the chief data officer of telephonica for the almost four years and Today I'm going to to talk about things that we are doing in in that area. So Three years ago when I was here at first time I was spinning what is what was our vision about data privacy and and the and the usage of Big data technologies inside telephonica last year I was talking about how we were thinking about to create our digital assistant aura And put it into our system and today I would like just to refresh What been doing the last year and sharing some thoughts about the the world in which we are getting into with Artificial intelligence and cognitive services because the last three years has been amazing. We've been in a period in which artificial intelligence is Getting to the human priority in a lot of aspects and that means that artificial intelligence is Doing things better than the human in things that normally we attribute only to two humans So in this talk, I'm going to talk about all this stuff and in the end I'm going to explain what are the living apps, which is something that we created on top of our strategy So this is the the first slide. This is This is the slide that I've been using the last in the last conferences that I deliver here And it's the slide that I received to to work as a chief data officer in telephonica the first day someone Gave me this slide and said Do it and as you can see it's very clear what I need to do into what I needed to do into telephonica Well, it's a it's not an architecture. It's just an explanation. It's just a Graph to explain what wanted to be done into telephonica and the idea is quite simple We have infrastructure into telephonica. We have the network. We have the it We have the the products and services devices the network that the IOT and sensor, etc We needed to transform telephonica with new capabilities. We needed people to and that understand The data so we started to create groups with data analyst Then we try to automate systems and to create automatic tools democratizing the access to the Insights that can be generated through big data machine learning algorithms. So Once that you have that the idea is that into telephonica We will be able to do things internally to optimize our services, which is the the first one on the top left Then creating new services that we can provide to our customers then give to customers the capability of Managing everything which is related to telephonica in an easy way, which is aura the idea in the center is aura and Right part is how to create technology for institution Companies, etc, which is Luca is the big data and artificial intelligence into telephonica And the last part is how to open this platform this for platform to third-party and create an Ecosystem which is what we are going to talk today. So in a nutshell If you've been listening at any time, what is the for platform in telephonica? At the beginning nobody knew what the hell was the for platform So I needed to explain to the executive in telephonica in an easy way What is the for platform? So I create something very very very complex to explain to them And I created this video Which is only two minutes and is focused to explain to top executive What is the for platform into telephonica as you know? Telephonica possesses a wide range of technologies services and applications Our three main platforms are different from country to country and this involves a great complexity Each of these platforms is generating data But each one uses its own data models and manages the data in a different way It's as if each one is speaking its own language and this doesn't seem very Efficient for a data-centric company does it with the digitalization work that we've done on these three platforms in the recent years We've achieved an ecosystem of very robust platforms that offer excellent digital services But this isn't enough our clients are asking for even more and also achieve the speed and agility that our clients are demanding It's important that all our technology within telephonica speaks the same data language by this We mean that each piece of data be it a client's name or fiscal identifier an antenna signal or the position of a mobile device Connected to our network is stored and processed in exactly the same way in every part of the group to do this We've been working with big data teams to build the fourth platform a layer that allows the whole group to speak the same language Now I'm not going to go into detail about the fourth platform But I do want to talk about two of its fundamental parts Firstly the unified reference model the URM This is the data model with which we store exactly the same information in exactly the same way around the world But as well as agreeing on how we store the data We also have to decide how we use it and the common model for working with this data is what we call the fourth platforms API When we incorporate these pieces the URM and the API into all our services products and applications We'll all be speaking the same data language But what impact does this have? Having built this common layer We're now capable to build on top of it technology and applications that work globally and by working globally We mean that you can build it once and then they work everywhere across the telephonic a group You don't have to reinvent the wheel each time which gives us agility At an internal level We can develop things that allow us to generate efficiencies for example Analytical models that allows to better manage our network and its deployment or a churn prediction system And for our clients we're able to build things that revolutionize the way we interact with them For example services such as our new global app and smart Wi-Fi Or even something as innovative as an artificial intelligence In summary in order to offer our clients the agility they expect from us at a global level and to truly be a data-centric company We need to speak the same language of data across telephonica In order to achieve this each new product service or app that we make in the future has to be built on the same Common telephonic a language that's to say that incorporates the full platforms URM and API This is what allows us to build technology solutions just once and use them globally Solutions that generate internal efficiencies and revolutionize the way we interact with our clients such as our and our new global app What this is the which is the video it was easy to understand That is a in a nutshell what we we've been working on the last three years We started with that idea and today the four platform is a reality in in 10 countries We have more than 178 million mobile lines With normalized data we have more than 70 solutions based on the four platform One of them is aura and the rest of of them are a smart pricing a network planner and our global app a smart Wi-Fi and secure network antifies phishing solution, etc. And more than 55 55 API is families to to do things and the idea is quite simple We create the global technology and it's connected to the four platform API and in each country if they have different systems It doesn't matter. They need to connect their systems to the four platform Gateway so for us is completely transparent that allows us to create Technology faster than we were doing before and one of the technologies that we created this aura aura is launched in nine countries And in in every country is connected to different Channels for instance in Brazil is connected to the contact center is connected to what's up? It's connected to the global app in other countries like Spain is connected to Movistar home Which is how a smart display a slash phone that we are connecting in to TV We have our own social networks in website, etc. So today our eyes are starting to to grow in in all the country Quickly because people love to use artificial intelligence. So when we are starting to to think about Using natural language to as a common interface to all our technology It was a little complex because at that time cognitive services were not so so ready to be using in corporates and We needed to do you to take a lot of decisions? So we had decisions about how to create an artificial intelligence And we needed to take decision like the gender if we wanted to have a physical appearance or not Uh, if it should be useful Rational or fun one of the things that people ask the most is can aura Tell a joke to anyone and we used to say look for a friend So aura is for helping you to do things in into telephonic And that was the idea of creating aura and we started to use aura before the cognitive Intelligence was completely ready to take that decision the cognitive services that we were using and one of the things that it was Challenging for us is that today is easy to use cognitive Services to to recognize The language to recognize and intend but when you look for small details things are not very well so one simple technology like war which is widely used in everywhere If you use microsoft war in spanish, there are more than 7500 words That are spanish words that are in the dictionary, but war Recognize it recognize them as a mistake, which is very bad and in in google We have Exactly the same problem. So because of that we started to work with the real academia de la lengua in spain and also with google microsoft amazon Facebook and twitter to create a project that we it's called leia and the idea is how to speed up The usage of spanish in all cognitive services that we are using today in our technologies. So We have this problem, but when you started if you start to work with cognitive services There are a lot of problems that today we need to face So another one is the sentiment analysis. It's very easy to To use a sentiment analysis to recognize if someone that has that that is interacting with your technology It's angry. It's upset. It's sad. It's happy Whatever, but the truth is that the technology in spanish is not really at all So in this example, which is a cognitive services to recognize the sentiment analysis You can see just exactly the same sentence But with a comma and it's not a comma a very big A comma of very big importance is just a comma to create a pose Is changing completely the sentiment in one side Parallel a kello no era un problema difícil era un hacker is positive and the other and on the right just Removing a coma which is just for a pose. It's not changing the meaning at all The sentiment analysis is completely different. It's negative So the technology is still not really for for spanning of course We have a lot of bias in all the technologies in all the cognitive services that we are using One of them is quite simple. It's gender bias in In google translation and you can use some expression like it's a scientific It's a nurse. It's an engineer. It's a secretary and And the the model that they are using for the translation service, which is a And a cognitive service is selecting the gender because of the bias So it's a scientific. It's a male. It's a nurse. It's a female. It's an engineer It's male. It's a secretary. It's a female which is not good that you Are planning to use this technology in a regular base application Because of that and I would like to explain this always because I'm putting an example with google Google is working hard in trying to remove that because in the end artificial intelligence learning from the data And we have the bias in the data. So we need to to understand when An artificial intelligence have been learning with bias How created this technology that I really like it, which is testing with concept activation vectors and ideas Understand what are the vectors that triggers one decision taken by a By an artificial intelligence and indexes these samples is are very clear in the left side Shibra Stripes horse and savannah on the right side. A doctor is white coat a state of scopes and male So in the right side we we can discover that one artificial intelligence that they use an artificial vision as a cognitive Services is learning with bias and we need to take care of these bias If we want to create technology in a professional way so Another thing that scares me a little is that we are starting to To use cognitive services to recognize people to recognize everybody. This is quite quite interesting This is the natural language recognition for For google also and the idea is that you can type Any expression and it recognizes Not only the sentiment analysis, etc But also who are in the sentence So in this example, I I wrote Sentence which says temal also was choked by Chuck Norris because we did a a picture together one year ago and Putting that expression Google is able to recognize that temal also is me which is in the wikipedia in spanish and Chuck Norris is Mr. Chuck Norris and is in the wikipedia in the in the states So it recognized you very well just by the name just by the name But if you go to artificial vision the thing is a little worse for instant Today we have artificial vision which is recognizing almost anyone Quickly right now is only available for celebrities. Of course, it's me on it This is an example of one picture Here we have a mexican actor. It's me and it recognized me with 99 percent of accuracy even without the beanie hat And paco prieto with 94.2 percent, but pacolo baton is All fashion is not it's not a celebrity for the artificial intelligent today And it's quite nice because you can Try different tricks. We exchange things with kevin mechnick, which is the most facial hackers on the On earth I let my beanie hat and I was using His glasses and the artificial intelligence also recognized very well And this is scary because this is today, but in three years probably It will recognize everyone around the world Because the artificial intelligent today has available data of your faces everywhere Facebook Instagram What's up? What's up is is encrypt the problem with this is that today we we've been developing also a high resolution cameras and I really love it You can go online and see a demo This is an example here. This is a picture one single picture From a high-res camera. It's a you can see the city here and you can say, okay. I want to zoom for instance here go Go go go Go go go And if everything goes well and I have internet connection you can see the picture of people That are All around So in the future with one single picture one high-res camera all of you are going to be recognized everywhere Everywhere, which is something that probably we need to decide as a society if we want this or not But the truth is that technology is also ready and it's not perfect as I said before in the cognitive services I was showing you some examples in which Cognitive Intelligence is not working perfectly But I have one more that I really like it which is Which is the next one the idea with with the The cognitive services is that you can train a cognitive services I can train my own cognitive services and depending on the data It will learn on a different way So every artificial intelligence that we are creating is based in the training of the cognitive services that we are putting into So this is an example with Alice Cooper. Alice Cooper is on the right You sure The artificial intelligence is telling you which one is is Alice Cooper and which one is me because you can see the rectangle The idea is that I publish this picture In with and one of my friends Text me through whatsapp with a joke that I've been supporting the last 10 years That is that I look like George Clooney Do you think that I look like George Clooney at some point? Well, I was upset so I decided to test it with artificial intelligence with cognitive Services, so there is a cognitive services in Microsoft Azure in which you can upload two pictures and the artificial intelligence tells you if People on both pictures are the same or not quite simple, so I Upload that picture with one George Clooney picture And in verification it says the two faces belong to different people Which is normal. We are different people, but confidence is only 44 percent and If you rise to 50 Is the same person So I tested with Richard Pryor on the right and as you can see we are not the same Same person So I decided to look for another picture trying to look like George Clooney So I look for one picture that I That I have from three years ago when I was in four years ago when I was in the executive committee of telephonica We needed to do a photoshop session And they did it two different pictures one with the bini hat and another one with Without the bini hat they needed to decide if my picture in telephonica should be with the bini hat or without the bini hat In the end we did a data driven decision So we asked everyone and in the end they decided to use the bini hat picture If you go to telephonica xcom website, you can see my picture with the bini hat But there is another picture that is also available to download Which is without the bini hat. So in that picture, which is that As you can see the bini hat changed completely your Appearance in this picture using that picture of George Clooney The artificial intelligence said the two phases belong to the same person Which is bad for me if at some point George Clooney commit a crime That is captured by a high resolution camera and use an artificial intelligence Which had been trained with this data because it's as sure So I thought okay, it doesn't make sense because I've been using the artificial intelligence For celebrities, which is also from Microsoft, but the training is completely different. So if we if You upload both pictures To the other artificial intelligence to the other cognitive services Which is training with a different set of data They recognize George Clooney and it recognized me on a different way. So we are facing things. We are facing Issues with artificial intelligence and especially with cognitive services that we need to think before use it Wildlife and of course Artificial intelligence is recognizing you very well. So today is very easy to create a fake person a fake artificial intelligence, which is Which is going to look like you which is going to act like you which is going to speak like you But it's not you we did that training with an artificial intelligence using Technology, which is an artificial intelligence that recognized me and another artificial intelligence trying to to generate pictures of me Which are which is not me So on the right on the left side is Enrique, which is one of my colleague And he is using artificial vision from the camera Which is recognizing the gestures all the things and on the right side is an artificial intelligence Very creating me in real time to have a video conference to to do an Skype to ask for increase of salary to do whatever and of course This could be this could be very dangerous because of course you can pretend to be a 16 years girl or you can pretend to be 14 years boy or whatever or you can pretend to be the CEO of your company and or there are Wide transfer to the bank. So this technology has been used for crimes, but This this have been on one year ago. We did this one year ago in a computer in a laptop and Today have probably you have been You've been watching a lot of videos with deep fakes or whatever the technology is almost perfect And the idea is a cognitive intelligent that recognizes you very well and another cognitive intelligent trying to To bypass their The the previous one. So every time this technology is saying it's not shema. It's not shema. It's not shema until It learns how to create a real shema that fakes this This previous technology so they are training themselves to create that that new reality But the truth is that we face a lot of Issues, but people love to use cognitive services people love to use cognitive Artificial intelligence to interact so last year the trends in 2018 people love video more than 50 50% of people use chatbots chatbots to interact with customers a day 40 percent of Of internet had been using on on tv So everything had been changing and probably you if you go to a taxi And you get into and ask for an address probably the taxi driver is going to use the mic To talk to the gps to introduce the the the address of your destination because people love it so We started to work how to democratize this and how to Use it both sides for internal purposes and to telephonica and for our customers So the first thing that we did it is less to create and a quite and A quite service to create in real time artificial intelligence chatbots with With facts, etc. So we created this which is look at official intelligence Wizard the idea is that it's a website It's a wizard you go type the questions type the answers type The different neuter answers that you want to to add and once that you select the icon in in my example is Isabini hat you just publish it you and you receive a cure a cure code and HTML code that you can Invented in your website. So this is one technology that we created and I explain in this because I put it in production in my In my block Which is here So this is my block My personal block. So here on the bottom right You can see a bini hat. Can you see? And you can next things to my chemo bot. Whatever for instance, you can say Yes, I'm a hacker and quick for it And well in this case the answer is a short video because you can put videos pictures texts, whatever you think is a A quick technology to generate artificial intelligence For instance, we use it with the cure code to put it in in shops or in posters or whatever you have a movie You can put the cure code or whatever Whoever with an smartphone can type things one I have a list of things that people ask to my bot And you don't want to know it And one of the things of course one of the things that they ask is do you have heard under your bini hat And what is a hacker? What is your salary? Whatever so quite interesting but On the other hand, we wanted to use it internally so I was in telephonica and I wanted to use artificial intelligence In all our products and services and one of the places in which people Use the most Voice is at home because if you are in a train or you're in a taxi or you are in a starbucks. You don't want to be Managing technology by voice You want to be some privacy you are not going to to ask some things to publicly on on a public environment But at home is very common the usage of voice So we wanted to join that trend we wanted to put Natural language technology with cognitive services In our technology and in spain telephonica is the first technology provider at home. We have 6.5 million of of Internet connection we have 4.5 a million of houses with fiber wi-fi Pay TV we have wi-fi rotors. We have pay TV over the top with movistar blues little we have Movistar home, which is our smart screen with Slash phone we have a lot of devices, but not all only devices, but also services. We have carrier billing We have cyber security. We have And home insights et cetera. So we decided to join both things and create a And more innovative Portfolio of services at home and this is something that telephonica had been doing the all the all the history in the in 1978 we were just commercializing wireline phones, but then we moved to Internet service provider in 1995 we created infobia, which is one service that democratize Internet access in this country at that time Spain was the first country in europe With internet connections people connected to internet Thanks to infobia. Spain was number one at that time in 1998 and 1999 we developed The adcl service with one rotor with wi-fi That wi-fi service today is the most Spread wi-fi service in in spain in 2003 pay TV and we created fusion in those in 2014 We bought we acquired movistar plus canal plus and we created this platform of pay OTV content and in 2018 we started to create new services at home like aura movistar home Connection seura, which is the security from the router that you can enjoy for free if you are movistar customer one question hands up, which is not a telephonica customer Please abandon the room immediately and in 2009 actually Two weeks ago we launched a movistar living apps and the idea of these living apps was quite simple. We have a lot of devices. We have um Set of box that controls tv. We have the wi-fi router. We have the movistar Home, we have the wire line phone. We have the remote. We have iot things Etc and it's like more or less like a computer. We have the screen. We have the operating system, which is aura connected to movistar plus. We have uh Interfaces for voice with the mic with the mouse, which is the remote with With arrows to to move through the Through the option. We have apps connected to the system. We have internet connection. We have content. We have It's like a computer So we started to put all the all the pieces together and create something that we call Internally home as a computer To create an architecture that joins all things that we have in At the home and once that we have That created is like a a computer probably you remember when Years ago the amstrad the spectrum you turn on the computer And that's it if you wanted to run anything you just say run The name of the program And the program takes control of the interface the keyboard the mouse the screen etc So that was the idea that we have with the living apps So how create how are going to create a platform to run digital experiences at home using cognitive Cognitive services and artificial intelligence and we did this so the idea is that we have right now this platform Which is connected in in to the four platform if you remember the first slide in which I was talking about the Open apis for third parties to create technology on the four platform So the idea is that we have connected all devices that our customers have are the houses To the four platform we collect data. We have apis to do things into the devices We control tv. We control the wiper rotor. We control the wire line phone We control the services that we provide at home and we can integrate third party We've been integrating on this platform several companies so far for instance We integrated netflix, which is integrated in our set of bugs. We integrated twitter, which is integrated in movistar home. We integrated In veria, europea and atletico de madrid as living apps. We developed our own living apps to run experiences At at home to control all services and we are working with all of them today And speeding up to announce a lot of them in the next mobile world congress But the idea is quite simple. We have the four platform. We have the devices the devices are connected to the four platform There is a common interface which is aura aura is a cloud-based cognitive intelligent Which is created in in microsoft ashur. We are leveraging of Microsoft ashur cognitive services So the customer interact to aura using different devices for instance the voice The voice remote or remote with mick which is going to be launched this month or one app with aura You can talk to or The all-fashion remote with the all-fashion remote you go to tv and there is an option which says apps and you can You are talking to aura through a different interface and of course you have movistar home. You have touch and mick or whatever a webcam Also, so once that you connect devices you have the interaction to the to the four platform If at some point one of the customers says, okay aura open Whatever application Then the app takes control of the home as a computer that platform and it can create different experiences So this is the look like if you are a movistar plus Customer right now you have the app section in which you can run the apps and This is an example that we created with the Europa the idea is that we don't want to migrate The mobile app or the website of the company to the living room We just want to create experiences that deserves to be enjoyed in the living room So in this case, they are they created we created together But the idea is coming from them is an experience in which someone at some point is having a discussion with With their partner and say, okay long time ago. We're not going on a trip and you say, okay aura Pause Netflix and then you pause the movie and you say Okay, now open in Europa and then you just ask for a trip randomly. So this is the experience Okay, now Okay, now I want to fly in December a weekend for less than 200 euros Okay, now I want to see the offer Okay, now I want to call to hire Well, that's the idea just different experiences for third party today You can have extra content for from atletico de madrid for instance in the living app before the match After the match in the middle of the week interviews, whatever you can do similar things to with iberia We are working with a lot of companies, but believe me doing this in atletico. It wasn't easy Today looks very easy think that we did our plan very in a staff three years ago with the fourth platform Normalizing data and creating the apis and once that you have the data and you have the apis The apis you can do a lot of things. This is the atletico de madrid. This is another example That's the idea just using artificial intelligence in the core services of a company like telefonica And take the most of the cognitive services taking care of the issues that we are facing you need to analyze Carefully what is going to do your artificial intelligence and how every single cognitive services you are using Works and create the best experiences for your customers. And that's all. Thank you very much for your time


Justin Verlander making his seventh all-star appearance and Justin, it's great to have you with us up here And first of all congratulations, man couple days ago your wife Kate Upton announcing you're gonna be a dad So what's that feeling like? It's pretty exciting man nervous excited. You know, it's it's it's a great It's a great feeling man. I'm ready for a new chapter in our lives. You got some catch up to do I got four I'll keep I'll keep working on it Hey JV Alex here congrats on the new baby, um, yeah I think we've said it all with you with you know MVP and what you did in the world series last year a lot of people don't know That you wear number 35 because of the big hurt Frank, which I love that But the latest reveal I want to ask you on the plane on Sunday with your teammates. Yeah, you showed a little Shiggy You'll reveal Your new dance moves. What is it? What do you got on that? Yeah? You know bregman bregman keeps up to date with pop culture and he's like hey, man. Let's do this dance You know And then about halfway through I didn't know what else to do And I've shown all my moves already So I just went ahead and sat down and then and then breg is shaking his butt in my face So what else do you do you slap it tremendous tremendous?  That's called the all-star boogie Hey Justin this big poppy right here, man. How are you man? Congratulations once again. Thank you Hey, I had a big question for you. I remember a couple of years ago You were having some army choose. Yeah bounce back I would like to know how much it have to take you to get prepared because you know as we get older You know, we start it's a challenge every day to get prepared to go out there and compete But it seems like you you put on play the experience Yeah Before you take the mound every five days and man, let me tell you what I have been seeing the past couple of years Justin Berland that I faced at the beginning of his career. Yeah, thank you man. A lot of hard work You know that you guys all know that you know as you get older need to make some adjustments I had a core surgery and now kind of like I Hit a fork in the road of my career where I either needed to make some adjustments and change some things or I was gonna be out of the Game and obviously that's an easy decision So I kind of completely revamp my body How I think about preparing myself to pitch and how I prepare in the offseason and everything that I do in season maintenance wise and You know, man, it was hard Competing at this level When I was competing against myself being healthy as well You know this games hard enough when you're going out there against the best in the world when you have to when you have to worry About what's going on with your arm as well It's all the harder. So honestly the last couple years man. It's just I Got back to being healthy and got back to my arm not hurting And just was able to go out there and play the game that I've loved and have fun and compete Got you down off a bad boy, man Just in this Frank I got a serious baseball question for you.  That's the best in baseball one question here I want to go inside your clubhouse How determine is this team to repeat this year? Very That's one of the that's one of the best things about this team man Like if I were to come in to this organization This offseason instead of being there last year, I would have never guessed that they won a world series That's how hungry they were you know working just as hard as ever if not harder, man And that atmosphere it just breeds success man. It's it's a lot of fun to be in here with these guys these young guys It's honestly like showing up and working with 24 your best friends every day, man It's it's a great place to work. That's good.  Do you need another big acquisition? We just started the show talking about Manny Machado how he may be on the move Yeah, how do you feel it when you're playing so well you still feel like you need upgrades as a team? I don't know. I feel like it's always to have and have nots, you know, it's like When you're part of a team every day and you play as much baseball as we do You know, there there's always holes that you can see and you can always find a way to get better You're wearing a weird transition right now in baseball where you've got some teams that are not trying to compete And you've got some teams that are really really good So I think you're in a situation where you can almost forecast kind of what you need Against said teams in the playoffs if you make it so You know, I I don't know if we'll make a move. I envision us probably doing so But that's you know, that's out of our that's out of our hands And we just you know, like I said that same atmosphere that these guys are always hungry It's kind of that same feeling it's just go play ball win baseball games and let whatever else happens happen Justin, what are the chances to call your little baby poppy? Zero I Honestly, that's the best answer in the history of the show Go enjoy tonight. Thanks for taking the time to do


Abstract, this study proposes a novel approach to deliver drugs to the eye-using engineered peptids that combine to melanin and reduce intraocular pressure. The results show that these peptids can be used to provide sustained therapeutic delivery in the eye and beyond. This article was authored by Henry T. Su, René T. Cho, Acha Rai, and others.


A large number of volunteers and organizations gathered at the Appalachian Wireless Arena to prepare for the annual Banquet for Life, hosted by the Appalachian Pregnancy Care Center. I spoke to a few organizers to see what the Banquet is for and what theme they will be going with this year. The Banquet for Life is a celebration of life, but it is our main fundraiser. We do the Banquet for Life of course. We are a non-profit organization and you know some children's organizations, they have federal funds and state funds. We don't have any. So we just depend on our community and people, really God's people, to help us with what we're doing. So we're doing this Banquet to raise funds for the Appalachian Pregnancy Care Center and to just show an awareness of life. There's still a little bit room left at some of the tables we could probably put about maybe 10 more people. I'm proud of all the donors, the sponsors and everyone that's helped us throughout the years. My staff comes today and we decorate and get the tables ready and get everything beautiful and our theme this year is over the top. I think it's a focus on family this year because it's most important. We know it takes a village and I think we do that wonderfully here in Pike County and Eastern Kentucky really, we take care of our children and our families and so that's our focus this year is you know, it means family. Ohana. Well today we are decorating, decorating, decorating. Danae and I, we are in charge of doing the decorating here and divvying out different jobs amongst our amazing volunteers. So mainly going on today is organizing, decorating, getting everything in place. Tomorrow things will start coming together like the centerpieces for our tables. We have volunteers today putting on chair covers, table cloths, folding napkins, anything you can think of. We have help and everybody's here working together. And we try to bring just a wonderful colorful event so when people come in, they're going to know exactly where they are. Hopefully people will come in and know they think we're in Hawaii or we're at a carnival or whatever it is. We want them to come in and feel like they're just blown away that they feel like they're at that certain location. So if you want to attend the Banquet for Life call<PHONE_NUMBER>.


So, if you recall in the previous class towards the end we started looking at information about next to the information and then we were trying to minimize the number of constraints. Now actually if you look at this part this was just to bring this example out but actually we do not minimize number of constraints. What we do is we use next to the information to at the time of code generation 2 make sure that when I am using registers when I am using temporary I will use fewer temporary. So, when I talk about 4 generation that time you will see that I am actually going to use the next to the information. So, let us look at what code generator does and what I am assuming here is that we have 3 address code we already have a model of the machine in mind and this 3 address code is now to be converted and we look at both arithmetic logical, Boolean or kind of expressions into some kind of machines in X that is the intent. So, what we want to do now is that for each statement in each statement is in general of the form either X being assigned by of Z or is if X well of Y then we go to the level of this form what we want to do is we want to remember if often in the register in my register register is one of the resources but we will also remember more things. So, what we do is we create two kind of descriptors now one is what we call as register descriptor. So, basically what I do is I create a table and in this table I say that if I have registers r 0 to r n minus 1 I want to remember what each of these registers contain. So, I may have information like saying that this register contains value of k this register contains c and so on. I may also have a situation where I may say that a register may contain two variables. So, register may contain let us say a and d how would that happen is that possible that a register simultaneously can contain value of two variables possible. So, I do not look at the value I do not know I mean how many variables may have the same value. So, the reason this may happen is that suppose I say a is assigned d is assigned a. So, what I do I will do is that I have a time to erase which has been loaded in a register then I just do an assignment. Now, assignment means this value is already in the register I do not have to change anything in my descriptor. So, register descriptor basically says keep track of what is currently in each of the registers and initially before the dressing block I assume that every register is just an n. So, I start using register and end of a dressing block. Now, I have another descriptor and this is called address descriptor and what I do here is that for each of the variables I want to now keep information and these variables are nothing but either they could be user variables or which are in the symbol table or they could be temporary variables and I want to keep information like that for each variable. So, if these are my variables I want to know places where they are available. So, if this may be available for example in both register and memory. Now, variable may also be available more than one place. So, for example if I say that I have a variable in memory and then I say load it in register. So, then it immediately becomes available at two places. So, this is what my address descriptor is that I want to keep track of locations where current value of the name can be found at run time because we are not talking about execution of the program. And the location might be a register, stack, memory address or a set of these locations. So, a variable may be available simultaneously in more than one location and a register may keep value of many variables including simultaneously more than one variable. So, these are the two descriptors I create when I start doing code generation that I will say that initially now initially where will variable be what will this register descriptor contain when I start doing code generation of a basic node. All of them will be in some memory location. They are not going to be in any of the registers. I will start voting them as I go through the registers and each register to begin with is going to have is going to be empty. So, these are the two descriptors I have and I come to Boolean style and more information. But right now for arithmetic and logical expressions there is sufficient information as well as code dimensions. So, what we do now is let us look at how we do code generation and what I am looking at is the simplest possible output. In fact, I mean this is the most general output which is X being assigned Y of Z. The I can have unary operators. So, I can say X is assigned of Y or I can have just assignment where I say X is assigned Y. But those are actually simpler cases. This is the most complex case I have. First conceptually understand what I am trying to do there. We want to generate fast efficient code and therefore as far as possible we would like to use registers. Now suppose I say that I want to compute these values now to begin with everything is in memory and Y and Z are in memory and I want to apply this operation on them and store value in X. Now as far as possible I would like to use a register to store value of X. That is the first thing. Second thing I will say is that suppose Y is or Z is already in one of the registers and that register has or that particular variable has no filter use then I can reuse the same register and this information comes from the next use information. So, what I do is that first I say let me get a register for doing this operation. That is the first function I call. As far as possible we will try to use register. If register is not available or register is not required then I will use a memory location. But my first preference is always going to be a register. So, first I do is I make a call to a function which I call get register and we look at this function in the next file. What this function does? It actually returns a location which says this is where you can compute and store value of X. So, what this get register does? We invoke a function called get register which determines some location. So, this location need not be a register it could be anything but so do not confuse between this name get register and location L. Get register always need not return a register. It could be any location but preferably it will be a register where X is going to be stored and usually L is going to be a register. That is always not possible. Now, if this is in a register what do I do? I will say that I can load. Now, suppose this register did not contain anything what I can do is I can load Y into the register and then I can apply that operation on the register with Z and I am done and then I just have to move it. But suppose now if I check that Y is already in that register I can do that check and how do I check that? So, it is possible that get register found that since Y does not have a future use I can return whatever register is being used for Y for keeping the value of X. So, remember this P1 is being assigned P1 plus P. So, I know that beyond this point P1 has no use. So, I can use the same register. So, I need to check whether this register contains already Y or not. So, now we look at address descriptor of Y and we want to find out Y prime. Now, remember what is Y prime? Y may be simultaneously available in more than one location. I want one of those locations which is the fastest to access and fastest is normally going to be a register. So, we determine Y prime and we prefer a register for Y prime which value of Y is already not in L. Then what do I do? I generate one instruction which says move Y prime to L. Now, remember what may happen here is that I am saying that look at Y. I look at address descriptor which says that Y is in register R0 but R0 may have a future use. So, get register will not return that. It return register R2 for example. Now, I cannot overwrite R0. I need to protect it. So, what do I do? I say that now move copy value from R0 to say R2. And then once I have generated this instruction. So, move instruction is basically a copy which says that from the location where Y is stored and that value location is Y prime load this value into L. That is the location which has been returned to me. And after that I generate one more operation which says now OP and OP is this OP which is this operation of Z prime value. Now, what is this? What is Z prime? Z prime again is a location from where I can pick up value of Z at runtime and this again is expected to be the fastest location that we use. So, it is possible that Z also from the address descriptor is available in multiple locations and if it is already in a register then what do I do? I just applied this operation. So, suppose to begin with I say Y is in R0, Z is in R1 and this returns a value saying that both R0 and R1 have a future use. I cannot feel it returns R3 for this. So, what do I do? Immediately I say first move Y to R3 and then I say add R2 to R3. So, these are the two instructions it is going to generate and sometimes first instruction may not be generated if Y is already in a register which has been returned for computation of X. Then I generate only the second instruction. Now, what do I do after this? So, I started doing code generation for this free address code which says X is Y of Z and I have generated these instructions. Am I done? Do I need to do anything more? Any more code generation or any more bookkeeping? I need to do bookkeeping now because now I will have to change all my descriptors. So, now I will say that I am using now L which may be a register. So, now this contains value of X and then I have to change address descriptors of X to say that X is now available in this particular location. So, now again I am going to prefer register for Z which was Z prime and after this I update all my descriptors of X to indicate that X is in L and if L is a register update descriptor to say that now it contains X and remove X from all other locations. So, I do bookkeeping after doing this code generation and now we say that if Y and Z they have no next use and this is where this next use information is coming in and we say that they are going to be dead on exit from this block. We change descriptors to indicate that they are no longer containing these registers. So, that get register can take advantage of this fact that this is no longer available as a register and therefore these registers immediately become free. So, I need to generate two instructions and then I need to do some bookkeeping. This is where I use next use information. This is one of the places where I use it. Simple straightforward. So, as far as simple arithmetic instructions are concerned I can easily take a clear address instruction and I can match it on to a machine. Now, you can see that I assume the machine which has move and so on. Now, you can see that if I am using certain addressing modes then I will have to use addressing modes of Y prime and Z prime. At least I am assuming it is a register. So, that that will be straightforward. So, if I have complex addressing modes then I say that whatever that addressing mode is which will help me fetching value of Y prime and value of Z prime. I am going to use that addressing mode which I am not going to explain. Now, let us move on to this function getreg which I use here. Now, how will getreg work? So, getreg is saying that getreg is being invoked to say that give me a location where I can do this computation. So, what do I do? Now, we say that if Y is in some register so, what is Y now? Y is the first component here. So, now we say that if Y is in some register that has not hold any other value. You can see that Y may have some other value where this variable may not have a future use but this may have. So, I need to remember that. So, if Y is in some register and has no other value and Y is not live and has no next use after this particular location then what can I do? I can say use the same register. So, if we say Y is in register R0 and beyond this R0 does not hold any other variable and Y has no next use. That means I can free R0 immediately after this particular instruction. I use the same register for doing this computation and getreg is just going to return a register for Y. Now, it may so happen that this register either holds additional value or Y may not be in a register. In that case this condition is going to fail. So, what do I do? In that case I say get a free register and use that in that case. I was giving you the previous example. I just took a fresh register. So, to begin with no variable will be register. So, first time I am going to use a new register. Now, suppose there is no empty register. This can still fail that I find all the registers are full and what do I do? I can find the memory location but I prefer a register. All registers are occupied. So, can I free a register temporarily? So, this is what is known as register spilling. I can say this register does not have an immediate use. What I can do is I can take value of this register, load it to some temporary location, start using this register and when that particular variable is required then I load it back into the register and continue from that point onwards and this is a technique which is known as register spilling. So, what we do is if x has an x2 in the block or operation is such that it requires a register then get a register and how do I get a register? Store its content into memory location by this and use it. And at some point of time we have to get. So, what is the advantage of this? The advantage of this is going to be that suppose this x has lot of uses beyond this one. And this particular variable which is containing r is not going to be used in say x2 instructions. And I may do only one extra store and extra load but then all the accesses of variable x are going to be used because that's the advantage. So, now you can see that if x has an x2 in block or this operation sometimes may say that I can do this operation only on a register. I cannot do this operation on a memory location. Then I need a register. So, register spilling is the standard technique which is used and as far as and you can see that register spilling is always going to have an overhead. So, you would like to minimize register spilling as far as possible. We will see example of how to reduce register spilling but in this case we have to do a register spilling. Now, suppose this is not required that either we say that this is the only time I am computing x beyond this point. x is not going to have a use and therefore there is no point in the spilling that means moving something into a memory location and loading it back and also the pressure is such that it does not require a register. Then I may use directly memory location for x and so on. So, only this memory location will be used if all these conditions fit. So, as far as possible use a register but if there is no free register then try to use a register by freeing it temporarily and using it. But if it is not required then there is no need to free a register because every freeing a register requires two operations. One for moving the content back into memory and second time moving it back into the register. So, then you will say these two instructions. So, this is what get register. Now, there are lot of optimizations you can see immediately possible here because I say here if x is in a register that holds no other value I can do the same thing for z. And also you will see that and this is something you can try by compiling your program for c and you will find that lot of actually optimization which goes on here and it is not possible that if I look at this non-trivial to find out whether x plus equal y and x is being assigned x plus y they are equivalent. It is not easy for compiler to do this kind of small computation. So, many times you will find that when it comes to code generation compilers generate better code for this as compared to this. Because then they assume that the first operand on the right hand side is same as and therefore you are saying that whatever is the variable here that is being used to store the value of the left hand side. So, normally I mean y I mean c introduce these kind of operators reason was that I do not have to do too much of symbolic computation I do not have to do optimization at that level if operator if an user can help me in using these kind of operators then all this is safe. In fact, it becomes sometimes worse than this that suppose I have a long right hand side where x occurs somewhere then whether in general this can be transformed into something like this it is not free way. Computationally it becomes very possible you can do lot of symbolic analysis and you can do all this reorganization but that unnecessarily takes time and therefore if user knows that this is much faster you will find that so you will find that lot of c code when you read and there is a purpose for introducing these operators that I can generate more efficient code. Here how we generate code now for arithmetic operators so this can take care of all possible arithmetic operators it can even take care of Boolean operators if I am just doing assignment so we will see how the conditioners are handled but at least as far as assignment of Boolean operations is surprising the sensor you can see that I am just using off here I am not specify what kind of operation is this so any binary operator, unity operator or any single assignment it is going to work for everything so how do we handle I have an example so let us go through this example so what we have is suppose I am looking at a block in which the first instruction says p1 is assigned a minus and the notation is saying that whenever I use this p1, p2 and so on these are very variable generated by compiler and whenever I use like a, b, c, b, etc. they are the user variables and we will assume that all user variables are going to be like on the basic so what we do here is for this we say that my get register routine because nothing is in register it turns the register it says it can be used for computation which is r0 so I now first say move a to r0 and then I subtract from r0 and how do my descriptors change at end of this these two instructions this says r0 now contains p1 and this descriptor says that p1 is in r0 and then I have this instruction it says p2 is assigned a minus c now what do I do now I can see that a is now what happened here was that I decided that whatever is this value I am going through another load again here so now since this value is already in p1 we now say that move a to r1 and then we say that and the reason will become apparent when we look at the rest of the code by I am doing this extra verb and then I say subtract c from r1 so now at end of this we say that r0 contains p1 and r1 contains p2 and p1 is r0 and p2 is in r1 so let me actually give you the full code here so now this says p3 is assigned p1 plus p2 so now I find that both p1 and p2 are in registers and beyond this point p1 has no use so this register can be used and therefore what we do is we straight away instead of doing a move operation straight away to an addition and my descriptors change like this and then I say add p3 and p2 and p2 is in r1 so now I can use because beyond this point you will find that neither of r0 or r1 is going to have a use so what I do is I just do this addition and then store it into memory location d and my descriptors now say that r0 contains d and d is in r0 and d is both in r0 and memory location because of this move operation so this way my code generation can happen but when it comes to conditional I have to deal slightly differently and machines provide special hardware to deal with conditions so what happens here is that normally if you recall assembly language programming you have done you will find that there is something called the conditional code descriptor or condition code bits on the machine so whenever you execute an instruction on a machine simultaneously depending upon the value of the result some bits are going to be set so suppose the value is very high some overflow it will be set or value is too low overflow it will be set if value is 0 some 0 bit many set if value is negative some positive bit many set some negative bit many set if value is positive then some positive bit many set and so on and that happens automatically in the hardware and advantage of doing that is that when it comes to conditionals I can take care of many of the jumps by looking at these condition code bits I do not have to explicitly do the computations so what may happen is something like this that when I say I have branches so what may happen is something like this I say that if x is less than y then go to z now I for example if I look at first two instructions here this says move x into r0 then it says subtract y from r0 now I do not have to know the value of r0 I do not have to compare value of r0 with whether it is less than 0 or not simultaneously what will happen is that some condition code bit will be set which will say that if r0 is negative then that bit is set and what do I do here then I just say that jump if that bit is negative on the location z okay so basically what we do is that if one of these six conditions so it could be either negative 0 or positive or non negative non 0 or non positive and many machines will have up to 16 condition code bits and simultaneously on each operation more than one condition code bits will get affected okay we are going to set that bit and then we use this information here in the instruction and do this so I am you can see that I am not comparing r0 with anything but this condition code information is being used because condition code has been set because of this operation okay so what we are doing now is that we use condition codes and we indicate what was the last quantity which was computed and load even when I do a move for example for example when I say move x into r0 some condition code bit will be set okay depending upon what is the value I am moving what is the value of x okay so if value of x is positive then automatically move x r0 inside the condition code bit okay so this is loaded into location okay and depending upon what was the computation or loading which happened one of these bits is doing itself and I am just using this extra information but machines also provide the compare instruction where I do not even have to do a move and do not have to do arithmetic or logical operation I can state I will do comparison operation and comparison operation also is going to set one of the condition codes so what may happen is something like this when I say compare x and y this sets some condition code bit to positive if x is greater than y okay and similarly for other value so what I may do is if I say if I want to do code generation for this I may just say x and y and condition on less to z okay so this becomes now conditional jump okay so this is so there are two kinds of jumps one is unconditional jump where I just do not test anything I say straight away change the program counter to this new value so jump is nothing but changing the value of pc okay and condition conditional jump is you say that change the program counter to z only if this condition is met it says that it is less okay so I can use both these okay but then I can also use to remember something known as conditional descriptors so I have these two descriptors now I can also keep one more descriptor and say that what was the last operation which saved a bit or impacted a bit okay so what may happen here is something very interesting okay so look at this if I can remember suppose I say x is sign y plus z and then I say if x is less than 0 then jump okay now because of this computation I don't even have to have a comparison operation what I can do is if I can remember what I can do is I generate three instructions for x being a sign y of z so I say move y into r0 at z and then I say move r0 to x okay now when this happens then I know that one of the condition code bits is going to be set because of x now it is possible that these two instructions are not adjacent there is maybe there are few other instructions which are in between but they are not impacting the value of x okay I can still use if I can remember that the last time I loaded x this bit since that has not changed it was set by x okay so what can happen in that case is I can now just say that jump on negative from some level x this operation itself you can see that I can even say one comparison instruction if I can remember this particular thing that the last operation was the one which really changed this particular bit okay but for that I need to do additional bookkeeping and that additional bookkeeping is in terms of a condition code description so for each of these condition code bits I can say that which bit was set because of what operation if I can remember that then I can further save certain instructions okay but again you have to see that whether machine provides this information and machine provides all these facilities okay so some of the earlier machines for example did not have enough condition code bits they I think earliest I remember is a one byte condition code disker of condition code bits that means I took separate 8 conditions and some of the recent machines had 16 conditions and 32 conditions and so on all kind of funny things will happen but if you can remember those things then you can impact these things yeah okay so you can see that how do I handle conditionals and how do I handle how that we address codes okay and this as far as machine is concerned is really nothing but correct code bit is coming out you have a question in the last place in the last place if you have here so my conditional descriptor will say that but then see this descriptor here condition code descriptor so my condition code descriptor suppose I say that x is time y plus that and then I say compare say A and B suppose I have one more instruction now compare A and B is going to impact certain bit as soon as it impacts a bit my conditional condition code descriptor is going to say which bit was impacted and if it was the same bit which was impacted by x then my descriptor will change and I will get this instruction but suppose that bit was not impacted which was set by x then I can use so that is why I am saying I need to do additional bookkeeping because not all the hardware but the compiler has to do it instead of saving only one bit we can have a then we will be able to save many variables that change that that is the hardware see this descriptor condition code descriptor if I can say if I have 16 bits I will say that I will keep this condition code descriptor and say that for each bit so this is bit 1 bit 2 and so on I will remember that what impact but how is bit 1 set and bit 2 set and bit 3 set that is not in my control that is the control of hardware hardware has already decided that this instruction executes and these conditions are met then these bits are going to be cleared that is beyond us so the descriptor I can keep is only for all the bits and for the instructions which are impacting those bits right this question answer or not so let us move on and let us also see that hardware will get code for that now so far I have been looking at 3 address code but we also remember that at one point of time we started looking at DACs and how is a DAC different from 3 address code how is a tree different from an expression tree different from a 3 address code only name of temporary is not the same right so in a tree or DAC I will not have temporary I will have only internal loads and when I explicitly write 3 address code I am going to have this temporary names so basically what will happen is that when I start doing code generation for a tree or DAC you remember now that what is the name I am using internally for each of the nodes that is the only additional thing I need to do now right because these names have to be generated at some point of time so what will happen is that this is useful data structure so we have already talked about properties of these DACs but basically leaves are going to be leveled by the identifiers which are either variable or constants interior nodes are going to be leveled by an operator symbol and nodes are also optionally given now a sequence of identifiers for labels because I will have to jump somewhere so I need to have levels and this is the only information I will have as far as a tree or DAC is concerned other names I will have to completely generate okay so let us look at this particular use of code okay so this is some DAC some representation of a DAC where I am saying that I want to compute T1 which is 4 star I T2 which is array access with this particular array access of a so this is basically saying is ai then I recompute T4 star I and then I say T4 is signed VT3 so this is fetching ai this is fetching ai this is giving VI then I am adding the 2 and what is this doing then I am saying that I am after doing this multiplication I am adding it to a variable product this product is then assigned T6 I increment I and then I is assigned T7 right and then check whether this is less than equal to 20 and if it is then I jump to level 1 so what is this is doing is just taking 2 arrays and finding out their thoughts right this is the computation I am doing now you can see that here 4 star i is being recomputed now since I am talking about DACs you can see that I will not recompute but I will use the same nodes for this computation and similarly when I say T1 T1 is 4 star i and therefore T3 also is 4 star i so if I just compute this T1 I can access A with T1 and I can access B with T1 and as far as these 2 instructions are concerned which says T6 is assigned prod plus T5 and then prod is assigned T6 since there is a single assignment I could have said right away T6 is being assigned T6 or prod is being assigned prod plus T5 and here I can straight away say i is being assigned i plus 1 right this is how it so happened that this is how I did it okay so we look at i0 which is basically i and this is 4 the 2 are multiplied value is stored in T1 so this T1 actually now contains star 4 i and then I have A and T2 is basically saying that I am looking at base address of A and I am looking at index T1 and T2 is now an array operation which is saying AT1 so this is corresponding to the second instruction and then I say since T3 is a copy of T1 therefore instead of generating a new tree I just generate a label is currently called T3 and say that T3 now capturing the computation which is below this node and then I have T4 being assigned VT3 now T3 is same as this so what happens here yeah so we have B here and T4 is nothing but B and the same node which could either be called now T1 or B doesn't matter okay and the next one is T5 is assigned T2 multiplied by T4 so T2 multiplied by T4 is being assigned T5 these are the two edges which are not visible and then we say T6 is assigned prod plus T5 so I am looking at T5 and I am looking at prod I am adding the 2 and that goes into T6 and then I say prod is nothing but T6 so therefore this node is also given a label called prod okay and then I say T7 is assigned I plus 1 so T7 will now take this value so this is taking I plus 1 which is going into T7 and then I say I is assigned T7 so I now gets the same label and now I have this conditional it says if I is less than equal to 20 then I go to 1 so what I do here is I have this conditional which is testing for less than equal and is jumping on label 1 and it is testing this value but this comparison okay so this is how the DAG looks okay and then if I look at the code generation okay this is the straight code for the T not really the DAG okay so what happens here now here we are saying that S1 S1 is now some symbolic resource which is being assigned for star I I look at the base address of A and then I do this array and I do this computation but if I do it for the DAG what are the instructions I will say immediately you can see that this instruction will be eliminated and instead of S4 here I will use S1 but what happens to this part okay this part I will say that prod is generated so S8 will be eliminated because this is just a copy and I will say prod is assigned prod plus S7 and similarly this part will say that this is assigned I plus 1 and this is conditional so I will be able to eliminate one of the instructions here okay so this is how the whole code looks okay that this instruction gets eliminated and this instruction these two are merged in one these two are merged in one okay so this is the advantage of that okay and you can see that basically how do I do code generation and we shortly see how to do code generation for T's okay if I know it for how to do it for T and you can see also because the way we treat it thanks we are keeping extra labels for this thing so we have seen how to do code generation for 3 address code but we have not seen how to do code generation for T's as yet but basically since we are going to do that next okay I am showing you that basically you can handle the two things together okay so we will see how to do code generation for T's alright so let's move on okay now let's come to something I just mentioned about for this test field okay and if you recall in the beginning I said one of the optimizations was that I wanted to change the order of execution so now when I say that A is assigned B plus C and suppose B and C are expressions then which expression should be evaluated first suppose both are function calls so suppose I write a code like this here I say that T is assigned let's say F1 plus F2 and both are function calls okay this clearly says do an evaluation from left to right but what is normally not specified is many times which function should be evaluated first okay and suppose these are complex expressions okay so what master rules tells me that this are actually evaluated from left to right okay but most of the time we don't really unless they are explicit side effects and I am doing partial evaluation and side effects could be different okay I don't care about how do I do my evaluation whether it is left or right most compilers will try to do it in an order so that I can optimize my resources okay now how does changing the order of evaluation optimize my resources so look at a simple situation suppose I have some limited resources I have any resources okay now when I start doing this computation this could be an arbitrary complex expression I start doing this computation suppose efficient computation of this requires n registers and I have only n registers okay what will happen here that I am going to use all the n registers for this computation but finally I will leave this value either in a register or if I require more registers then I will do a spelling okay and I leave this store store this particular value in memory location now suppose I leave it in a register then I am left with one few registers okay now suppose this also required n registers okay then this register can come only because of spelling okay so what may happen is that if I change my order of execution so look at this code okay now this code actually is interesting what I have is t1 is being assigned a plus b then t2 is being assigned c plus b and t3 is being assigned e minus t2 so you can see that this particular instruction depends on this but if you look at t1 t1 is being used only in the fourth instruction okay now if I look at the tree corresponding to this again I mean these edges are not visible sorry about this but what is happening here is that I am on the left hand side I am saying that a and b are being computed and they are being stored in t1 and then on the right hand side e and d are being computed c and d are being added that is being stored in t2 and then I am saying e minus t2 is being computed and that is being stored in t3 and then I say x is now being computed by saying t1 minus t3 okay this is the kind of situation I have now suppose that I have only I have three address code and I have only two registers available that is an assumption I am making and I am doing my left to right evaluation so what can happen is that I will generate this kind of code so this is this corresponding to saying that I am moving a to a register then I am adding b to this so this gives me now a plus b okay and then I say c to a register so a plus b is now available in register r0 okay so one register is now blocked on the left hand side now I say move c to r1 and then I say add now d to r1 so I am now computing c plus b and beyond this now I say move r0 to t1 okay now why I am doing this basically now I want to do this computation which says that I temporarily free this register r0 this basically is now moving a register spelling and then I am moving into a register which has been freed by this particular spelling and then I do this subtraction and after I have done this subtraction and one of the registers has become free then I move t1 back into r1 and then I subtract r0 from r1 so basically after this r1 is being stored in x and now if I change order of execution here suppose I say that I am first doing this computation now you can see that this is a smaller expression which requires extra registers this is a smaller expression it requires one less register suppose I did this computation first then these two instructions I am generating which is moving r0 to t1 and moving t1 into r1 these two instructions would have been saved because this is basically is the register spelling so what kind of code I will generate this is now going to give me these two instructions are saved and basically this is saying now compute c plus b e minus c plus b which is being computed and that is being stored in r1 and then I am left with r0 and I can use r0 for doing this computation which says t1 is assigned a plus b so a plus b is now computed in r0 and then I do this subtraction so basically this is what is register spelling and this is what register reload is so sometimes changing the order of execution is going to give you faster code so normally there is one technique which is used is that when I am trying to code generation code please I will use dynamic program and I say that I keep on computing the cost of so cost could be in terms of number of registers and say that I keep on computing number of resources required for the left hand side and the right hand side and I determine which is the optimal way of doing it if a dynamic program immediately makes it your complexity, computational complexity goes up so you can either do it in single traversal and incur this cost but many times when you want to get optimized code then you use dynamic programming for doing that and find out that using computing this part into a register and then doing this computation is faster and you are not violated any rule because there are no side effects the computation is going to remain the same and therefore you can get much faster code as compared to this one now you can see that actually so this is another thing that has to sort of register in your mind and should come clearly when we take the faster code now you may start computing how much I am saying I am only saving two instructions no way but what you have to remember is that if I count number of instructions I have how many four and two six and two eight plus two ten instructions and when I say I am saving two I am saving two out of ten which is twenty percent saving and if this is part of a loop which is executing large number of times then this twenty percent saving can be very large in fact when people are doing optimization nobody is saying whether my program can run hundred percent faster or can double the speed or triple the speed no I mean people are saying can I program run ten percent faster twenty percent faster can I cut down ten percent that is a big game for people I mean imagine a situation where somebody's program is running for twenty hours if you say I can finish this in sixteen hours that is a big game for the person and all large computational program actually run in those days I mean in terms of hours and days they are not like when you type the program say eight out now press return and this is there you press eight out now and then you go home somewhere between that after three days and check your result normally this is what happens and that is there are all these optimizations done so even a small saving there five percent ten percent saving is matters a lot and that's the number of people are looking at nobody is looking at can I double the speed of my program and that is something unless we have very special hardware is utopian on a single machine no matter of optimization and a single processor is going to be that kind of speed unless you have some very specific program you will do this so rearranging order is important but there is not the only thing we want to do we want to do more optimization and this more optimization is what we know as people optimization so I'll just introduce this and then we can take a break so basically what people optimization is something like this I look at here this board so let me go back to an example we had yesterday that we look at this board as example here so what you want to do is I say that here are six instructions okay let me have a small window which I call a people okay and move it over this board okay and when I say move it over this code I say that suppose my people is of size two okay then you say that okay move it over this code and say look at these two consecutive instructions and say that can I convert this into a faster instruction okay now when you move it over this part of the code okay you will see that immediately notice that you are saying move R0 into a register and then you are saying move R into a movie A into a register and going load and store so people have created these kind of pamphlets now where you say I am doing this kind of store and then I am loading this value second instruction can always be ready okay similarly if I say that my window is of size three okay then I can experiment with this code and say oh I know this template this is just adding a constant value to register and I can then just replace with this by single instruction okay so people optimization in general is a technique where I examine my code after four generations it happens I do not do any of these optimization try at four generations and once I have this code then I define my P4 of size two three four and normally people have experimented and normally it was found these are empirical results got asked for any proof because there is none this says that normally if I have a P4 of size 4 to 5 then a large number of optimizations can be done by just mapping these templates okay so what you try to do is you create a lot of pamphlets and then move it over the code and whenever you find a template like this let us replace it by a faster instruction sequence so it is possible that I may take these two instructions replace this by one I may take these three instructions replace it by two and so on and do it few times and you improve quality of your code okay so what we will do in the next classes we will look at few pamphlets of people optimization and then we will also look at four generations of how to do four generations for piece like we did for three generations okay so this is where we take a break today and last class in the last class we will discuss these techniques okay on first day


Service members from various commands and their families were in attendance for the annual raising of the American flag at Naval Station Rota. The flag is raised just once a year through the Fourth of July weekend because of an agreement with the Spanish, which makes the ceremony unique and special. The flag represents different things to different people, and Rota's newest commanding officer spoke about some words that exemplify the ideals of being an American.  A great nation through which each and every one of you have dedicated your life to defend. To guarantee the maintenance of those principles, to ensure your quality and liberty for your children and their children in future generations. The U.S. is celebrating its 62nd Fourth of July in Rota, Spain. Petty Officer Jordan Del Gardino, Naval Station Rota, Spain.


It incenses me how they write about you. This is the New York Times. And this is, again, this is not the op-ed page. Okay, if it was the op-ed page, I get it. In Chat with Musk, Kennedy pushes right-wing ideas and misinformation. Right away I'm pissed off because misinformation, okay, who's... How about you're in the newspaper, just tell me what he said and I'll decide what's misinformation. This arrogance of, we know what the misinformation is about science. I read an article in the New York Times, so you know it must be true. That's where the doctor said, I think I remember it was Navarro, and she said, nothing in medicine is fixed or precise, unlike other sciences. I thought, ah, that says it exactly how I feel. Nothing in medicine, it's not like other sciences, like some others. I mean, okay, anyway, here's... So this is their headline. Already you're into misinformation. So you're on with the increasingly rightward-leaning chief executive, Elon Musk. So now we have him painted. Do you consider Elon Musk right-wing? No. I consider him like an ultra liberal. I love him. I consider him a genius. Well, that's obvious.  Bill Maher also stated that he was, quote, incensed that the media would dare suggest that RFK Jr. of all people is a conspiratorial crank. I just don't know how they'd come to that conclusion about somebody so reasonable who said so many normal things. But sarcasm aside, Bill Maher argues that the media should just tell people what that person says and not tell them what is and isn't misinformation and just let them decide for themselves, which really begs the question, what does Maher actually believe the media's role is? Should they just present every argument no matter how absurd it is, neutrally, so as to not offend the skeptics, or should they actually be informing readers about what is objectively true so people come away more educated and not dumber? Well, Bill Maher, in theory, shouldn't disagree with the notion that media should be objective and not neutral given his own criticism of Fox News. He criticized them for their lies about the 2020 election, but by his own new standards, didn't Fox News just do what he said media should be doing? They platformed Trump's lies about the 2020 election and they let viewers decide whether or not it was true. And the viewers collectively decided that it was not misinformation that the election was indeed stolen. But somehow that's not the conclusion that Bill drew from Fox News. He said they should be more responsible and actually tell viewers the facts. But when it comes to vaccines, however, it's not really the media's job to present us with evidence and objective facts. They're supposed to pretend to be neutral all the time. Sure, Bill, maybe you're just a hack.  Maybe you don't realize that you're seeking confirmation bias. But it gets better because he's also mad that the media is supposedly extrapolating my words, not his, from RFK's anti-vax positions to draw broader conclusions about his beliefs. So let's listen to what he has to say. Kennedy, who announced, is himself a leading vaccine skeptic and has promoted other conspiracy theories. I love this. They go right from, he's a vaccine skeptic and other. See, if you're a skeptic, everything else is a conspiracy theory right along with it. Yet he has consistently hovered around 20%. Like, that also, the arrogance of, huh, what could be going on in the minds of these morons who are gathering to his candidacy? Right. You see, there's a reason why they pointed out that he's promoted other conspiracy theories. It's because he has literally promoted countless conspiracy theories. For example, here's what he said about HIV and AIDS. Tony Fauci won a power struggle with Broder. And he said, this is an infectious disease. We've proven it. With Bob Gallup proved this is being caused by a virus. There's a lot of people that said it's not a virus. The virus is a passenger virus. And these people are dying mainly because of poppers. 100% of the people who died in the first of the first thousand what AIDS were people who were addicted to poppers, which are known to cause carposid sarcoma and rats.  And they were taking a lot of injectable drugs and methadiene. And there were poppers on sale everywhere at the gay bars on the day. I remember growing up in that era in the gay bars, it would be last call for poppers and last call for alcohol at 2 a.m.  And but for Tony Fauci, it was really important to call it a virus because that made it an infectious disease. And it became I and it allowed him to take control of it. Yeah. See, it's not really a virus. It's a passenger virus, which is different.  And Anthony Fauci only wanted to push this idea that it's a virus so he could take control of it. Makes perfect sense to me. Gee, I just can't understand why people are calling him a loon.  But according to Bill Maher, he's being treated so unfairly by the media. No, they actually got this one right. Now, look, I have my criticisms of the mainstream media myself. You've heard them before. But this is one of the few instances where I'd argue that they're doing a good job at calling out the lies that he's telling. Not in every single instance. And perhaps they're covering him too much. But I do think it is important for them to debunk the lies that he's spreading. But things got even dumber on this podcast when the subject of guns came up. Because they both just started to make a bunch of things up about the reasons why mass shootings are happening. And none of them, aside from guns, which they do cite to their credit is actually factual. But I mean, this gets really deranged. Just just watch. See, this is something I also agree with you with. He said pharmaceutical drugs were responsible for the rise of mass shootings in America. Yeah, I didn't actually say that. I'm sure you didn't. No. But the general... I said it should be looked at. It should. And it's... You know what? I don't even have to look at it. It is part of the issue. The gun issue is a number of things. If people could wrap their head around more than one thing at once. Yes, it's about too many guns in the Second Amendment. It's also about violence in movies and TV shows and seeing every fucking... Or how about video games? And video games. Yeah. But having a 12-year-old boy see every issue solved by way of a gun. No, that has no effect on it.  They're on Prozac. Is that the main one that... Well, that's one of these pharmaceutical... There's been lawsuits. There's been the Columbine lawsuit, which was settled. There was five kids who sued because their shooter was on SSRIs. And that is... SSRIs. Those are serotonin inhibitors. I see. And though the serotonin inhibitors have black box warnings on them that says suicide and homicidal ideation. So it's an obvious culprit. Thank you for putting it. It's an obvious culprit. It is treated in this paper as if it's an idea that we need to kill in the crib. And then you also add in 2010 when... Is that when everybody got a smartphone? Yeah. That is also... We've seen a thousand articles about how it's rewiring the brain. Yes. So all these things are responsible. But it's... I guess the question for you again... What NIH should be doing because they're supposed to... Their portfolio is to protect human health. It's to actually do real studies on this stuff. And they won't. But Bobby... Because they don't want to offend the big shots. The video game companies, the cell phone companies, the telecommunication industry, or the pharmaceutical industry. They instead have... And that's why they won't study vaccines either. Vaccines save your vaccine risk. Because they do not want the answer. Man, if only the experts could study vaccines, that'd be great. Can we get at least one study, guys?  But when everybody has had their brains broken by COVID and everybody is conspiratorial and uninformed in media, ironically does fail oftentimes to do its job. This is what you get.  Now, after what we watched there, that conversation devolved into a full-blown conspiratorial discussion about how vaccines cause autism. And Bill Maher said that he's sympathetic towards that argument. Yeah. Now, there were a lot of claims made there by the both of them. First and foremost, RFK Junior claimed that violent video games cause gun violence, and it hasn't been studied. Which, again, not true. It has been studied. Okay, there's been numerous studies showing that video games and violent movies and violent music does not cause people to be violent. And even if he didn't have the studies to confirm this, which he does, but even if that wasn't something that has been studied, other countries have violent video games and violent movies. But yet, we're the only ones who consistently deal with the issue of gun violence. Now, they also blame smartphones.  Believe it or not, other countries have smartphones too. But suddenly, gun violence didn't increase in all of these other countries that saw a rise in smartphone use. It is just so frustrating that they don't take two seconds to think about the things that they're saying to hundreds of thousands of people. Now, when it comes to SSRIs like Prozac, Bill Maher went further than RFK, believe it or not, and said, I don't have to even, what did he say specifically? I don't even have to look at it. It is part of the issue. He later said that it was an obvious culprit when it comes to gun violence. So he's trying to out Alex Jones, RFK Junior here. Now, the thing about facts, Bill, is that they can be misconstrued to suit an agenda. But Bill Maher isn't even dealing in facts here. He's saying, actually, feelings in this instance are sufficient for me. I base causality on vibes and vibes alone, baby. Now, he might not see how what he said there was harmful, but it is. And I've got an anecdote and evidence that I'm going to talk about here with regard to that specific claim about SSRIs. But first, let's get to the evidence. So in a 2017 journal article by Drs. Cole and Anna Staywright, approximately 13% of persons aged 12 and older take antidepressants, which makes them one of the top three most commonly used medications in the U.S. Four years ago, we reviewed the literature and found no statistically relevant evidence that antidepressant medications cause violence or criminal behavior. In contrast, we found reliable research that showed that antidepressants were associated with a significant decrease in lethal violence and a reduction in irritability and aggression. So there's evidence that the opposite of what they're saying may actually be true. But Dr. Daniel Stalter eloquently explained in a piece published by Psychology Today that SSRIs kind of get this bad rap probably due to what he calls illusory correlation between SSRIs and mass shootings. And he basically argues that we make this broader connection because news stories publicize the fact that mass shooters have been on SSRIs, leading people to think that correlation equals causation when there isn't a sufficient amount of evidence to deduce that that is indeed the case. But having said that though, there are side effects associated with SSRIs as is the case with all medications. Some cause weight gain or dry mouth or worse. As of 2004, the FDA actually began requiring pharmaceutical manufacturers to place warnings on antidepressants about the increased risk of suicidal ideation that they may cause. And this one is actually a bit controversial because some studies like this one published in Neuropsychopharmacology in 2022 shows that there's actually a decrease in suicidal ideation from antidepressants. But regardless, I'm not an expert and you shouldn't take what I say based on my own research. Because again, I'm not an expert. I am not informed about these medications. I am not capable or qualified to read these studies that are conducted by experts. And you shouldn't be learning about this from me. So if you're concerned, speak with your doctor. Speak to an expert, an actual expert. And that's how you should get your information. But the point that I'm trying to make here is that every medicine is going to have side effects. It's going to be a balance between the pros and the cons. But what they're doing here is they're overemphasizing the significance of potential risks and that causes harm. Fear mongering causes a real world harm. And I've seen how fear mongering over SSRIs in particular can cause actual pain and suffering firsthand because I've experienced it. And that brings us to the anecdote. So this affected me because when I was four years old, I was diagnosed with obsessive-compulsive disorder. And by the time that I was about 14 or 15, it got so bad that it was nearly crippling. Like it was debilitating and it literally prevented me from living a normal life. Monday in tasks, like turning on the light switch or turning on the faucet to get water, took minutes, literally, because every single thing was a ritual. I couldn't walk 10 steps without having to turn around and go back five if I walked through things, in between things. And for those of you who don't know what obsessive-compulsive disorder is, it's hard to explain why somebody would do this, but basically it turns every single thing that you do into rituals. I was suffering, basically. During story short, I was suffering and my mom wanted to get me treatment, but one, my dad thought that I was faking it for attention, so he didn't take it seriously until it really took a toll on me and he could see that. And two, other adults talked my parents out of getting me treatment because they were certain that I would be prescribed antidepressants, which, according to them, was bad. So the TLDR version of my life story was that I was finally given treatment and I was prescribed antidepressants. My doctor recommended Prozac. And I remember my mom being lambasted by other grown-ups who told her that if she allowed the doctor to give me Prozac, I would turn into a violent mass shooter. And the reason why they said this was because at the time, well, we just saw the Columbine mass shooting where one or both of the shooters were on Prozac. That was a fact that was publicized. And I remember they even scared me as a kid who feared that this wouldn't make me violent. And I thought, well, maybe I shouldn't get treatment. I was fearful that the treatment would be worse than the illness itself. But guess what happened? My mom listened to the doctor and not dipshits. And I was prescribed Prozac. And within a year, I was a completely different person. Completely different. I could actually live a normal life and be a teenager. By the time I turned 18, my OCD was almost non-existent. And this all happened because I was given Prozac. I was able to drive. I was able to work and live a fairly normal life when my parents didn't think that that was possible. Now, not everyone who takes Prozac is going to have the same outcome or experience as I did, right? But this is a very personal decision. And it was a decision between myself, my doctor, and my parents. And it was based on very specific circumstances. Because of fear mongering about SSRIs and sensationalist stories about how Prozac turned the Columbine mass shooters' violence. Well, that delayed and nearly prevented my own treatment, which I desperately needed. Now, this doesn't mean that medical experts still don't have concerns about Prozac or SSRIs or specific drugs.  So, in conclusion, Bill Maher might not see RFK Jr. as the charlatan that he is, but that doesn't change the fact that he's a huckster pushing half-baked medical advice that could actually harm people in real life. And that is important, and that does need to be called out by media. If media has a responsibility to do anything, it is to educate people.