[LLVMdev] Any value in pre-simplifying the DAG?

edA-qa mort-ora-y eda-qa at disemia.com
Wed Apr 17 12:27:30 PDT 2013


I've been adding some new flow statements to my compiler and realize the
easiest/laziest way to produce the DAG is just to store a flow variable
and end blocks with a "switch" branch. It appears the optimizers do a
fine job of unwinding the nonsense, reducing the conditions, and even
expanding the trailing paths.

For example, I terminate my blocks with a logical switch like this:
	switch return_path, next_block
		cleanup, except_block
		break, loop_block
		return, return_block
		rethrow, except_block

In most cases I'd say only 1-2 of the cases are actually possible
(return_path cannot be the other values). Is there any value in me
attempting to produce a cleaner DAG to pass to the optimizer, or would I
just be duplicating effort the passes will end up doing anyway?

-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130417/70babfbf/attachment.sig>


More information about the llvm-dev mailing list