pesquisa em compiladores na ufmgevcomp.dcc.ufmg.br/wp-content/uploads/compiladores.pdf · porque...

26
Pesquisa em Compiladores na UFMG Fernando Pereira [email protected]

Upload: others

Post on 19-Apr-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

PesquisaemCompiladoresnaUFMG

[email protected]

[email protected]

Comotornarseusistemadeinformáticamais

eficienteemaisseguro?

[email protected]

Semcomprarnovohardware?

Semre-escreverseucódigo?

Comotornarseusistemadeinformáticamais

eficienteemaisseguro?

[email protected]

Melhoreseucompilador!

software

traduz

um

que

LinguagensdeProgramação

emCódigoBinário

[email protected]

Eporquefazerpesquisaemcompiladores?

[email protected]

História

Umpunhadodegenteespertajátrabalhoucomcompiladores.

1)  Conhecealguémaqui?

2)  Conhecealguémfamosodaáreadecompiladores?

[email protected]

Entrevista

RobertHundtéengenheirosênionaGoogle

•  "Atthescaleofdatacenters,everysingleperformancepercentmatters!JusttakealookatGoogle's(andother's)publiclyavailablenumbersonexpendituresondatacenters.Wearetalkingaboutbillionsofdollars.Asinglepercentimprovementcanmeanmillionsofdollarsfrommoreprogramfeaturesorimprovedutilization."

•  "InordertodeploysoftwareatGooglescale,engineerswilltouchagooddozenofprogrammingandconfigurationlanguages,allwiththeirowninterestingoptimizationproblems(fromacompilerwriter'spointofview).Fundamentalknowledgeinlanguage,compiler,andruntimeimplementationwillhelpmakebetterengineeringdecisions,everywhere."

•  "Didyouknowthatmanyofourfirsttoday'smostcelebratedengineershavecompilerbackgrounds?JeffDean,SanjayGhemawat,UrsHoelzle,andmanyothers.It'snotacoincidence.Compileroptimizationtrainsinbig-fiddlingaswellasalgorithmicthinking,whichareessentialtosuccessintoday'sworld."

[email protected]

Importância

Linguagens

Hardware

[email protected]

PorqueAprenderCompiladores?

•  Paraconhecermelhoraciênciadacomputação– Princípios–  Interdisciplinaridade– Novidade

•  Paraencontrarumbomemprego– "Wedonotneedthatmanycompilerguys,butthosethatweneed,weneedthembadly."♤

♤:FrançoisBodin,professornauniversidadedeRennes1.EngenheirochefedaCAPS

[email protected]

ProgramarMelhor

Oquefazemasotimizaçõesquegccusa?

fauto-inc-dec fcompare-elim fcprop-registers fdce fdefer-pop fdelayed-branch fdse fguess-branch-probability fif-conversion2 fif-conversion fipa-pure-const fipa-profile fipa-reference fmerge-constantsfsplit-wide-types ftree-bit-ccp ftree-builtin-call-dce ftree-ccp ftree-ch ftree-copyrename ftree-dce ftree-dominator-opts ftree-dse ftree-forwprop ftree-fre ftree-phiprop ftree-slsr ftree-sra ftree-pta funit-at-a-time

Dáparausá-lasemseparado:

$> gcc -fdefer-pop -o test test.c

Dáparaabilitaralgumas,edesligaroutras:

$> gcc -O1 -fno-defer-pop -o test test.c

[email protected]

Entendimento

Reusaronomedasvariáveiseconomizamemória?

int i = read();if (i != EOF) i = read(); printf("%d", i);

Herançaémenoseficiente?

#define MAX(X, Y) (X) > (Y) ? (X) : (Y)

int max(int i, int j) { return i > j ? i : j; }

Macrossãomaiseficientes?

[email protected]

Empregos

Intel=>icc

Mozilla=>JaegerMonkey,IonMonkey,TraceMonkey

NVIDIA=>nvcc

Google=>ART,V8

Apple=>LLVM

Microsoft=>visualstudio,.NETVM

STMicroelectronics=>open64

[email protected]

Start-ups

•  Coverity:segurança•  Cyral:segurança•  ShiftLeft:segurança•  ACE:embarcados

•  PathScale:desempenho•  PGI:desempenho•  GreenHills:C/C++

[email protected]

Enofinaldascontas...

HiProfPereira,

Longtimedon'tsee.Itrustyouarewell.

HereatApple,weareinvestingheavilyinourcompilertechnologies.Iwaswonderingifyoumighthaverecommendationsforstudentswhoareinterestedinpursuingacareerinindustrialcompilerwork.I'dbeinterestedintalkingtothemaboutopportunitieshere.

Regards,

EvanChengSrManager,CompilerTechnologies,Apple(Março'13)

[email protected]

Emaisnofinaldascontasainda...

DearFernando,

IhavereadyourpaperinJITspecializationinJavaScriptandparticularlyyourworkinthecontextofIonMonkeyhascaughtmyeye.IamworkingasaResearchScientistatIntelLabsontheRiverTrailproject.WearecollaboratingwithMozillaonaFirefoximplementation.GivenyourrecentworkonIonMonkey,maybeoneofyourstudentswouldbeinterestedtojoinusinSantaClaratoworkonthistopic?

Regards,

Stephan(May'13)

[email protected]

Egressos

•  DiogoSampaio-ARMUK

•  VictorSperle-ARMUK

•  RaphaelErnani-MicrosoftUS

•  PériclesAlves-MicrosoftUS

•  RubensMoreira-MicrosoftUS

•  LeandroTerra-ShiftLeftUS/BR

•  CaioLima-JavaScriptCoreEU/BR

•  GuilhermeLeobas-CyralUS/BR

•  MarceloMorais-AppleUS/BR

•  BrunoMorais-GoogleBR

•  IzabelaKarenina-GoogleBR

•  TarsilaBessa-GoogleBR

•  HenriqueNazaré-GoogleBR

•  CarinaCapelão-GoogleBR

•  JunioRibeiro-CyralUS/BR

•  HugoSouza-CyralUS/BR

[email protected]

Eporquetrabalharconosco?

[email protected]

JáUsouoFirefox?

•  EspecializaçãodecódigoJavaScript.– https://bugzilla.mozilla.org/show_bug.cgi?id=536641

Parasabermais:•  IgorRafaeldeAssisCosta,PériclesRafaelOliveiraAlves,HenriqueNazaréSantos,FernandoMagno

QuintãoPereira:Just-in-timevaluespecialization.CGO2013:29:1-29:11•  IgorRafaeldeAssisCosta,HenriqueNazaréSantos,PériclesRafaelOliveiraAlves,FernandoMagno

QuintãoPereira:Just-in-timevaluespecialization.ComputerLanguages,Systems&Structures40(2):37-52(2014)

[email protected]

JogaVideo-Games?

•  AnálisedeDivergênciaparaGPUs:– http://gpuocelot.gatech.edu/(Nvidia&MentorGraphics)

– http://reviews.llvm.org/D8576(Apple,ARM,Google&Cray)

Parasabermais:•  DiogoSampaio,RafaelMartinsdeSouza,SylvainCollange,FernandoMagnoQuintãoPereira:

Divergenceanalysis.ACMTrans.Program.Lang.Syst.35(4):13(2013)

[email protected]

ProgramaEmPHP?

•  Análisedefluxocontaminado– Falhasdesegurançaencontradasemprogramasreais.

Parasabermais:•  AndreiRimsa,Marcelod'Amorim,FernandoMagnoQuintãoPereira:Efficientstaticchecker

fortaintedvariableattacks.Sci.Comput.Program.80:91-105(2014)•  AndreiRimsa,Marcelod'Amorim,FernandoMagnoQuintãoPereira:TaintedFlowAnalysison

e-SSA-FormPrograms.CC2011:124-143

[email protected]

MexecomCriptografia?

•  FlowTrackeréumaferramentaquevalidaalgoritmosdecriptografia.

•  AtualmenteelaédesenvolvidapelaProdemge,CompanhiadeDadosdeMinasGerais

Parasabermais:•  BrunoRodrigues,FernandoMagnoQuintãoPereira,DiegoF.Aranha:Sparserepresentation

ofimplicitflowswithapplicationstoside-channeldetection.CC2016:110-120

[email protected]

Prêmios(Últimos5Anos)

•  MelhorartigoSBLP2010“RemovingOverflowTestsviaRun-TimePartialEvaluation”.•  MelhorartigoSBAC-PAD2010“PerformanceDebuggingofGPGPUApplicationswiththe

DivergenceMap”.•  MelhorartigodoSBQS2011“SoftwareEvolutionCharacterization-AComplexNetwork

Approach”•  MelhorartigoSBLP2012"SpillCodePlacementforSIMDMachines".•  Melhortrabalhodeiniciaçãocientífica,SICUFMG2012,CiênciasExatasedaTerra:Péricles

Alves,"RuntimeValueSpecialization".2013•  SegundamelhordissertaçãodemestradodaSociedadeBrasileiradeComputação:

"DivergenceAnalysiswithAffineConstraints".2014•  MelhorartigodoXIXSimpósioBrasileirodeLinguagensdeProgramação:"Restritificação",

SociedadeBrasileiradeComputação.2015•  TerceiromelhorartigodoXIXSimpósioBrasileirodeLinguagensdeProgramação:"Automatic

InferenceofLoopComplexitythroughPolynomialInterpolation",SociedadeBrasileiradeComputação.2015

•  MelhorFerramentadoCongressoBrasileirodeSoftware,TeoriaePrática(CBSoft):"Restrictifier:atooltodisambiguatepointersatfunctioncallsites",SociedadeBrasileiradeComputação.2015

•  SegundaMelhorFerramentadoCongressoBrasileirodeSoftware,TeoriaePrática(CBSoft):"FlowTracker-DetecçãodeCódigoNãoIsócronoviaAnáliseEstáticadeFluxo",SociedadeBrasileiradeComputação.2015

•  Melhorartigo"InspectorJ:umaferramentadeanáliseestáticaparadetectarcódigonãoisócronoemprogramasJava".CBSoftTools2017,SociedadeBrasileiradeComputação.

[email protected]

Infra-Estrutura

Novolaboratórioinauguradonodia18deDezembrode2015,construídocomrecursosdaInteledaLGElectronics

Processodemediçãodeconsumoenergéticoem

hardwareembarcado

[email protected]

Energia

[email protected]

ColaboraçõescomaIndústria

•  Intel:compilaçãoseguradeprogramasescritosemC/C++paradispositivosembarcados.

•  Maxtrack:testeautomáticodesoftwareimplementadoemmicro-controladores.

•  LGElectronics:paralelizaçãoautomáticadecódigoparasmartphones.

•  Nvidia:análisededivergências.•  Prodemge:análisedefluxodeinformação

•  Google:reduçãodeconsumoenergéticoemdispositivosmóveis(+seissummerofcode).

[email protected]

Missão

Contatos:ICEx/DCC,sala7315,+55(31)3409-5587E-mail:[email protected]:http://www.dcc.ufmg.br/~fernandoLaboratóriodeCompiladores: http://lac.dcc.ufmg.br/

"CanProgrammingBeLiberatedFromtheVonNeumannStyle?"

1977TuringAwardLecture-JohnBackus(1924-2007)