/* Gimple prediction routines.
- Copyright (C) 2007-2017 Free Software Foundation, Inc.
+ Copyright (C) 2007-2020 Free Software Foundation, Inc.
This file is part of GCC.
/* Return the predictor of GIMPLE_PREDICT statement GS. */
static inline enum br_predictor
-gimple_predict_predictor (gimple *gs)
+gimple_predict_predictor (const gimple *gs)
{
GIMPLE_CHECK (gs, GIMPLE_PREDICT);
return (enum br_predictor) (gs->subcode & ~GF_PREDICT_TAKEN);
/* Return the outcome of GIMPLE_PREDICT statement GS. */
static inline enum prediction
-gimple_predict_outcome (gimple *gs)
+gimple_predict_outcome (const gimple *gs)
{
GIMPLE_CHECK (gs, GIMPLE_PREDICT);
return (gs->subcode & GF_PREDICT_TAKEN) ? TAKEN : NOT_TAKEN;
return p;
}
+/* Return true if GS is a GIMPLE_PREDICT statement. */
+
+static inline bool
+is_gimple_predict (const gimple *gs)
+{
+ return gimple_code (gs) == GIMPLE_PREDICT;
+}
+
#endif /* GCC_GIMPLE_PREDICT_H */