<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Helvetica;
        panose-1:2 11 5 4 2 2 2 2 2 4;}
@font-face
        {font-family:굴림;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:굴림;
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"맑은 고딕";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@굴림";
        panose-1:2 11 6 0 0 1 1 1 1 1;}
@font-face
        {font-family:"\@맑은 고딕";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:굴림;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {mso-style-priority:99;
        mso-style-link:"풍선 도움말 텍스트 Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:9.0pt;
        font-family:"맑은 고딕";}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"맑은 고딕";
        color:#1F497D;}
span.Char
        {mso-style-name:"풍선 도움말 텍스트 Char";
        mso-style-priority:99;
        mso-style-link:"풍선 도움말 텍스트";
        font-family:"맑은 고딕";}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:3.0cm 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=KO link=blue vlink=purple><div class=WordSection1><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>Hi Michael.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>Thanks for comments. I’ll try harder to make secure code.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>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></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>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></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>And this option is used for several testcases.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>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 -”.<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>I deleted test function. Are there any comments for testcase?<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>-Junmo<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>--- |<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  ; ModuleID = 'branch-folder-merge-mmos.ll'<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  target triple = "aarch64-none-linux-gnu"<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  define void @foo(i32 %a, i32 %b, float* nocapture %foo_arr) {<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  entry:<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %cmp = icmp sgt i32 %a, 0<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    br i1 %cmp, label %if.then, label %if.end<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  if.then:                                          ; preds = %entry<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %0 = load float, float* %foo_arr, align 4<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %arrayidx1.i1 = getelementptr inbounds float, float* %foo_arr, i64 1<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %1 = load float, float* %arrayidx1.i1, align 4<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %sub.i = fsub float %0, %1<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    store float %sub.i, float* %foo_arr, align 4<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    br label %if.end3<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  if.end:                                           ; preds = %entry<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %cmp1 = icmp sgt i32 %b, 0<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    br i1 %cmp1, label %if.then2, label %if.end3<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  if.then2:                                         ; preds = %if.end<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %2 = load float, float* %foo_arr, align 4<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %arrayidx1.i2 = getelementptr inbounds float, float* %foo_arr, i64 1<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %3 = load float, float* %arrayidx1.i2, align 4<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %sub.i3 = fsub float %2, %3<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    store float %sub.i3, float* %foo_arr, align 4<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    br label %if.end3<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  if.end3:                                          ; preds = %if.then2, %if.end, %if.then<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    ret void<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  }<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>...<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>---<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>name:            foo<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>alignment:       2<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>exposesReturnsTwice: false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>hasInlineAsm:    false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>isSSA:           false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>tracksRegLiveness: false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>tracksSubRegLiveness: false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>liveins:         <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  - { reg: '%w0' }<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  - { reg: '%w1' }<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  - { reg: '%x2' }<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>frameInfo:       <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  isFrameAddressTaken: false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  isReturnAddressTaken: false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  hasStackMap:     false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  hasPatchPoint:   false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  stackSize:       0<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  offsetAdjustment: 0<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  maxAlignment:    0<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  adjustsStack:    false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  hasCalls:        false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  maxCallFrameSize: 0<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  hasOpaqueSPAdjustment: false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  hasVAStart:      false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  hasMustTailInVarArgFunc: false<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>body:             |<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  bb.0.entry:<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    successors: %bb.2.if.then2(0x50000000 / 0x80000000 = 62.50%), %bb.1.if.end(0x30000000 / 0x80000000 = 37.50%)<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    liveins: %w0, %w1, %x2<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    dead %wzr = SUBSWri killed %w0, 1, 0, implicit-def %nzcv<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    Bcc 10, %bb.2.if.then2, implicit %nzcv<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  bb.1.if.end:<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    successors: %bb.2.if.then2(0x50000000 / 0x80000000 = 62.50%), %bb.3.if.end3(0x30000000 / 0x80000000 = 37.50%)<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    liveins: %w1, %x2<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    dead %wzr = SUBSWri killed %w1, 1, 0, implicit-def %nzcv<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    Bcc 11, %bb.3.if.end3, implicit %nzcv<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  bb.2.if.then2:<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    successors: %bb.3.if.end3(0x80000000 / 0x80000000 = 100.00%)<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    liveins: %x2<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %s0 = LDRSui %x2, 0 :: (load 4 from %ir.foo_arr)<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %s1 = LDRSui %x2, 1 :: (load 4 from %ir.arrayidx1.i2), (load 4 from %ir.arrayidx1.i1)<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    %s0 = FSUBSrr killed %s0, killed %s1<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    STRSui killed %s0, killed %x2, 0 :: (store 4 into %ir.foo_arr)<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  <o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>  bb.3.if.end3:<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>    RET_ReallyLR<o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'>...</span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal style='word-break:break-hangul'><span lang=EN-US style='font-size:10.0pt;font-family:"맑은 고딕";color:#1F497D'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'><p class=MsoNormal><b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> mzolotukhin@apple.com [mailto:mzolotukhin@apple.com] <br><b>Sent:</b> Monday, January 11, 2016 12:42 PM<br><b>To:</b> </span><span style='font-size:10.0pt'>박준모</span><span lang=EN-US style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'><br><b>Cc:</b> Benjamin Kramer; Chandler Carruth via llvm-commits<br><b>Subject:</b> Re: [llvm] r257253 - [BranchFolding] Set correct mem refs<o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span lang=EN-US>On Jan 10, 2016, at 6:53 PM, </span>박준모<span lang=EN-US> <<a href="mailto:junmoz.park@samsung.com">junmoz.park@samsung.com</a>> wrote:<o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>Hi Benjamin, Michael.</span><span lang=EN-US><o:p></o:p></span></p></div></blockquote><p class=MsoNormal><span lang=EN-US>Hi Junmo,<br><br><o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>I couldn't expect that array's memory reference information can be changed with -O3 option.<br>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><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US>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><br><br><o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>But this makes test failure on some machine. (Index of arrayidx1 can be changed, when optimization pass is changed.)<br><br>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><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US>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><br><o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>diff --git a/lib/CodeGen/BranchFolding.cpp b/lib/CodeGen/BranchFolding.cpp<br>index 6080349..df5cac5 100644<br>--- a/lib/CodeGen/BranchFolding.cpp<br>+++ b/lib/CodeGen/BranchFolding.cpp<br>@@ -780,7 +780,7 @@ removeMMOsFromMemoryOperations(MachineBasicBlock::iterator MBBIStartPos,<br>    assert(MBBICommon->isIdenticalTo(&*MBBI) && "Expected matching MIIs!");<br><br>    if (MBBICommon->mayLoad() || MBBICommon->mayStore())<br>-      MBBICommon->setMemRefs(MBBI->mergeMemRefsWith(*MBBI));<br>+      MBBICommon->setMemRefs(MBBICommon->mergeMemRefsWith(*MBBI));<br><br>    ++MBBI;<br>    ++MBBICommon;<br>diff --git a/test/CodeGen/AArch64/branch-folder-merge-mmos.ll b/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br>new file mode 100644<br>index 0000000..1c79e60<br>--- /dev/null<br>+++ b/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br>@@ -0,0 +1,44 @@<br>+; RUN: llc -march=aarch64 -mtriple=aarch64-none-linux-gnu -stop-after branch-folder -o /dev/null < %s | FileCheck %s</span><span lang=EN-US><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US>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></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>+target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"<br>+<br>+; Function Attrs: norecurse nounwind<br>+define void @test(float* nocapture %test_arr) #0 {</span><span lang=EN-US><o:p></o:p></span></p></div></blockquote><p class=MsoNormal><span lang=EN-US>Why does the test need this function? We don’t check anything in it, so I suppose it can be completely removed.<br><br><o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>+entry:<br>+  %0 = load float, float* %test_arr, align 4<br>+  %arrayidx1 = getelementptr inbounds float, float* %test_arr, i64 1<br>+  %1 = load float, float* %arrayidx1, align 4<br>+  %sub = fsub float %0, %1<br>+  store float %sub, float* %test_arr, align 4<br>+  ret void<br>+}<br>+<br>+; Function Attrs: norecurse nounwind<br>+define void @foo(i32 %a, i32 %b, float* nocapture %foo_arr) #0 {</span><span lang=EN-US><o:p></o:p></span></p></div><p class=MsoNormal><span lang=EN-US>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><br><o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>+; CHECK: (load 4 from %ir.arrayidx1.{{i[1-2]}}), (load 4 from %ir.arrayidx1.{{i[1-2]}})<br>+entry:<br>+  %cmp = icmp sgt i32 %a, 0<br>+  br i1 %cmp, label %if.then, label %if.end<br>+<br>+if.then:                                          ; preds = %entry<br>+  %0 = load float, float* %foo_arr, align 4<br>+  %arrayidx1.i1 = getelementptr inbounds float, float* %foo_arr, i64 1<br>+  %1 = load float, float* %arrayidx1.i1, align 4<br>+  %sub.i = fsub float %0, %1<br>+  store float %sub.i, float* %foo_arr, align 4<br>+  br label %if.end3<br>+<br>+if.end:                                           ; preds = %entry<br>+  %cmp1 = icmp sgt i32 %b, 0<br>+  br i1 %cmp1, label %if.then2, label %if.end3<br>+<br>+if.then2:                                         ; preds = %if.end<br>+  %2 = load float, float* %foo_arr, align 4<br>+  %arrayidx1.i2 = getelementptr inbounds float, float* %foo_arr, i64 1</span><span lang=EN-US><o:p></o:p></span></p></div><div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div><p class=MsoNormal><span lang=EN-US>Michael<br><br><o:p></o:p></span></p><div><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>Junmo.<br><br>-----Original Message-----<br>From: Benjamin Kramer [</span><span lang=EN-US><a href="mailto:benny.kra@gmail.com"><span style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>mailto:benny.kra@gmail.com</span></a></span><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>]<span class=apple-converted-space> </span><br>Sent: Sunday, January 10, 2016 4:57 AM<br>To: Junmo Park<br>Cc: Chandler Carruth via llvm-commits<br>Subject: Re: [llvm] r257253 - [BranchFolding] Set correct mem refs<br><br>On Sat, Jan 9, 2016 at 8:30 AM, Junmo Park via llvm-commits<br><<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br style='orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>Author: flyingforyou<br>Date: Sat Jan  9 01:30:13 2016<br>New Revision: 257253<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=257253&view=rev">http://llvm.org/viewvc/llvm-project?rev=257253&view=rev</a><br>Log:<br>[BranchFolding] Set correct mem refs<br><br>Merge MBBICommon and MBBI's MMOs.<br><br>Differential Revision: <a href="http://reviews.llvm.org/D15990">http://reviews.llvm.org/D15990</a><br><br>Added:<br>   llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br>Modified:<br>   llvm/trunk/lib/CodeGen/BranchFolding.cpp<br><br>Modified: llvm/trunk/lib/CodeGen/BranchFolding.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=257253&r1=257252&r2=257253&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/BranchFolding.cpp?rev=257253&r1=257252&r2=257253&view=diff</a><br>==============================================================================<br>--- llvm/trunk/lib/CodeGen/BranchFolding.cpp (original)<br>+++ llvm/trunk/lib/CodeGen/BranchFolding.cpp Sat Jan  9 01:30:13 2016<br>@@ -780,7 +780,7 @@ removeMMOsFromMemoryOperations(MachineBa<br>    assert(MBBICommon->isIdenticalTo(&*MBBI) && "Expected matching MIIs!");<br><br>    if (MBBICommon->mayLoad() || MBBICommon->mayStore())<br>-      MBBICommon->setMemRefs(MBBI->mergeMemRefsWith(*MBBI));<br>+      MBBICommon->setMemRefs(MBBICommon->mergeMemRefsWith(*MBBI));<br><br>    ++MBBI;<br>    ++MBBICommon;<br><br>Added: llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll?rev=257253&view=auto">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll?rev=257253&view=auto</a><br>==============================================================================<br>--- llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll (added)<br>+++ llvm/trunk/test/CodeGen/AArch64/branch-folder-merge-mmos.ll Sat Jan  9 01:30:13 2016<br>@@ -0,0 +1,53 @@<br>+; RUN: opt < %s -O3 | llc -march=aarch64 -mtriple=aarch64-none-linux-gnu -stop-after branch-folder -o /dev/null | FileCheck %s<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'><br>Why are you running opt -O3 on every run instead of just committing<br>the optimized IR? Running the O3 pipeline can cause the test to fail<br>when IR optimization passes change.<br><br>- Ben<br><br style='orphans: auto;text-align:start;widows: auto;-webkit-text-stroke-width: 0px;word-spacing:0px'><br></span><span lang=EN-US><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US style='font-size:9.0pt;font-family:"Helvetica","sans-serif"'>+target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"<br>+<br>+; Function Attrs: nounwind<br>+define void @test(float* %test_arr) #0 {<br>+entry:<br>+  %test_arr.addr = alloca float*, align 8<br>+  store float* %test_arr, float** %test_arr.addr, align 8<br>+  %0 = load float*, float** %test_arr.addr, align 8<br>+  %arrayidx = getelementptr inbounds float, float* %0, i64 0<br>+  %1 = load float, float* %arrayidx, align 4<br>+  %2 = load float*, float** %test_arr.addr, align 8<br>+  %arrayidx1 = getelementptr inbounds float, float* %2, i64 1<br>+  %3 = load float, float* %arrayidx1, align 4<br>+  %sub = fsub float %1, %3<br>+  %4 = load float*, float** %test_arr.addr, align 8<br>+  %arrayidx2 = getelementptr inbounds float, float* %4, i64 0<br>+  store float %sub, float* %arrayidx2, align 4<br>+  ret void<br>+}<br>+<br>+; Function Attrs: nounwind<br>+define void @foo(i32 %a, i32 %b, float* %foo_arr) #0 {<br>+; CHECK: (load 4 from %ir.arrayidx1.i2), (load 4 from %ir.arrayidx1.i)<br>+entry:<br>+  %a.addr = alloca i32, align 4<br>+  %b.addr = alloca i32, align 4<br>+  %foo_arr.addr = alloca float*, align 8<br>+  store i32 %a, i32* %a.addr, align 4<br>+  store i32 %b, i32* %b.addr, align 4<br>+  store float* %foo_arr, float** %foo_arr.addr, align 8<br>+  %0 = load i32, i32* %a.addr, align 4<br>+  %cmp = icmp sgt i32 %0, 0<br>+  br i1 %cmp, label %if.then, label %if.end<br>+<br>+if.then:                                          ; preds = %entry<br>+  %1 = load float*, float** %foo_arr.addr, align 8<br>+  call void @test(float* %1)<br>+  br label %if.end3<br>+<br>+if.end:                                           ; preds = %entry<br>+  %2 = load i32, i32* %b.addr, align 4<br>+  %cmp1 = icmp sgt i32 %2, 0<br>+  br i1 %cmp1, label %if.then2, label %if.end3<br>+<br>+if.then2:                                         ; preds = %if.end<br>+  %3 = load float*, float** %foo_arr.addr, align 8<br>+  call void @test(float* %3)<br>+  br label %if.end3<br>+<br>+if.end3:                                          ; preds = %if.then, %if.then2, %if.end<br>+  ret void<br>+}<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><o:p></o:p></span></p><p class=MsoNormal><span lang=EN-US><diff.txt><o:p></o:p></span></p></div></div><p class=MsoNormal><span lang=EN-US><o:p> </o:p></span></p></div></body></html>