@@ -833,51 +833,6 @@ slp_cstack_set_root(PyThreadState *tstate, const void * pstackvar);
833
833
PyObject *
834
834
slp_cstack_set_base_and_goodgap (PyThreadState * tstate , const void * pstackvar , PyFrameObject * f );
835
835
836
- /*
837
- * Call SLP_DO_NOT_OPTIMIZE_AWAY(pointer) to ensure that pointer will be
838
- * computed even post-optimization. Use it for pointers that are computed but
839
- * otherwise are useless. The compiler tends to do a good job at eliminating
840
- * unused variables, and this macro fools it into thinking var is in fact
841
- * needed.
842
- */
843
-
844
- #ifndef SLP_DO_NOT_OPTIMIZE_AWAY
845
-
846
- /* Code is based on Facebook folly
847
- * https://github.com/facebook/folly/blob/master/folly/Benchmark.h,
848
- * which has an Apache 2 license.
849
- */
850
- #ifdef _MSC_VER
851
-
852
- #pragma optimize("", off)
853
-
854
- static inline void doNotOptimizeDependencySink (const void * p ) {}
855
-
856
- #pragma optimize("", on)
857
-
858
- #define SLP_DO_NOT_OPTIMIZE_AWAY (pointer ) doNotOptimizeDependencySink(pointer)
859
- #define SLP_DO_NOT_OPTIMIZE_AWAY_DEFINITIONS /* empty */
860
-
861
- #elif (defined(__GNUC__ ) || defined(__clang__ ))
862
- /*
863
- * The "r" constraint forces the compiler to make datum available
864
- * in a register to the asm block, which means that it must have
865
- * computed/loaded it.
866
- */
867
- #define SLP_DO_NOT_OPTIMIZE_AWAY (pointer ) \
868
- do {__asm__ volatile("" ::"r"(pointer));} while(0)
869
- #define SLP_DO_NOT_OPTIMIZE_AWAY_DEFINITIONS /* empty */
870
- #else
871
- /*
872
- * Unknown compiler
873
- */
874
- #define SLP_DO_NOT_OPTIMIZE_AWAY (pointer ) \
875
- do { slp_do_not_opimize_away_sink = ((void*)(pointer)); } while(0)
876
- extern uint8_t * volatile slp_do_not_opimize_away_sink ;
877
- #define SLP_DO_NOT_OPTIMIZE_AWAY_DEFINITIONS uint8_t* volatile slp_do_not_opimize_away_sink;
878
- #endif
879
- #endif /* #ifndef SLP_DO_NOT_OPTIMIZE_AWAY */
880
-
881
836
882
837
883
838
#endif /* #ifdef SLP_BUILD_CORE */
0 commit comments