Revert "[llvm] Improve llvm.objectsize computation by computing GEP, alloca and mallo...
[llvm-project.git] / clang / test / CodeGen / pgo-sample-preparation.c
blobc0a3cb4bc5944bab40e35e456c911ad11e2bd233
1 // Test if PGO sample use preparation passes are executed correctly.
2 //
3 // Ensure that instcombine is executed after simplifycfg and sroa so that
4 // "a < 255" will not be converted to a * 256 < 255 * 256.
5 // RUN: %clang_cc1 -O2 -fprofile-sample-use=%S/Inputs/pgo-sample.prof %s -emit-llvm -o - 2>&1 | FileCheck %s
7 void bar(int);
8 void foo(int x, int y, int z) {
9 int m;
10 for (m = 0; m < x ; m++) {
11 int a = (((y >> 8) & 0xff) * z) / 256;
12 bar(a < 255 ? a : 255);
16 // CHECK-NOT: icmp slt i32 %mul, 65280