[LLVMdev] Possible missed optimization?
Jakob Stoklund Olesen
stoklund at 2pi.dk
Sat Sep 4 10:52:48 PDT 2010
On Sep 4, 2010, at 9:54 AM, Borja Ferrer <borja.ferav at gmail.com> wrote:
> Producing the following asm code:
> xor r15, r13 ; xor top part
> mov r8, r14
> xor r8, r12 ; xor bottom part
> movi r14, 18
> xor r14, r8 ; xor bottom part with imm value
>
> However it could have produced:
> xor r15, r13
> xor r14, r12
> movi r8, 18
> xor r14, r8
Only by commuting the xor operands. Have you marked xor as commutable? See the other targets for how to do that.
More information about the llvm-dev
mailing list