OSDN Git Service

perf expr: Propagate constants for binary operations
authorIan Rogers <irogers@google.com>
Thu, 23 Sep 2021 07:46:14 +0000 (00:46 -0700)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 29 Sep 2021 16:51:04 +0000 (13:51 -0300)
commit970f7afe55ee3e9d6d1c73cd138c5f023bb0beba
tree446ebe6706ed5be74131e03e3424ce41ea10c9d9
parent3f965a7df09d7eebde0020cefe427219afe7df4a
perf expr: Propagate constants for binary operations

When we're computing ID values, if we have constant values then compute
the constant result. For example:

  1 + 2

Previously .val would be set to BOTTOM by union_expr, meaning that
all values are possible. With this change .val is set to 3.

Later changes will use the constant values to hopefully eliminate ID
values that don't need to be computed.

Signed-off-by: Ian Rogers <irogers@google.com>
Tested-by: John Garry <john.garry@huawei.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Kajol Jain <kjain@linux.ibm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Clarke <pc@us.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sandeep Dasgupta <sdasgup@google.com>
Cc: Stephane Eranian <eranian@google.com>
Link: https://lore.kernel.org/r/20210923074616.674826-12-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/expr.y