<html dir="ltr"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style title="owaParaStyle"><!--P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
--></style>
</head>
<body ocsi="x">
<p><font size="2" face="Tahoma">Hi Nick<br>
<br>
I'm sorry, I did not test this case with -O2. <br>
</font></p>
<p><font size="2" face="Tahoma">I saw code about normal field access in InstCombine as following:</font></p>
<p><br>
<font size="2" face="Tahoma">File: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp</font></p>
<p><font size="2" face="Tahoma"></font> </p>
<p><font size="2" face="Tahoma">Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {<br>
  Value *Val = SI.getOperand(0);<br>
  Value *Ptr = SI.getOperand(1);<br>
  // If the RHS is an alloca with a single use, zapify the store, making the<br>
  // alloca dead.<br>
  if (!SI.isVolatile()) {<br>
    if (Ptr->hasOneUse()) {<br>
      if (isa<AllocaInst>(Ptr))<br>
        return EraseInstFromFunction(SI);<br>
      if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) {<br>
        if (isa<AllocaInst>(GEP->getOperand(0))) {<br>
          if (GEP->getOperand(0)->hasOneUse())<br>
            return EraseInstFromFunction(SI);<br>
        }<br>
      }<br>
    }<br>
  }<br>
</font></p>
<p><font size="2" face="Tahoma">I thought above code did not process bitfield access
</font></p>
<p><font size="2" face="tahoma">so made a patch about this.</font></p>
<p><font size="2" face="tahoma"></font> </p>
<p><font size="2" face="Tahoma">I will revert code if this patch is useless.</font></p>
<p><font size="2" face="Tahoma">Please give me comments.</font></p>
<p><font size="2" face="Tahoma"></font> </p>
<p><font size="2" face="Tahoma">Thanks your comments,</font></p>
<p><font size="2"><font face="Tahoma">Jin-Gu Kang</font><br>
</font></p>
</body>
</html>