gallivm: implement implicit primitive flushing