[LLVMdev] Disable Short-Circuit Evaluation?

Duncan Sands baldrick at free.fr
Mon Oct 10 07:44:42 PDT 2011


A compilable testcase:


extern int get_group_id (int);
extern int get_local_id (int);

extern void check (bool, bool, bool);

void
foo (void)
{
   bool validX = get_group_id (0) > 32;

   int globalIndexY0 = get_group_id (1) * 186 + 6 * get_local_id (1) + 0 + 1;
   bool valid0 = validX && globalIndexY0 >= 4 && globalIndexY0 < 3910;

   int globalIndexY1 = get_group_id (1) * 186 + 6 * get_local_id (1) + 1 + 1;
   bool valid1 = validX && globalIndexY1 >= 4 && globalIndexY1 < 3910;

   int globalIndexY2 = get_group_id (1) * 186 + 6 * get_local_id (1) + 2 + 1;
   bool valid2 = validX && globalIndexY2 >= 4 && globalIndexY2 < 3910;

   check (valid0, valid1, valid2);
}



More information about the llvm-dev mailing list