aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ir_dead_code_local.cpp
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-05 12:10:31 -0700
committerEric Anholt <[email protected]>2010-08-05 12:56:03 -0700
commit9f82806c7b5109553cf806a5652e6b6198665094 (patch)
treed09c0725d013f3ede715c0b02d007af6f761b727 /src/glsl/ir_dead_code_local.cpp
parent3bd7e70bf7c4a9a52b425284c9f23689f00de93c (diff)
glsl2: Don't dead-code eliminate a call where the return value is unused.
This showed up since the disabling of inlining at compile time, which I apparently didn't regenerate piglit summary for. Fixes: glsl-deadcode-call.
Diffstat (limited to 'src/glsl/ir_dead_code_local.cpp')
-rw-r--r--src/glsl/ir_dead_code_local.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/glsl/ir_dead_code_local.cpp b/src/glsl/ir_dead_code_local.cpp
index b22cc558df6..4bbedf0ff94 100644
--- a/src/glsl/ir_dead_code_local.cpp
+++ b/src/glsl/ir_dead_code_local.cpp
@@ -156,7 +156,12 @@ process_assignment(void *ctx, ir_assignment *ir, exec_list *assignments)
}
}
- /* Add this instruction to the assignment list. */
+ /* Add this instruction to the assignment list available to be removed.
+ * But not if the assignment has other side effects.
+ */
+ if (ir_has_call(ir))
+ return progress;
+
assignment_entry *entry = new(ctx) assignment_entry(var, ir);
assignments->push_tail(entry);