sgundapa added a comment.

The switch-case statements generate two kinds of tables.

1. Jump tables
2. Lookup tables.

While the general assumption is that switch-case statements generate jump 
tables, the below case generates a lookup table by late simplifycfg

int foo(int x) {

  switch (x) {
  case 0: return 9;
  case 1: return 20;
  case 2: return 14;
  case 3: return 22;
  case 4: return 12;
  default: return 19;
  }

}
generates a 
@switch.table.foo = private unnamed_addr constant [5 x i32] [i32 9, i32 20, i32 
14, i32 22, i32 12]
The lookup table is more an array return values as opposed to an array of 
pointers in jump table.

The "-fno-XXX-flags" disable the generation of these tables. 
-fno-switch-tables implies both -fno-jump-tables and -fno-lookup-tables


https://reviews.llvm.org/D35578



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to