[LLVMbugs] [Bug 5795] New: not merging duplicate blocks

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Tue Dec 15 18:23:37 PST 2009


http://llvm.org/bugs/show_bug.cgi?id=5795

           Summary: not merging duplicate blocks
           Product: libraries
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: code-quality
          Severity: normal
          Priority: P2
         Component: Scalar Optimizations
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu, regehr at cs.utah.edu


Many of John's testcases are cases like this:

typedef unsigned char __u8;
typedef unsigned short __u16;
typedef unsigned int __u32;
typedef __u8 u_int8_t;
typedef __u16 u_int16_t;
typedef __u16 __be16;
typedef __u32 __be32;
union __anonunion_in6_u_168
{
  __u8 u6_addr8[16];
  __be16 u6_addr16[8];
  __be32 u6_addr32[4];
};
struct in6_addr
{
  union __anonunion_in6_u_168 in6_u;
};
struct in_addr
{
  __be32 s_addr;
};
union nf_inet_addr
{
  __u32 all[4];
  __be32 ip;
  __be32 ip6[4];
  struct in_addr in;
  struct in6_addr in6;
};
struct __anonstruct_tcp_258
{
  __be16 port;
};
struct __anonstruct_udp_259
{
  __be16 port;
};
struct __anonstruct_icmp_260
{
  __be16 id;
};
struct __anonstruct_dccp_261
{
  __be16 port;
};
struct __anonstruct_sctp_262
{
  __be16 port;
};
struct __anonstruct_gre_263
{
  __be16 key;
};
union nf_conntrack_man_proto
{
  __be16 all;
  struct __anonstruct_tcp_258 tcp;
  struct __anonstruct_udp_259 udp;
  struct __anonstruct_icmp_260 icmp;
  struct __anonstruct_dccp_261 dccp;
  struct __anonstruct_sctp_262 sctp;
  struct __anonstruct_gre_263 gre;
};
struct nf_conntrack_man
{
  union nf_inet_addr u3;
  union nf_conntrack_man_proto u;
  u_int16_t l3num;
};
struct __anonstruct_tcp_266
{
  __be16 port;
};
struct __anonstruct_udp_267
{
  __be16 port;
};
struct __anonstruct_icmp_268
{
  u_int8_t type;
  u_int8_t code;
};
struct __anonstruct_dccp_269
{
  __be16 port;
};
struct __anonstruct_sctp_270
{
  __be16 port;
};
struct __anonstruct_gre_271
{
  __be16 key;
};
union __anonunion_u_265
{
  __be16 all;
  struct __anonstruct_tcp_266 tcp;
  struct __anonstruct_udp_267 udp;
  struct __anonstruct_icmp_268 icmp;
  struct __anonstruct_dccp_269 dccp;
  struct __anonstruct_sctp_270 sctp;
  struct __anonstruct_gre_271 gre;
};
struct __anonstruct_dst_264
{
  union nf_inet_addr u3;
  union __anonunion_u_265 u;
  u_int8_t protonum;
  u_int8_t dir;
};
struct nf_conntrack_tuple
{
  struct nf_conntrack_man src;
  struct __anonstruct_dst_264 dst;
};
void nf_ct_dump_tuple (struct nf_conntrack_tuple const *t);
void
nf_ct_dump_tuple (struct nf_conntrack_tuple const *t)
{
  struct nf_conntrack_tuple const *_cil_inline_tmp_3842;
  struct nf_conntrack_tuple const *_cil_inline_tmp_3843;

  {
    switch ((int) t->src.l3num)
      {
      case 2:;
        _cil_inline_tmp_3842 = t;
        break;
      case 10:;
        _cil_inline_tmp_3843 = t;
        break;
      }
    return;
  }
}

/* Checksum = 201B2224 */

which we compile down to:

  switch i32 %2, label %return [
    i32 2, label %bb
    i32 10, label %bb1
  ]

bb:                                               ; preds = %entry
  ret void

bb1:                                              ; preds = %entry
  ret void

return:                                           ; preds = %entry
  ret void
}

If those return blocks were merged, the switch would be deleted.  This probably
doesn't occur in real code though.


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list