[llvm-commits] [llvm] r127565 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Jin Gu Kang jaykang10 at imrc.kist.re.kr
Sun Mar 13 17:41:23 PDT 2011

Hi Nick

I'm sorry, I did not test this case with -O2.

I saw code about normal field access in InstCombine as following:

File: lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Instruction *InstCombiner::visitStoreInst(StoreInst &SI) {
  Value *Val = SI.getOperand(0);
  Value *Ptr = SI.getOperand(1);
  // If the RHS is an alloca with a single use, zapify the store, making the
  // alloca dead.
  if (!SI.isVolatile()) {
    if (Ptr->hasOneUse()) {
      if (isa<AllocaInst>(Ptr))
        return EraseInstFromFunction(SI);
      if (GetElementPtrInst *GEP = dyn_cast<GetElementPtrInst>(Ptr)) {
        if (isa<AllocaInst>(GEP->getOperand(0))) {
          if (GEP->getOperand(0)->hasOneUse())
            return EraseInstFromFunction(SI);

I thought above code did not process bitfield access

so made a patch about this.

I will revert code if this patch is useless.

Please give me comments.

Thanks your comments,

Jin-Gu Kang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20110314/67f76b70/attachment.html>

More information about the llvm-commits mailing list