summaryrefslogtreecommitdiffstats
path: root/llvm/lib/System/Program.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-10 16:34:52 +0000
committerChris Lattner <sabre@nondot.org>2005-08-10 16:34:52 +0000
commit67d0753773d3cac492b9caeb474c69721696d915 (patch)
treee94524af9ac1186026735d21b00a04b883f7eaf5 /llvm/lib/System/Program.cpp
parent1c2f9fdf71f7b99aa871131006b0d0713cf917ce (diff)
downloadbcm5719-llvm-67d0753773d3cac492b9caeb474c69721696d915.tar.gz
bcm5719-llvm-67d0753773d3cac492b9caeb474c69721696d915.zip
1. Refactored handling of integer immediate values for add, or, xor and sub.
New routine: ISel::SelectIntImmediateExpr 2. Now checking use counts of large constants. If use count is > 2 then drop thru so that the constant gets loaded into a register. Source: int %test1(int %a) { entry: %tmp.1 = add int %a, 123456789 ; <int> [#uses=1] %tmp.2 = or int %tmp.1, 123456789 ; <int> [#uses=1] %tmp.3 = xor int %tmp.2, 123456789 ; <int> [#uses=1] %tmp.4 = sub int %tmp.3, -123456789 ; <int> [#uses=1] ret int %tmp.4 } Did Emit: .machine ppc970 .text .align 2 .globl _test1 _test1: .LBB_test1_0: ; entry addi r2, r3, -13035 addis r2, r2, 1884 ori r2, r2, 52501 oris r2, r2, 1883 xori r2, r2, 52501 xoris r2, r2, 1883 addi r2, r2, 52501 addis r3, r2, 1883 blr Now Emits: .machine ppc970 .text .align 2 .globl _test1 _test1: .LBB_test1_0: ; entry lis r2, 1883 ori r2, r2, 52501 add r3, r3, r2 or r3, r3, r2 xor r3, r3, r2 add r3, r3, r2 blr Patch by Jim Laskey! llvm-svn: 22749
Diffstat (limited to 'llvm/lib/System/Program.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud