Canonical rules

LLVM version: 2.6
Query context: Automatic generator of LLVM backends.

Query:
What are canonical rules for initial DAG (generated by LLVM)?
Are there any at all?
Example:
Commutative operations. Are operations like
X = 1 + REG
automatically transformed into
X = REG + 1
?

Because of the nature of our project, we need exact information.
Thank you very much.
JH

LLVM version: 2.6
Query context: Automatic generator of LLVM backends.

Query:
What are canonical rules for initial DAG (generated by LLVM)?
Are there any at all?
Example:
Commutative operations. Are operations like
X = 1 + REG
automatically transformed into
X = REG + 1
?

The order of operands of an Add is not essential. Robust components should be able to behave correctly with either form.

Canonicalization simplifies optimization code, eliminating the need to recognize all possible trivial variants of a particular pattern. But if canonicalization is disabled or bypassed (and there are a few different ways this can happen), everything should still be conservatively correct.

Dan