Page MenuHomePhabricator

64 bit constant propagation
Open, NormalPublic

Description

ld %r0 s[0x20]
mov %r1 0x00000008
mov %r2 0x00000000
mov %r3 0x00000000
mad %r4 %r1 %r2 %r3
add %r5 %r0 %r4

get converted to

ld %r5 s[0x20]

But

ld %r0d c[0x0]
mov %r1d 0x0000000000000008
mov %r2d 0x0000000000000000
mov %r3d 0x0000000000000000
mad %r4d %r1d %r2d %r3d
add %r5d %r0d %r4d

get converted to

ld %r0d c[0x0]
mov %r1d 0x0000000000000008
mov %r2d 0x0000000000000000
mul %r4d %r1d %r2d
add %r5d %r0d %r4d

and ultimately to

ld %r0d c[0x0]
mov %r1d 0x0000000000000008
mul %r4d %r1d $r63
add %r5d %r0d %r4d

Come on! I'm sure you can easily find the result of 0 x Y, even if you don't know Y.

Event Timeline

pmoreau created this task.Mar 4 2016, 12:22 AM
pmoreau created this object with visibility "Public (No Login Required)".
pmoreau created this object with edit policy "Nouveau (Project)".