summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2011-04-02 18:11:32 -1000
committerEric Anholt <[email protected]>2011-04-08 08:04:00 -1000
commit963431829055f63ec94d88c97a5d07d30e49833a (patch)
treedd62f541337631a0b9fcda6192ed3523d5949f1a
parenta0d154dc1385d92a31dca8e65e50d958bdf6d532 (diff)
i965/fs: Remove broken optimization for live intervals in loops.
The theory here was to detect a temporary variable used within a loop, and avoid considering it live across the entire loop. However, it was overeager and failed when the first definition of the variable appeared within the loop but was only conditionally defined. Fixes glsl-fs-loop-redundant-condition.
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp
index cada1401821..99cd8f833a7 100644
--- a/src/mesa/drivers/dri/i965/brw_fs.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp
@@ -2812,8 +2812,7 @@ fs_visitor::calculate_live_intervals()
if (inst->src[i].file == GRF && inst->src[i].reg != 0) {
int reg = inst->src[i].reg;
- if (!loop_depth || (this->virtual_grf_sizes[reg] == 1 &&
- def[reg] >= bb_header_ip)) {
+ if (!loop_depth) {
use[reg] = ip;
} else {
def[reg] = MIN2(loop_start, def[reg]);
@@ -2829,8 +2828,7 @@ fs_visitor::calculate_live_intervals()
if (inst->dst.file == GRF && inst->dst.reg != 0) {
int reg = inst->dst.reg;
- if (!loop_depth || (this->virtual_grf_sizes[reg] == 1 &&
- !inst->predicated)) {
+ if (!loop_depth) {
def[reg] = MIN2(def[reg], ip);
} else {
def[reg] = MIN2(def[reg], loop_start);