summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-30 04:34:44 +0000
committerChris Lattner <sabre@nondot.org>2006-01-30 04:34:44 +0000
commitaf209b8b13c484a2f87a2f70ed302e4e519afc92 (patch)
tree05274ccf3e68d18a95f53efe22f74f504a07c673 /llvm/lib/CodeGen
parentbaeb39c96907b4f1793c766f820b9fe2cad8c2f3 (diff)
downloadbcm5719-llvm-af209b8b13c484a2f87a2f70ed302e4e519afc92.tar.gz
bcm5719-llvm-af209b8b13c484a2f87a2f70ed302e4e519afc92.zip
When lowering SELECT_CC, see if the input is a lowered SETCC. If so, fold
the two operations together. This allows us to compile this: void %two(int %a, int* %b) { %tmp.2 = seteq int %a, 0 %tmp.0.0 = select bool %tmp.2, int 10, int 20 store int %tmp.0.0, int* %b ret void } into: two: save -96, %o6, %o6 or %g0, 20, %l0 or %g0, 10, %l1 subcc %i0, 0, %l2 be .LBBtwo_2 ! entry nop .LBBtwo_1: ! entry or %g0, %l0, %l1 .LBBtwo_2: ! entry st %l1, [%i1] restore %g0, %g0, %g0 retl nop instead of: two: save -96, %o6, %o6 sethi 0, %l0 or %g0, 1, %l1 or %g0, 20, %l2 or %g0, 10, %l3 subcc %i0, 0, %l4 be .LBBtwo_2 ! entry nop .LBBtwo_1: ! entry or %g0, %l0, %l1 .LBBtwo_2: ! entry subcc %l1, 0, %l0 bne .LBBtwo_4 ! entry nop .LBBtwo_3: ! entry or %g0, %l2, %l3 .LBBtwo_4: ! entry st %l3, [%i1] restore %g0, %g0, %g0 retl nop llvm-svn: 25806
Diffstat (limited to 'llvm/lib/CodeGen')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud