Turning on `enable_noundef_analysis` flag allows better codegen by removing freeze instructions. I modified clang by renaming `enable_noundef_analysis` flag to `disable-noundef-analysis` and turning it off by default. Test updates are made as a separate patch: D108453 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D105169 [Clang/Test]: Rename enable_noundef_analysis to disable-noundef-analysis and turn it off by default (2) This patch updates test files after D105169. Autogenerated test codes are changed by `utils/update_cc_test_checks.py,` and non-autogenerated test codes are changed as follows: (1) I wrote a python script that (partially) updates the tests using regex: {F18594904} The script is not perfect, but I believe it gives hints about which patterns are updated to have `noundef` attached. (2) The remaining tests are updated manually. Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D108453 Resolve lit failures in clang after 8ca4b3e's land Fix lit test failures in clang-ppc* and clang-x64-windows-msvc Fix missing failures in clang-ppc64be* and retry fixing clang-x64-windows-msvc Fix internal_clone(aarch64) inline assembly
34 lines
1.1 KiB
C++
34 lines
1.1 KiB
C++
// RUN: %clang_cc1 %s -triple=x86_64-apple-darwin10 -emit-llvm -O3 -o - | FileCheck %s
|
|
/// Check that we pass the member pointers indirectly for MinGW64
|
|
// RUN: %clang_cc1 %s -triple=x86_64-windows-gnu -emit-llvm -o - | FileCheck %s -check-prefix MINGW64
|
|
/// We should be able to optimize calls via the indirectly passed member pointers
|
|
// RUN: %clang_cc1 %s -triple=x86_64-windows-gnu -emit-llvm -O3 -o - | FileCheck %s
|
|
struct A {
|
|
virtual int vf1() { return 1; }
|
|
virtual int vf2() { return 2; }
|
|
};
|
|
|
|
int f(A* a, int (A::*fp)()) {
|
|
return (a->*fp)();
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} i32 @_Z2g1v()
|
|
// CHECK-NOT: }
|
|
// CHECK: ret i32 1
|
|
// MINGW64-LABEL: define dso_local noundef i32 @_Z2g1v()
|
|
// MINGW64: call noundef i32 @_Z1fP1AMS_FivE(%struct.A* noundef %{{.*}}, { i64, i64 }* noundef %{{.*}})
|
|
int g1() {
|
|
A a;
|
|
return f(&a, &A::vf1);
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} i32 @_Z2g2v()
|
|
// CHECK-NOT: }
|
|
// CHECK: ret i32 2
|
|
// MINGW64-LABEL: define dso_local noundef i32 @_Z2g2v()
|
|
// MINGW64: call noundef i32 @_Z1fP1AMS_FivE(%struct.A* noundef %{{.*}}, { i64, i64 }* noundef %{{.*}})
|
|
int g2() {
|
|
A a;
|
|
return f(&a, &A::vf2);
|
|
}
|