Added a prototype for Function specialization.
Specializations now get their own schedules

and bounds inference understands the IfThenElses produced,
which means you can finally write fallback schedules for small inputs.

Part of this required wrapping the Schedule class behind a
reference-counted handle, so there's a lot of trivial code changes.

This also required many new simplification rules to keep the resulting
logical operators sane. Previously we never really generated big trees
of ands and ors.
Allow malloc to return NULL when the size is zero.
Bugfix in IREquality resulted in IfThenElse nodes never equalling
Added a new test to specialize
Merge branch 'master' into specialize

Fix class/struct discrepancy in header file.

Conflicts:
	src/CMakeLists.txt
Fix horrifying simplify bug

a && a -> false
Correction for mining And and Or chains.
More aggressive simplification of comparisons, mins, maxes

We now exploit bounds knowledge from containing for loops
Merge branch 'master' into specialize

Conflicts:
	src/CMakeLists.txt
	src/Simplify.cpp
Merge branch 'master' into specialize
Fix for handling IfThenElse node with undefined else clause.
Merge branch 'specialize' of github.com:halide/Halide into specialize
Merge branch 'master' into specialize

Conflicts:
	src/Lower.cpp
Merge branch 'master' into specialize

Conflicts:
	Makefile
	src/CMakeLists.txt
Add test where specialization may place stages on the gpu
Fix bug where we were injecting frees in one path of an IfThenElse
Large refactor of GPU backends.

Pull out all the logic involving:
- shared memory
- fusing together loops over thread indices and injecting for loops instead
- synchronization between blocks of code on the gpu

and put it earlier in lowering.

Not entirely working yet.
thread-local allocations no longer erroneously treated as shared.
Add missing cache flush on stores in C backend