<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jan 10, 2016, at 9:30 PM, 박준모 <<a href="mailto:junmoz.park@samsung.com" class="">junmoz.park@samsung.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">Hi Michael.</span></div></div></div></blockquote>Hi Junmo,<br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">Thanks for comments. I’ll try harder to make secure code.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">When we run “llc  -march=aarch64 -mtriple=aarch64-none-linux-gnu -stop-after branch-folder -o /dev/null branch-folder-merge-mmos.ll”, we can get result likes below.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">Compiling will be stopped after “branch-folder” optimization. So there is no foo label. And “–o /dev/null”, this is just for avoiding error “LLVM ERROR: IO failure on output stream.”.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">And this option is used for several testcases.<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">If we don’t use the option “-stop-after branch-folder”, we don’t need to use “-o /dev/null”. As you said, there is no error with “-o -”.</span></div></div></div></blockquote>Ah, that makes sense then, sorry for the noise.<br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">I deleted test function. Are there any comments for testcase?</span></div></div></div></blockquote>I don’t have any other comments regarding the test.</div><div><br class=""></div><div>Thanks,</div><div>Michael</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class="WordSection1" style="page: WordSection1; font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">-Junmo<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">--- |<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  ; ModuleID = 'branch-folder-merge-mmos.ll'<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  target triple = "aarch64-none-linux-gnu"<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  define void @foo(i32 %a, i32 %b, float* nocapture %foo_arr) {<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  entry:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %cmp = icmp sgt i32 %a, 0<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    br i1 %cmp, label %if.then, label %if.end<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  if.then:                                          ; preds = %entry<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %0 = load float, float* %foo_arr, align 4<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %arrayidx1.i1 = getelementptr inbounds float, float* %foo_arr, i64 1<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %1 = load float, float* %arrayidx1.i1, align 4<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %sub.i = fsub float %0, %1<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    store float %sub.i, float* %foo_arr, align 4<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    br label %if.end3<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  if.end:                                           ; preds = %entry<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %cmp1 = icmp sgt i32 %b, 0<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    br i1 %cmp1, label %if.then2, label %if.end3<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  if.then2:                                         ; preds = %if.end<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %2 = load float, float* %foo_arr, align 4<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %arrayidx1.i2 = getelementptr inbounds float, float* %foo_arr, i64 1<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %3 = load float, float* %arrayidx1.i2, align 4<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %sub.i3 = fsub float %2, %3<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    store float %sub.i3, float* %foo_arr, align 4<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    br label %if.end3<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  if.end3:                                          ; preds = %if.then2, %if.end, %if.then<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    ret void<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">...<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">---<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">name:            foo<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">alignment:       2<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">exposesReturnsTwice: false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">hasInlineAsm:    false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">isSSA:           false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">tracksRegLiveness: false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">tracksSubRegLiveness: false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">liveins:        <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  - { reg: '%w0' }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  - { reg: '%w1' }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  - { reg: '%x2' }<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">frameInfo:      <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  isFrameAddressTaken: false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  isReturnAddressTaken: false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  hasStackMap:     false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  hasPatchPoint:   false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  stackSize:       0<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  offsetAdjustment: 0<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  maxAlignment:    0<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  adjustsStack:    false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  hasCalls:        false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  maxCallFrameSize: 0<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  hasOpaqueSPAdjustment: false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  hasVAStart:      false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  hasMustTailInVarArgFunc: false<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">body:             |<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  bb.0.entry:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    successors: %bb.2.if.then2(0x50000000 / 0x80000000 = 62.50%), %bb.1.if.end(0x30000000 / 0x80000000 = 37.50%)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    liveins: %w0, %w1, %x2<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    dead %wzr = SUBSWri killed %w0, 1, 0, implicit-def %nzcv<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    Bcc 10, %bb.2.if.then2, implicit %nzcv<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  bb.1.if.end:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    successors: %bb.2.if.then2(0x50000000 / 0x80000000 = 62.50%), %bb.3.if.end3(0x30000000 / 0x80000000 = 37.50%)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    liveins: %w1, %x2<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    dead %wzr = SUBSWri killed %w1, 1, 0, implicit-def %nzcv<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    Bcc 11, %bb.3.if.end3, implicit %nzcv<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  bb.2.if.then2:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    successors: %bb.3.if.end3(0x80000000 / 0x80000000 = 100.00%)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    liveins: %x2<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %s0 = LDRSui %x2, 0 :: (load 4 from %ir.foo_arr)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %s1 = LDRSui %x2, 1 :: (load 4 from %ir.arrayidx1.i2), (load 4 from %ir.arrayidx1.i1)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    %s0 = FSUBSrr killed %s0, killed %s1<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    STRSui killed %s0, killed %x2, 0 :: (store 4 into %ir.foo_arr)<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""> <span class="Apple-converted-space"> </span><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">  bb.3.if.end3:<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">    RET_ReallyLR<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class="">...</span><span lang="EN-US" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 10pt; font-family: '맑은 고딕'; color: rgb(31, 73, 125);" class=""><o:p class=""> </o:p></span></div><div class=""><div style="border-style: solid none none; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0cm 0cm;" class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><b class=""><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif;" class="">From:</span></b><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif;" class=""><span class="Apple-converted-space"> </span><a href="mailto:mzolotukhin@apple.com" class="">mzolotukhin@apple.com</a> [<a href="mailto:mzolotukhin@apple.com" class="">mailto:mzolotukhin@apple.com</a>]<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Monday, January 11, 2016 12:42 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span></span><span style="font-size: 10pt;" class="">박준모</span><span lang="EN-US" style="font-size: 10pt; font-family: Tahoma, sans-serif;" class=""><br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span>Benjamin Kramer; Chandler Carruth via llvm-commits<br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [llvm] r257253 - [BranchFolding] Set correct mem refs<o:p class=""></o:p></span></div></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="" type="cite"><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">On Jan 10, 2016, at 6:53 PM,<span class="Apple-converted-space"> </span></span>박준모<span lang="EN-US" class=""><span class="Apple-converted-space"> </span><<a href="mailto:junmoz.park@samsung.com" style="color: purple; text-decoration: underline;" class="">junmoz.park@samsung.com</a>> wrote:<o:p class=""></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">Hi Benjamin, Michael.</span><span lang="EN-US" class=""><o:p class=""></o:p></span></div></div></blockquote><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">Hi Junmo,<br class=""><br class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">I couldn't expect that array's memory reference information can be changed with -O3 option.<br class="">Why I used combination of "Opt -O3 & llc" is that I want to represent real world's problem.(Branch folding can be occurred after Function Inlining.)<span class="apple-converted-space"> </span></span><span lang="EN-US" class=""><o:p class=""></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">I see. LLVM exploits a modular structure, so (almost) every transformation can be tested independently on others. That doesn’t mean all transformations work only on artificial tests - all of them actually target some real world problems, but testing them in isolation is just much more stable.<br class=""><br class=""><br class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">But this makes test failure on some machine. (Index of arrayidx1 can be changed, when optimization pass is changed.)<br class=""><br class="">So I change my test code likes below. I hope below code is ok for everyone. If there are no objections, I will recommit this.</span><span lang="EN-US" class=""><o:p class=""></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">I haven’t looked at the code, but if you didn’t change it, I suppose it’s still considered “ok to commit”. However, I have some comments regarding the test - please see below.<br class=""><br class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp<br class="">index 6080349..df5cac5 100644<br class="">--- a/lib/CodeGen/BranchFolding.cpp<br class="">+++ b/lib/CodeGen/BranchFolding.cpp<br class="">@@ -780,7 +780,7 @@ removeMMOsFromMemoryOperations(MachineBasicBlock::iterator MBBIStartPos,<br class="">    assert(MBBICommon->isIdenticalTo(&*MBBI) && "Expected matching MIIs!");<br class=""><br class="">    if (MBBICommon->mayLoad() || MBBICommon->mayStore())<br class="">-      MBBICommon->setMemRefs(MBBI->mergeMemRefsWith(*MBBI));<br class="">+      MBBICommon->setMemRefs(MBBICommon->mergeMemRefsWith(*MBBI));<br class=""><br class="">    ++MBBI;<br class="">    ++MBBICommon;<br class="">diff --git a/test/CodeGen/AArch64/branch-folder-merge-mmos.ll b/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br class="">new file mode 100644<br class="">index 0000000..1c79e60<br class="">--- /dev/null<br class="">+++ b/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br class="">@@ -0,0 +1,44 @@<br class="">+; RUN: llc -march=aarch64 -mtriple=aarch64-none-linux-gnu -stop-after branch-folder -o /dev/null < %s | FileCheck %s</span><span lang="EN-US" class=""><o:p class=""></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">This doesn’t make much sense to me - why the output is /dev/null? I’m surprised that could work at all. I guess it should be “-o -“, so that output would be in stdout, which then will be piped to FileCheck.<o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div></div><div class=""><blockquote style="margin-top: 5pt; margin-bottom: 5pt;" class="" type="cite"><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">+target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"<br class="">+<br class="">+; Function Attrs: norecurse nounwind<br class="">+define void @test(float* nocapture %test_arr) #0 {</span><span lang="EN-US" class=""><o:p class=""></o:p></span></div></div></blockquote><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">Why does the test need this function? We don’t check anything in it, so I suppose it can be completely removed.<br class=""><br class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">+entry:<br class="">+  %0 = load float, float* %test_arr, align 4<br class="">+  %arrayidx1 = getelementptr inbounds float, float* %test_arr, i64 1<br class="">+  %1 = load float, float* %arrayidx1, align 4<br class="">+  %sub = fsub float %0, %1<br class="">+  store float %sub, float* %test_arr, align 4<br class="">+  ret void<br class="">+}<br class="">+<br class="">+; Function Attrs: norecurse nounwind<br class="">+define void @foo(i32 %a, i32 %b, float* nocapture %foo_arr) #0 {</span><span lang="EN-US" class=""><o:p class=""></o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">It is a good practice to use "CHECK-LABEL: @foo” in the test. This way, if the test contains several functions, CHECK directives are guaranteed to work in the intended scope of the given function (they work in between CHECK-LABEL directives).<br class=""><br class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">+; CHECK: (load 4 from %ir.arrayidx1.{{i[1-2]}}), (load 4 from %ir.arrayidx1.{{i[1-2]}})<br class="">+entry:<br class="">+  %cmp = icmp sgt i32 %a, 0<br class="">+  br i1 %cmp, label %if.then, label %if.end<br class="">+<br class="">+if.then:                                          ; preds = %entry<br class="">+  %0 = load float, float* %foo_arr, align 4<br class="">+  %arrayidx1.i1 = getelementptr inbounds float, float* %foo_arr, i64 1<br class="">+  %1 = load float, float* %arrayidx1.i1, align 4<br class="">+  %sub.i = fsub float %0, %1<br class="">+  store float %sub.i, float* %foo_arr, align 4<br class="">+  br label %if.end3<br class="">+<br class="">+if.end:                                           ; preds = %entry<br class="">+  %cmp1 = icmp sgt i32 %b, 0<br class="">+  br i1 %cmp1, label %if.then2, label %if.end3<br class="">+<br class="">+if.then2:                                         ; preds = %if.end<br class="">+  %2 = load float, float* %foo_arr, align 4<br class="">+  %arrayidx1.i2 = getelementptr inbounds float, float* %foo_arr, i64 1</span><span lang="EN-US" class=""><o:p class=""></o:p></span></div></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class=""><o:p class=""> </o:p></span></div></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class="">Michael<br class=""><br class=""><o:p class=""></o:p></span></div><div class=""><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">Junmo.<br class=""><br class="">-----Original Message-----<br class="">From: Benjamin Kramer [</span><span lang="EN-US" class=""><a href="mailto:benny.kra@gmail.com" style="color: purple; text-decoration: underline;" class=""><span style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">mailto:benny.kra@gmail.com</span></a></span><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">]<span class="apple-converted-space"> </span><br class="">Sent: Sunday, January 10, 2016 4:57 AM<br class="">To: Junmo Park<br class="">Cc: Chandler Carruth via llvm-commits<br class="">Subject: Re: [llvm] r257253 - [BranchFolding] Set correct mem refs<br class=""><br class="">On Sat, Jan 9, 2016 at 8:30 AM, Junmo Park via llvm-commits<br class=""><<a href="mailto:llvm-commits@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">llvm-commits@lists.llvm.org</a>> wrote:<br style="orphans: auto; text-align: start; widows: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class=""><br class=""></span><span lang="EN-US" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">Author: flyingforyou<br class="">Date: Sat Jan  9 01:30:13 2016<br class="">New Revision: 257253<br class=""><br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=257253&view=rev" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project?rev=257253&view=rev</a><br class="">Log:<br class="">[BranchFolding] Set correct mem refs<br class=""><br class="">Merge MBBICommon and MBBI's MMOs.<br class=""><br class="">Differential Revision:<span class="Apple-converted-space"> </span><a href="http://reviews.llvm.org/D15990" style="color: purple; text-decoration: underline;" class="">http://reviews.llvm.org/D15990</a><br class=""><br class="">Added:<br class="">   llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br class="">Modified:<br class="">   llvm/trunk/lib/CodeGen/BranchFolding.cpp<br class=""><br class="">Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=257253&r1=257252&r2=257253&view=diff" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=257253&r1=257252&r2=257253&view=diff</a><br class="">==============================================================================<br class="">--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)<br class="">+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Sat Jan  9 01:30:13 2016<br class="">@@ -780,7 +780,7 @@ removeMMOsFromMemoryOperations(MachineBa<br class="">    assert(MBBICommon->isIdenticalTo(&*MBBI) && "Expected matching MIIs!");<br class=""><br class="">    if (MBBICommon->mayLoad() || MBBICommon->mayStore())<br class="">-      MBBICommon->setMemRefs(MBBI->mergeMemRefsWith(*MBBI));<br class="">+      MBBICommon->setMemRefs(MBBICommon->mergeMemRefsWith(*MBBI));<br class=""><br class="">    ++MBBI;<br class="">    ++MBBICommon;<br class=""><br class="">Added: llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br class="">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll?rev=257253&view=auto" style="color: purple; text-decoration: underline;" class="">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll?rev=257253&view=auto</a><br class="">==============================================================================<br class="">--- llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll (added)<br class="">+++ llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll Sat Jan  9 01:30:13 2016<br class="">@@ -0,0 +1,53 @@<br class="">+; RUN: opt < %s -O3 | llc -march=aarch64 -mtriple=aarch64-none-linux-gnu -stop-after branch-folder -o /dev/null | FileCheck %s<o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class=""><br class="">Why are you running opt -O3 on every run instead of just committing<br class="">the optimized IR? Running the O3 pipeline can cause the test to fail<br class="">when IR optimization passes change.<br class=""><br class="">- Ben<br class=""><br style="orphans: auto; text-align: start; widows: auto; -webkit-text-stroke-width: 0px; word-spacing: 0px;" class=""><br class=""></span><span lang="EN-US" class=""><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" style="font-size: 9pt; font-family: Helvetica, sans-serif;" class="">+target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"<br class="">+<br class="">+; Function Attrs: nounwind<br class="">+define void @test(float* %test_arr) #0 {<br class="">+entry:<br class="">+  %test_arr.addr = alloca float*, align 8<br class="">+  store float* %test_arr, float** %test_arr.addr, align 8<br class="">+  %0 = load float*, float** %test_arr.addr, align 8<br class="">+  %arrayidx = getelementptr inbounds float, float* %0, i64 0<br class="">+  %1 = load float, float* %arrayidx, align 4<br class="">+  %2 = load float*, float** %test_arr.addr, align 8<br class="">+  %arrayidx1 = getelementptr inbounds float, float* %2, i64 1<br class="">+  %3 = load float, float* %arrayidx1, align 4<br class="">+  %sub = fsub float %1, %3<br class="">+  %4 = load float*, float** %test_arr.addr, align 8<br class="">+  %arrayidx2 = getelementptr inbounds float, float* %4, i64 0<br class="">+  store float %sub, float* %arrayidx2, align 4<br class="">+  ret void<br class="">+}<br class="">+<br class="">+; Function Attrs: nounwind<br class="">+define void @foo(i32 %a, i32 %b, float* %foo_arr) #0 {<br class="">+; CHECK: (load 4 from %ir.arrayidx1.i2), (load 4 from %ir.arrayidx1.i)<br class="">+entry:<br class="">+  %a.addr = alloca i32, align 4<br class="">+  %b.addr = alloca i32, align 4<br class="">+  %foo_arr.addr = alloca float*, align 8<br class="">+  store i32 %a, i32* %a.addr, align 4<br class="">+  store i32 %b, i32* %b.addr, align 4<br class="">+  store float* %foo_arr, float** %foo_arr.addr, align 8<br class="">+  %0 = load i32, i32* %a.addr, align 4<br class="">+  %cmp = icmp sgt i32 %0, 0<br class="">+  br i1 %cmp, label %if.then, label %if.end<br class="">+<br class="">+if.then:                                          ; preds = %entry<br class="">+  %1 = load float*, float** %foo_arr.addr, align 8<br class="">+  call void @test(float* %1)<br class="">+  br label %if.end3<br class="">+<br class="">+if.end:                                           ; preds = %entry<br class="">+  %2 = load i32, i32* %b.addr, align 4<br class="">+  %cmp1 = icmp sgt i32 %2, 0<br class="">+  br i1 %cmp1, label %if.then2, label %if.end3<br class="">+<br class="">+if.then2:                                         ; preds = %if.end<br class="">+  %3 = load float*, float** %foo_arr.addr, align 8<br class="">+  call void @test(float* %3)<br class="">+  br label %if.end3<br class="">+<br class="">+if.end3:                                          ; preds = %if.then, %if.then2, %if.end<br class="">+  ret void<br class="">+}<br class=""><br class=""><br class="">_______________________________________________<br class="">llvm-commits mailing list<br class=""><a href="mailto:llvm-commits@lists.llvm.org" style="color: purple; text-decoration: underline;" class="">llvm-commits@lists.llvm.org</a><br class=""><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" style="color: purple; text-decoration: underline;" class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p class=""></o:p></span></div><div style="margin: 0cm 0cm 0.0001pt; font-size: 12pt; font-family: 굴림;" class=""><span lang="EN-US" class=""><diff.txt></span></div></div></div></div></div></blockquote></div><br class=""></body></html>