[llvm-commits] CVS: nightlytest-serverside/NightlyTestAccept.php
Changes in directory nightlytest-serverside: NightlyTestAccept.php updated: 1.61 - 1.62 --- Log message: Moving guts of accept script to a function. --- Diffs of the changes: (+435 -431) NightlyTestAccept.php | 866 +- 1 files changed, 435 insertions(+), 431 deletions(-) Index: nightlytest-serverside/NightlyTestAccept.php diff -u nightlytest-serverside/NightlyTestAccept.php:1.61 nightlytest-serverside/NightlyTestAccept.php:1.62 --- nightlytest-serverside/NightlyTestAccept.php:1.61 Mon Dec 4 03:36:35 2006 +++ nightlytest-serverside/NightlyTestAccept.phpFri Apr 13 01:18:01 2007 @@ -481,500 +481,504 @@ * Setting up variables * ***/ -if ($print_debug) { - print Reading _POST Variables\n; -} +function acceptTest() { + if ($print_debug) { +print Reading _POST Variables\n; + } -$spliton =\n; + $spliton =\n; -$machine_data = $_POST['machine_data']; -if (!isset($machine_data)) { - $machine_data = ; -} -$MACHINE_DATA = split($spliton, $machine_data); + $machine_data = $_POST['machine_data']; + if (!isset($machine_data)) { +$machine_data = ; + } + $MACHINE_DATA = split($spliton, $machine_data); -$cvs_log = $_POST['cvs_data']; -if (!isset($cvs_log)) { - $cvs_log = ; -} -$CVS_LOG = split($spliton, $cvs_log); + $cvs_log = $_POST['cvs_data']; + if (!isset($cvs_log)) { +$cvs_log = ; + } + $CVS_LOG = split($spliton, $cvs_log); -$build_log = $_POST['build_data']; -if (!isset($build_log)) { - $build_log = ; -} -$BUILD_LOG = split($spliton, $build_log); + $build_log = $_POST['build_data']; + if (!isset($build_log)) { +$build_log = ; + } + $BUILD_LOG = split($spliton, $build_log); -$dejagnutests_results = $_POST['dejagnutests_results']; -if (!isset($dejagnutests_results)) { - $dejagnutests_results = ; -} -$DEJAGNUTESTS_RESULTS = split($spliton, $dejagnutests_results); + $dejagnutests_results = $_POST['dejagnutests_results']; + if (!isset($dejagnutests_results)) { +$dejagnutests_results = ; + } + $DEJAGNUTESTS_RESULTS = split($spliton, $dejagnutests_results); -$dejagnutests_log = $_POST['dejagnutests_log']; -if (!isset($dejagnutests_log)) { - $dejagnutests_log = ; -} -$DEJAGNUTESTS_LOG = split($spliton, $dejagnutests_log); + $dejagnutests_log = $_POST['dejagnutests_log']; + if (!isset($dejagnutests_log)) { +$dejagnutests_log = ; + } + $DEJAGNUTESTS_LOG = split($spliton, $dejagnutests_log); -$singlesource_tests = $_POST['singlesource_programstable']; -if (!isset($singlesource_tests)) { - $singlesource_tests = ; -} -$SINGLESOURCE_TESTS = split($spliton, $singlesource_tests); + $singlesource_tests = $_POST['singlesource_programstable']; + if (!isset($singlesource_tests)) { +$singlesource_tests = ; + } + $SINGLESOURCE_TESTS = split($spliton, $singlesource_tests); -$multisource_tests = $_POST['multisource_programstable']; -if (!isset($multisource_tests)) { - $multisource_tests = ; -} -$MULTISOURCE_TESTS = split($spliton, $multisource_tests); + $multisource_tests = $_POST['multisource_programstable']; + if (!isset($multisource_tests)) { +$multisource_tests = ; + } + $MULTISOURCE_TESTS = split($spliton, $multisource_tests); -$external_tests = $_POST['externalsource_programstable']; -if (!isset($external_tests)) { - $external_tests = ; -} -$EXTERNAL_TESTS = split($spliton, $external_tests); + $external_tests = $_POST['externalsource_programstable']; + if (!isset($external_tests)) { +$external_tests = ; + } + $EXTERNAL_TESTS = split($spliton, $external_tests); -$o_file_size = $_POST['o_file_sizes']; -if (!isset($o_file_size)) { - $o_file_size = ; -} -$o_file_size = rtrim($o_file_size); -$O_FILE_SIZE = split($spliton, $o_file_size); + $o_file_size = $_POST['o_file_sizes']; + if (!isset($o_file_size)) { +$o_file_size = ; + } + $o_file_size = rtrim($o_file_size); + $O_FILE_SIZE = split($spliton, $o_file_size); -$a_file_size = $_POST['a_file_sizes']; -if (!isset($a_file_size)) { - $a_file_size = ; -} -$a_file_size = rtrim($a_file_size); -$A_FILE_SIZE = split($spliton, $a_file_size); + $a_file_size = $_POST['a_file_sizes']; + if (!isset($a_file_size)) { +$a_file_size = ; + } + $a_file_size = rtrim($a_file_size); + $A_FILE_SIZE = split($spliton, $a_file_size); -$filesincvs = $_POST['cvs_file_count']; -$dirsincvs = $_POST['cvs_dir_count']; -$loc = $_POST['lines_of_code']; -$nickname = $_POST['nickname']; -$cvscheckouttime_cpu = $_POST['cvscheckouttime_cpu']; -$cvscheckouttime_wall = $_POST['cvscheckouttime_wall']; -$configtime_wall = $_POST['configtime_wall']; -$configtime_cpu = $_POST['configtime_cpu']; -$buildtime_cpu = $_POST['buildtime_cpu']; -$buildtime_wall = $_POST['buildtime_wall']; -$dejagnutime_cpu = $_POST['dejagnutime_cpu']; -$dejagnutime_wall = $_POST['dejagnutime_wall']; -$buildwarnings = $_POST['warnings']; -$cvsaddedfiles = $_POST['cvsaddedfiles'];
[llvm-commits] CVS: llvm/lib/Target/ARM/ARMISelLowering.cpp
Changes in directory llvm/lib/Target/ARM: ARMISelLowering.cpp updated: 1.43 - 1.44 --- Log message: arm has r+r*s and r+i addr modes, but no r+i+r*s addr modes. --- Diffs of the changes: (+5 -1) ARMISelLowering.cpp |6 +- 1 files changed, 5 insertions(+), 1 deletion(-) Index: llvm/lib/Target/ARM/ARMISelLowering.cpp diff -u llvm/lib/Target/ARM/ARMISelLowering.cpp:1.43 llvm/lib/Target/ARM/ARMISelLowering.cpp:1.44 --- llvm/lib/Target/ARM/ARMISelLowering.cpp:1.43Wed Apr 11 11:17:12 2007 +++ llvm/lib/Target/ARM/ARMISelLowering.cpp Fri Apr 13 01:50:55 2007 @@ -1370,8 +1370,12 @@ case 1: if (Subtarget-isThumb()) return false; - +// FALL THROUGH. default: +// ARM doesn't support any R+R*scale+imm addr modes. +if (AM.BaseOffs) + return false; + int Scale = AM.Scale; switch (getValueType(Ty)) { default: return false; ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.417 - 1.418 --- Log message: Fix PR1323: http://llvm.org/PR1323 : we haven't updated phi nodes in good manner :) --- Diffs of the changes: (+1 -0) SelectionDAGISel.cpp |1 + 1 files changed, 1 insertion(+) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.417 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.418 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.417Thu Apr 12 01:00:20 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Apr 13 01:53:51 2007 @@ -4634,6 +4634,7 @@ if (PHIBB == BitTestCases[i].Default) { PHI-addRegOperand(PHINodesToUpdate[pi].second, false); PHI-addMachineBasicBlockOperand(BitTestCases[i].Parent); +PHI-addRegOperand(PHINodesToUpdate[pi].second, false); PHI-addMachineBasicBlockOperand(BitTestCases[i].Cases.back().ThisBB); } // One of cases BB. ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll
Changes in directory llvm/test/CodeGen/Generic: 2007-04-13-SwitchLowerBadPhi.ll added (r1.1) --- Log message: Fix PR1323: http://llvm.org/PR1323 : we haven't updated phi nodes in good manner :) --- Diffs of the changes: (+27 -0) 2007-04-13-SwitchLowerBadPhi.ll | 27 +++ 1 files changed, 27 insertions(+) Index: llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll diff -c /dev/null llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll:1.1 *** /dev/null Fri Apr 13 01:54:01 2007 --- llvm/test/CodeGen/Generic/2007-04-13-SwitchLowerBadPhi.ll Fri Apr 13 01:53:51 2007 *** *** 0 --- 1,27 + ; RUN: llvm-as %s | llc -fast + ; PR 1323 + + ; ModuleID = 'test.bc' + target datalayout = e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64 + target triple = i686-apple-darwin8 + %struct.comp = type { i8*, i32, i8*, [3 x i8], i32 } + + define void @regbranch() { + cond_next240.i: + br i1 false, label %cond_true251.i, label %cond_next272.i + + cond_true251.i: ; preds = %cond_next240.i + switch i8 0, label %cond_next272.i [ +i8 42, label %bb268.i +i8 43, label %bb268.i +i8 63, label %bb268.i + ] + + bb268.i: ; preds = %cond_true251.i, %cond_true251.i, %cond_true251.i + br label %cond_next272.i + + cond_next272.i: ; preds = %bb268.i, %cond_true251.i, %cond_next240.i + %len.2.i = phi i32 [ 0, %bb268.i ], [ 0, %cond_next240.i ], [ 0, %cond_true251.i ] ; i32 [#uses=1] + %tmp278.i = icmp eq i32 %len.2.i, 1 ; i1 [#uses=0] + ret void + } ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm-www/Funding.html
On Apr 12, 2007, at 8:52 PM, Reid Spencer wrote: On Thu, 2007-04-12 at 20:38 -0700, Bill Wendling wrote: On Apr 12, 2007, at 5:25 AM, Reid Spencer wrote: + pbTax Exempt/b. Your donations are tax exempt in the United States (and + probably other countries). UIUC is a recognized non-profit organization. + Reciepts are available upon request./p + p Exempt or Deductible? I dunno. You can legally claim it as a charitable donation. Whether that makes it an exemption or a deduction or even what those two words mean in the gobbledy gook of Title 26, I have no idea. I'm not a tax lawyer. An organization that's designated as a non-profit is tax exempt. The donations to it are deductible. it doesn't make sense for a donation to be tax exempt to the person giving the donation. -bw ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/Name.html
Changes in directory llvm-www: Name.html updated: 1.7 - 1.8 --- Log message: Fix anchor tags. --- Diffs of the changes: (+5 -5) Name.html | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.7 llvm-www/Name.html:1.8 --- llvm-www/Name.html:1.7 Thu Apr 12 23:31:20 2007 +++ llvm-www/Name.html Fri Apr 13 03:57:22 2007 @@ -2,10 +2,10 @@ div class=www_sectiontitleName That Compiler!/div div class=www_text table class=www -trtda href=backgroundBackground/a/td -tda href=bootyBooty/a/td -tda href=ideasIdeas/a/td -tda href=namesCandidate Names List/a/td +trtda href=#backgroundBackground/a/td +tda href=#bootyBooty/a/td +tda href=#ideasIdeas/a/td +tda href=#namesCandidate Names List/a/td /tr/table /div div class=www_subsectiona name=backgroundBackground/a/div @@ -244,6 +244,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 04:31:20 $ +br/Last modified: $Date: 2007/04/13 08:57:22 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [126077] Apply FSF patch to make thunks non-comdat
Revision: 126077 Author: johannes Date: 2007-04-13 09:36:56 -0700 (Fri, 13 Apr 2007) Log Message: --- Apply FSF patch to make thunks non-comdat Modified Paths: -- apple-local/branches/llvm/gcc/cp/method.c Modified: apple-local/branches/llvm/gcc/cp/method.c === --- apple-local/branches/llvm/gcc/cp/method.c 2007-04-13 16:25:48 UTC (rev 126076) +++ apple-local/branches/llvm/gcc/cp/method.c 2007-04-13 16:36:56 UTC (rev 126077) @@ -136,8 +136,7 @@ TREE_READONLY (thunk) = TREE_READONLY (function); TREE_THIS_VOLATILE (thunk) = TREE_THIS_VOLATILE (function); TREE_PUBLIC (thunk) = TREE_PUBLIC (function); - if (flag_weak) -comdat_linkage (thunk); + /* APPLE LOCAL mainline do not make thunks comdat */ SET_DECL_THUNK_P (thunk, this_adjusting); THUNK_TARGET (thunk) = function; THUNK_FIXED_OFFSET (thunk) = d; @@ -378,8 +377,10 @@ DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function); DECL_VISIBILITY_SPECIFIED (thunk_fndecl) = DECL_VISIBILITY_SPECIFIED (function); - if (flag_weak TREE_PUBLIC (thunk_fndecl)) -comdat_linkage (thunk_fndecl); + /* APPLE LOCAL begin mainline do not make thunks comdat */ + if (DECL_ONE_ONLY (function)) +make_decl_one_only (thunk_fndecl); + /* APPLE LOCAL end mainline do not make thunks comdat */ if (flag_syntax_only) { ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/Name.html
Changes in directory llvm-www: Name.html updated: 1.8 - 1.9 --- Log message: Add Oscar. --- Diffs of the changes: (+4 -1) Name.html |5 - 1 files changed, 4 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.8 llvm-www/Name.html:1.9 --- llvm-www/Name.html:1.8 Fri Apr 13 03:57:22 2007 +++ llvm-www/Name.html Fri Apr 13 11:49:24 2007 @@ -141,6 +141,9 @@ tdMaterial displaced across a soil profile, from one layer to another one, by the action of rainwater. Retains the LLVM letters. We already own the domain. Also connotes illumination./td/tr +trtdJeff Cohen/tdth +Oscar/th + tdOscar = Open Source Compiler And Runtime/td/tr trtd rowspan=3Reid Spencer/tdth a href=http://en.wikipedia.org/wiki/Alluvium;Alluvium/a/th tdThe layers of sediment deposited by a river. Also retains the LLVM @@ -244,6 +247,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 08:57:22 $ +br/Last modified: $Date: 2007/04/13 16:49:24 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/Name.html
Changes in directory llvm-www: Name.html updated: 1.9 - 1.10 --- Log message: Add Christopher Lamb's idea. --- Diffs of the changes: (+3 -1) Name.html |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.9 llvm-www/Name.html:1.10 --- llvm-www/Name.html:1.9 Fri Apr 13 11:49:24 2007 +++ llvm-www/Name.html Fri Apr 13 12:38:05 2007 @@ -237,6 +237,8 @@ Beowulf /pre/td/tr + trtdChristopher Lamb/tdthTakoa/thtdFinnish for 'to hammer' or 'forge'. + takoa.org is unclaimed. The image of a hammer is pretty iconographic./td /table /div @@ -247,6 +249,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 16:49:24 $ +br/Last modified: $Date: 2007/04/13 17:38:05 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Argument.h BasicBlock.h Constant.h Constants.h Function.h GlobalValue.h GlobalVariable.h InlineAsm.h Instruction.h Value.h
Changes in directory llvm/include/llvm: Argument.h updated: 1.14 - 1.15 BasicBlock.h updated: 1.63 - 1.64 Constant.h updated: 1.35 - 1.36 Constants.h updated: 1.145 - 1.146 Function.h updated: 1.73 - 1.74 GlobalValue.h updated: 1.34 - 1.35 GlobalVariable.h updated: 1.40 - 1.41 InlineAsm.h updated: 1.14 - 1.15 Instruction.h updated: 1.82 - 1.83 Value.h updated: 1.99 - 1.100 --- Log message: Rename Value::getValueType to getValueID, to avoid confusion with other things named getValueType. --- Diffs of the changes: (+30 -30) Argument.h |2 +- BasicBlock.h |2 +- Constant.h |4 ++-- Constants.h | 18 +- Function.h |2 +- GlobalValue.h|4 ++-- GlobalVariable.h |2 +- InlineAsm.h |2 +- Instruction.h|4 ++-- Value.h | 20 ++-- 10 files changed, 30 insertions(+), 30 deletions(-) Index: llvm/include/llvm/Argument.h diff -u llvm/include/llvm/Argument.h:1.14 llvm/include/llvm/Argument.h:1.15 --- llvm/include/llvm/Argument.h:1.14 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/Argument.hFri Apr 13 13:12:09 2007 @@ -64,7 +64,7 @@ /// static inline bool classof(const Argument *) { return true; } static inline bool classof(const Value *V) { -return V-getValueType() == ArgumentVal; +return V-getValueID() == ArgumentVal; } }; Index: llvm/include/llvm/BasicBlock.h diff -u llvm/include/llvm/BasicBlock.h:1.63 llvm/include/llvm/BasicBlock.h:1.64 --- llvm/include/llvm/BasicBlock.h:1.63 Fri Mar 23 13:44:11 2007 +++ llvm/include/llvm/BasicBlock.h Fri Apr 13 13:12:09 2007 @@ -158,7 +158,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BasicBlock *) { return true; } static inline bool classof(const Value *V) { -return V-getValueType() == Value::BasicBlockVal; +return V-getValueID() == Value::BasicBlockVal; } /// dropAllReferences() - This function causes all the subinstructions to let Index: llvm/include/llvm/Constant.h diff -u llvm/include/llvm/Constant.h:1.35 llvm/include/llvm/Constant.h:1.36 --- llvm/include/llvm/Constant.h:1.35 Wed Mar 7 18:59:12 2007 +++ llvm/include/llvm/Constant.hFri Apr 13 13:12:09 2007 @@ -88,8 +88,8 @@ static inline bool classof(const Constant *) { return true; } static inline bool classof(const GlobalValue *) { return true; } static inline bool classof(const Value *V) { -return V-getValueType() = ConstantFirstVal - V-getValueType() = ConstantLastVal; +return V-getValueID() = ConstantFirstVal + V-getValueID() = ConstantLastVal; } /// replaceUsesOfWithOnConstant - This method is a special form of Index: llvm/include/llvm/Constants.h diff -u llvm/include/llvm/Constants.h:1.145 llvm/include/llvm/Constants.h:1.146 --- llvm/include/llvm/Constants.h:1.145 Tue Apr 10 01:44:12 2007 +++ llvm/include/llvm/Constants.h Fri Apr 13 13:12:09 2007 @@ -201,7 +201,7 @@ /// @brief Methods to support type inquiry through isa, cast, and dyn_cast. static inline bool classof(const ConstantInt *) { return true; } static bool classof(const Value *V) { -return V-getValueType() == ConstantIntVal; +return V-getValueID() == ConstantIntVal; } static void ResetTrueFalse() { TheTrueVal = TheFalseVal = 0; } private: @@ -239,7 +239,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantFP *) { return true; } static bool classof(const Value *V) { -return V-getValueType() == ConstantFPVal; +return V-getValueID() == ConstantFPVal; } }; @@ -267,7 +267,7 @@ /// static bool classof(const ConstantAggregateZero *) { return true; } static bool classof(const Value *V) { -return V-getValueType() == ConstantAggregateZeroVal; +return V-getValueID() == ConstantAggregateZeroVal; } }; @@ -331,7 +331,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantArray *) { return true; } static bool classof(const Value *V) { -return V-getValueType() == ConstantArrayVal; +return V-getValueID() == ConstantArrayVal; } }; @@ -376,7 +376,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantStruct *) { return true; } static bool classof(const Value *V) { -return V-getValueType() == ConstantStructVal; +return V-getValueID() == ConstantStructVal; } }; @@ -428,7 +428,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const ConstantVector *) { return true; } static bool classof(const Value *V) { -return V-getValueType() == ConstantVectorVal; +return V-getValueID() == ConstantVectorVal; } }; @@ -464,7 +464,7 @@ /// Methods for support type inquiry through isa, cast, and dyn_cast:
[llvm-commits] CVS: llvm/include/llvm/Support/PatternMatch.h
Changes in directory llvm/include/llvm/Support: PatternMatch.h updated: 1.19 - 1.20 --- Log message: Rename Value::getValueType to getValueID, to avoid confusion with other things named getValueType. --- Diffs of the changes: (+3 -3) PatternMatch.h |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) Index: llvm/include/llvm/Support/PatternMatch.h diff -u llvm/include/llvm/Support/PatternMatch.h:1.19 llvm/include/llvm/Support/PatternMatch.h:1.20 --- llvm/include/llvm/Support/PatternMatch.h:1.19 Mon Feb 12 18:37:50 2007 +++ llvm/include/llvm/Support/PatternMatch.hFri Apr 13 13:12:09 2007 @@ -81,7 +81,7 @@ templatetypename OpTy bool match(OpTy *V) { -if (V-getValueType() == Value::InstructionVal + Opcode) { +if (V-getValueID() == Value::InstructionVal + Opcode) { ConcreteTy *I = castConcreteTy(V); return I-getOpcode() == Opcode L.match(I-getOperand(0)) R.match(I-getOperand(1)); @@ -195,8 +195,8 @@ templatetypename OpTy bool match(OpTy *V) { -if (V-getValueType() == Value::InstructionVal + Instruction::LShr || -V-getValueType() == Value::InstructionVal + Instruction::AShr) { +if (V-getValueID() == Value::InstructionVal + Instruction::LShr || +V-getValueID() == Value::InstructionVal + Instruction::AShr) { ConcreteTy *I = castConcreteTy(V); return (I-getOpcode() == Instruction::AShr || I-getOpcode() == Instruction::LShr) ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile
Changes in directory llvm/lib/Transforms/Hello: Makefile updated: 1.7 - 1.8 --- Log message: Hello uses LLVMSupport.a (SlowerOperationInformer) --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Hello/Makefile diff -u llvm/lib/Transforms/Hello/Makefile:1.7 llvm/lib/Transforms/Hello/Makefile:1.8 --- llvm/lib/Transforms/Hello/Makefile:1.7 Mon Apr 9 14:17:47 2007 +++ llvm/lib/Transforms/Hello/Makefile Fri Apr 13 13:28:23 2007 @@ -10,7 +10,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMHello LOADABLE_MODULE = 1 -USEDLIBS = +USEDLIBS = LLVMSupport.a include $(LEVEL)/Makefile.common ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Hello/Makefile
Changes in directory llvm/lib/Transforms/Hello: Makefile updated: 1.8 - 1.9 --- Log message: Undo previous check-in. --- Diffs of the changes: (+1 -1) Makefile |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Transforms/Hello/Makefile diff -u llvm/lib/Transforms/Hello/Makefile:1.8 llvm/lib/Transforms/Hello/Makefile:1.9 --- llvm/lib/Transforms/Hello/Makefile:1.8 Fri Apr 13 13:28:23 2007 +++ llvm/lib/Transforms/Hello/Makefile Fri Apr 13 13:35:15 2007 @@ -10,7 +10,7 @@ LEVEL = ../../.. LIBRARYNAME = LLVMHello LOADABLE_MODULE = 1 -USEDLIBS = LLVMSupport.a +USEDLIBS = include $(LEVEL)/Makefile.common ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Hello/Hello.cpp
Changes in directory llvm/lib/Transforms/Hello: Hello.cpp updated: 1.13 - 1.14 --- Log message: Remove use of SlowOperationInformer. --- Diffs of the changes: (+0 -3) Hello.cpp |3 --- 1 files changed, 3 deletions(-) Index: llvm/lib/Transforms/Hello/Hello.cpp diff -u llvm/lib/Transforms/Hello/Hello.cpp:1.13 llvm/lib/Transforms/Hello/Hello.cpp:1.14 --- llvm/lib/Transforms/Hello/Hello.cpp:1.13Tue Dec 19 16:24:09 2006 +++ llvm/lib/Transforms/Hello/Hello.cpp Fri Apr 13 13:58:18 2007 @@ -16,7 +16,6 @@ #include llvm/Pass.h #include llvm/Function.h #include llvm/ADT/StringExtras.h -#include llvm/Support/SlowOperationInformer.h #include llvm/Support/Streams.h #include llvm/ADT/Statistic.h using namespace llvm; @@ -27,7 +26,6 @@ // Hello - The first implementation, without getAnalysisUsage. struct Hello : public FunctionPass { virtual bool runOnFunction(Function F) { - SlowOperationInformer soi(EscapeString); HelloCounter++; std::string fname = F.getName(); EscapeString(fname); @@ -40,7 +38,6 @@ // Hello2 - The second implementation with getAnalysisUsage implemented. struct Hello2 : public FunctionPass { virtual bool runOnFunction(Function F) { - SlowOperationInformer soi(EscapeString); HelloCounter++; std::string fname = F.getName(); EscapeString(fname); ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/APInt.cpp
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.76 - 1.77 --- Log message: Implement a getBitsNeeded method to determine how many bits are needed to represent a string in binary form by an APInt. --- Diffs of the changes: (+37 -0) APInt.cpp | 37 + 1 files changed, 37 insertions(+) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.76 llvm/lib/Support/APInt.cpp:1.77 --- llvm/lib/Support/APInt.cpp:1.76 Wed Apr 11 08:00:04 2007 +++ llvm/lib/Support/APInt.cpp Fri Apr 13 14:19:07 2007 @@ -659,6 +659,43 @@ return *this; } +uint32_t APInt::getBitsNeeded(const char* str, uint32_t slen, uint8_t radix) { + assert(str != 0 Invalid value string); + assert(slen 0 Invalid string length); + + // Each computation below needs to know if its negative + uint32_t isNegative = str[0] == '-'; + if (isNegative) { +slen--; +str++; + } + // For radixes of power-of-two values, the bits required is accurately and + // easily computed + if (radix == 2) +return slen + isNegative; + if (radix == 8) +return slen * 3 + isNegative; + if (radix == 16) +return slen * 4 + isNegative; + + // Otherwise it must be radix == 10, the hard case + assert(radix == 10 Invalid radix); + + // This is grossly inefficient but accurate. We could probably do something + // with a computation of roughly slen*64/20 and then adjust by the value of + // the first few digits. But, I'm not sure how accurate that could be. + + // Compute a sufficient number of bits that is always large enough but might + // be too large. This avoids the assertion in the constructor. + uint32_t sufficient = slen*64/18; + + // Convert to the actual binary value. + APInt tmp(sufficient, str, slen, radix); + + // Compute how many bits are required. + return isNegative + tmp.logBase2(); +} + uint64_t APInt::getHashValue() const { // Put the bit width into the low order bits. uint64_t hash = BitWidth; ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/ADT/APInt.h
Changes in directory llvm/include/llvm/ADT: APInt.h updated: 1.65 - 1.66 --- Log message: Implement a getBitsNeeded method to determine how many bits are needed to represent a string in binary form by an APInt. --- Diffs of the changes: (+6 -0) APInt.h |6 ++ 1 files changed, 6 insertions(+) Index: llvm/include/llvm/ADT/APInt.h diff -u llvm/include/llvm/ADT/APInt.h:1.65 llvm/include/llvm/ADT/APInt.h:1.66 --- llvm/include/llvm/ADT/APInt.h:1.65 Tue Apr 10 11:33:06 2007 +++ llvm/include/llvm/ADT/APInt.h Fri Apr 13 14:19:07 2007 @@ -840,6 +840,12 @@ assert(getActiveBits() = 64 Too many bits for int64_t); return int64_t(pVal[0]); } + + /// This method determines how many bits are required to hold the APInt + /// equivalent of the string given by \p str of length \p slen. + /// @brief Get bits required for string value. + static uint32_t getBitsNeeded(const char* str, uint32_t slen, uint8_t radix); + /// countLeadingZeros - This function is an APInt version of the /// countLeadingZeros_{32,64} functions in MathExtras.h. It counts the number /// of zeros from the most significant bit to the first one bit. ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.102 - 1.103 --- Log message: add Alex --- Diffs of the changes: (+5 -5) DevMtgMay2007.html | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.102 llvm-www/DevMtgMay2007.html:1.103 --- llvm-www/DevMtgMay2007.html:1.102 Fri Apr 13 00:43:15 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:00:01 2007 @@ -35,9 +35,8 @@ - a href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/a - across the street from Apple/li /ul - tabletrtd - img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250 - /tdtdYes, this is the actual room/td/tr/table + img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250br + Yes, this is the actual room. /td/tr/table !-- *** -- @@ -322,6 +321,7 @@ trtdJeff Poznanovic/tdtdCray Inc./td/tr trtdRon Price/tdtdApple Inc./td/tr trtdChuck Rose/tdtdAdobe Systems Incorporated./td/tr +trtdAlex Rosenberg/tdtdSony/td/tr trtdMark Schimmel/tdtdWind River/td/tr trtdReid Spencer/tdtdIndependent/td/tr trtdMark Thomas/tdtdAerospace/td/tr @@ -332,7 +332,7 @@ /td /tr /table - pbTotal confirmed: 34/b/p + pbTotal confirmed: 35/b/p table class=www trth colspan=2Unconfirmed Attendees/th/tr trthName/ththOrganization/th/tr @@ -351,6 +351,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 05:43:15 $ +br/Last modified: $Date: 2007/04/13 20:00:01 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.103 - 1.104 --- Log message: move the image --- Diffs of the changes: (+3 -1) DevMtgMay2007.html |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.103 llvm-www/DevMtgMay2007.html:1.104 --- llvm-www/DevMtgMay2007.html:1.103 Fri Apr 13 15:00:01 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:01:47 2007 @@ -35,8 +35,10 @@ - a href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/a - across the street from Apple/li /ul + center img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250br Yes, this is the actual room. + /center /td/tr/table !-- *** -- @@ -351,6 +353,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 20:00:01 $ +br/Last modified: $Date: 2007/04/13 20:01:47 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.104 - 1.105 --- Log message: slightly better formatting --- Diffs of the changes: (+2 -2) DevMtgMay2007.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.104 llvm-www/DevMtgMay2007.html:1.105 --- llvm-www/DevMtgMay2007.html:1.104 Fri Apr 13 15:01:47 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:02:35 2007 @@ -33,7 +33,7 @@ libWhen/b: May 25, 2007, 8:00am to 6:00pm/li libWhere/b: a href=http://www.cupertinoinn.com/;Cupertino Inn/a - a - href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/a - across the street from Apple/li + href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/abr - across the street from Apple/li /ul center img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250br @@ -353,6 +353,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 20:01:47 $ +br/Last modified: $Date: 2007/04/13 20:02:35 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.105 - 1.106 --- Log message: who loves tables? silence --- Diffs of the changes: (+2 -2) DevMtgMay2007.html |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.105 llvm-www/DevMtgMay2007.html:1.106 --- llvm-www/DevMtgMay2007.html:1.105 Fri Apr 13 15:02:35 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 15:03:35 2007 @@ -1,7 +1,7 @@ !--#include virtual=header.incl -- div class=www_sectiontitleMay 25, 2007br/LLVM Developers' Meeting/div table - trtd + trtd valign=top ol lia href=#notesImportant Notes/a/li lia href=#agendaAgenda/a @@ -353,6 +353,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 20:02:35 $ +br/Last modified: $Date: 2007/04/13 20:03:35 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
Re: [llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Chris, On Fri, 2007-04-13 at 15:00 -0500, Chris Lattner wrote: Changes in directory llvm-www: DevMtgMay2007.html updated: 1.102 - 1.103 --- Log message: add Alex - tabletrtd - img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250 - /tdtdYes, this is the actual room/td/tr/table + img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250br That's a validation error. Please close your elements. SHould be br/ + Yes, this is the actual room. /td/tr/table !-- *** -- @@ -322,6 +321,7 @@ trtdJeff Poznanovic/tdtdCray Inc./td/tr trtdRon Price/tdtdApple Inc./td/tr trtdChuck Rose/tdtdAdobe Systems Incorporated./td/tr +trtdAlex Rosenberg/tdtdSony/td/tr trtdMark Schimmel/tdtdWind River/td/tr trtdReid Spencer/tdtdIndependent/td/tr trtdMark Thomas/tdtdAerospace/td/tr @@ -332,7 +332,7 @@ /td /tr /table - pbTotal confirmed: 34/b/p + pbTotal confirmed: 35/b/p table class=www trth colspan=2Unconfirmed Attendees/th/tr trthName/ththOrganization/th/tr @@ -351,6 +351,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 05:43:15 $ +br/Last modified: $Date: 2007/04/13 20:00:01 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/X86/isel-sink.ll
Changes in directory llvm/test/CodeGen/X86: isel-sink.ll added (r1.1) --- Log message: New testcase --- Diffs of the changes: (+17 -0) isel-sink.ll | 17 + 1 files changed, 17 insertions(+) Index: llvm/test/CodeGen/X86/isel-sink.ll diff -c /dev/null llvm/test/CodeGen/X86/isel-sink.ll:1.1 *** /dev/null Fri Apr 13 15:28:19 2007 --- llvm/test/CodeGen/X86/isel-sink.ll Fri Apr 13 15:28:08 2007 *** *** 0 --- 1,17 + ; RUN: llvm-as %s | llc -march=x86 | not grep lea + ; RUN: llvm-as %s | llc -march=x86 -mtriple=i686-apple-darwin8 | grep 'movl $4, (%ecx,%eax,4)' + + define i32 @test(i32* %X, i32 %B) { + ; This gep should be sunk out of this block into the load/store users. + %P = getelementptr i32* %X, i32 %B + %G = icmp ult i32 %B, 1234 + br i1 %G, label %T, label %F + T: + store i32 4, i32* %P + ret i32 141 + F: + %V = load i32* %P + ret i32 %V + } + + ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
Changes in directory llvm/lib/Transforms/Scalar: CodeGenPrepare.cpp updated: 1.3 - 1.4 --- Log message: Completely rewrite addressing-mode related sinking of code. In particular, this fixes problems where codegenprepare would sink expressions into load/stores that are not valid, and fixes cases where it would miss important valid ones. This fixes several serious codesize and perf issues, particularly on targets with complex addressing modes like arm and x86. For example, now we compile CodeGen/X86/isel-sink.ll to: _test: movl 8(%esp), %eax movl 4(%esp), %ecx cmpl $1233, %eax ja LBB1_2 #F LBB1_1: #T movl $4, (%ecx,%eax,4) movl $141, %eax ret LBB1_2: #F movl (%ecx,%eax,4), %eax ret instead of: _test: movl 8(%esp), %eax leal (,%eax,4), %ecx addl 4(%esp), %ecx cmpl $1233, %eax ja LBB1_2 #F LBB1_1: #T movl $4, (%ecx) movl $141, %eax ret LBB1_2: #F movl (%ecx), %eax ret --- Diffs of the changes: (+543 -342) CodeGenPrepare.cpp | 885 - 1 files changed, 543 insertions(+), 342 deletions(-) Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.3 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.4 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.3 Mon Apr 9 18:29:07 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Apr 13 15:30:56 2007 @@ -25,9 +25,12 @@ #include llvm/Target/TargetLowering.h #include llvm/Target/TargetMachine.h #include llvm/Transforms/Utils/BasicBlockUtils.h +#include llvm/Transforms/Utils/Local.h +#include llvm/ADT/DenseMap.h #include llvm/ADT/SmallSet.h #include llvm/Support/Debug.h #include llvm/Support/Compiler.h +#include llvm/Support/GetElementPtrTypeIterator.h using namespace llvm; namespace { @@ -44,7 +47,9 @@ bool CanMergeBlocks(const BasicBlock *BB, const BasicBlock *DestBB) const; void EliminateMostlyEmptyBlock(BasicBlock *BB); bool OptimizeBlock(BasicBlock BB); -bool OptimizeGEPExpression(GetElementPtrInst *GEPI); +bool OptimizeLoadStoreInst(Instruction *I, Value *Addr, + const Type *AccessTy, + DenseMapValue*,Value* SunkAddrs); }; } static RegisterPassCodeGenPrepare X(codegenprepare, @@ -291,312 +296,37 @@ SplitCriticalEdge(TI, SuccNum, P, true); } - -/// InsertGEPComputeCode - Insert code into BB to compute Ptr+PtrOffset, -/// casting to the type of GEPI. -static Instruction *InsertGEPComputeCode(Instruction *V, BasicBlock *BB, - Instruction *GEPI, Value *Ptr, - Value *PtrOffset) { - if (V) return V; // Already computed. - - // Figure out the insertion point - BasicBlock::iterator InsertPt; - if (BB == GEPI-getParent()) { -// If GEP is already inserted into BB, insert right after the GEP. -InsertPt = GEPI; -++InsertPt; - } else { -// Otherwise, insert at the top of BB, after any PHI nodes -InsertPt = BB-begin(); -while (isaPHINode(InsertPt)) ++InsertPt; - } - - // If Ptr is itself a cast, but in some other BB, emit a copy of the cast into - // BB so that there is only one value live across basic blocks (the cast - // operand). - if (CastInst *CI = dyn_castCastInst(Ptr)) -if (CI-getParent() != BB isaPointerType(CI-getOperand(0)-getType())) - Ptr = CastInst::create(CI-getOpcode(), CI-getOperand(0), CI-getType(), - , InsertPt); - - // Add the offset, cast it to the right type. - Ptr = BinaryOperator::createAdd(Ptr, PtrOffset, , InsertPt); - // Ptr is an integer type, GEPI is pointer type == IntToPtr - return V = CastInst::create(Instruction::IntToPtr, Ptr, GEPI-getType(), - , InsertPt); -} - -/// ReplaceUsesOfGEPInst - Replace all uses of RepPtr with inserted code to -/// compute its value. The RepPtr value can be computed with Ptr+PtrOffset. One -/// trivial way of doing this would be to evaluate Ptr+PtrOffset in RepPtr's -/// block, then ReplaceAllUsesWith'ing everything. However, we would prefer to -/// sink PtrOffset into user blocks where doing so will likely allow us to fold -/// the constant add into a load or store instruction. Additionally, if a user -/// is a pointer-pointer cast, we look through it to find its users. -static void ReplaceUsesOfGEPInst(Instruction *RepPtr, Value *Ptr, - Constant *PtrOffset, BasicBlock *DefBB, - GetElementPtrInst *GEPI, - std::mapBasicBlock*,Instruction* InsertedExprs) { - while (!RepPtr-use_empty()) { -Instruction *User = castInstruction(RepPtr-use_back()); - -// If the user is a Pointer-Pointer cast, recurse. Only BitCast can be -
[llvm-commits] CVS: llvm/test/CodeGen/ARM/lsr-code-insertion.ll
Changes in directory llvm/test/CodeGen/ARM: lsr-code-insertion.ll added (r1.1) --- Log message: new lsr testcase --- Diffs of the changes: (+60 -0) lsr-code-insertion.ll | 60 ++ 1 files changed, 60 insertions(+) Index: llvm/test/CodeGen/ARM/lsr-code-insertion.ll diff -c /dev/null llvm/test/CodeGen/ARM/lsr-code-insertion.ll:1.1 *** /dev/null Fri Apr 13 15:38:24 2007 --- llvm/test/CodeGen/ARM/lsr-code-insertion.ll Fri Apr 13 15:38:14 2007 *** *** 0 --- 1,60 + ; RUN: llvm-as %s | llc -stats 21 | grep '40.*Number of machine instrs printed' + ; This test really wants to check that the resultant cond_true block only has a single + ; store in it, and that cond_true55 only has code to materialize the constant and do + ; a store. We do *not* want something like this: + ; + ;LBB1_3: @cond_true + ;add r8, r0, r6 + ;str r10, [r8, #+4] + ; + + target triple = arm-apple-darwin8 + + define void @foo(i32* %mc, i32* %mpp, i32* %ip, i32* %dpp, i32* %tpmm, i32 %M, i32* %tpim, i32* %tpdm, i32* %bp, i32* %ms, i32 %xmb) { + entry: + %tmp6584 = icmp slt i32 %M, 1 ; i1 [#uses=1] + br i1 %tmp6584, label %return, label %bb + + bb: ; preds = %cond_next59, %entry + %indvar = phi i32 [ 0, %entry ], [ %k.069.0, %cond_next59 ] ; i32 [#uses=6] + %k.069.0 = add i32 %indvar, 1 ; i32 [#uses=3] + %tmp3 = getelementptr i32* %mpp, i32 %indvar; i32* [#uses=1] + %tmp4 = load i32* %tmp3 ; i32 [#uses=1] + %tmp8 = getelementptr i32* %tpmm, i32 %indvar ; i32* [#uses=1] + %tmp9 = load i32* %tmp8 ; i32 [#uses=1] + %tmp10 = add i32 %tmp9, %tmp4 ; i32 [#uses=2] + %tmp13 = getelementptr i32* %mc, i32 %k.069.0 ; i32* [#uses=5] + store i32 %tmp10, i32* %tmp13 + %tmp17 = getelementptr i32* %ip, i32 %indvar; i32* [#uses=1] + %tmp18 = load i32* %tmp17 ; i32 [#uses=1] + %tmp22 = getelementptr i32* %tpim, i32 %indvar ; i32* [#uses=1] + %tmp23 = load i32* %tmp22 ; i32 [#uses=1] + %tmp24 = add i32 %tmp23, %tmp18 ; i32 [#uses=2] + %tmp30 = icmp sgt i32 %tmp24, %tmp10; i1 [#uses=1] + br i1 %tmp30, label %cond_true, label %cond_next + + cond_true:; preds = %bb + store i32 %tmp24, i32* %tmp13 + br label %cond_next + + cond_next:; preds = %cond_true, %bb + %tmp39 = load i32* %tmp13 ; i32 [#uses=1] + %tmp42 = getelementptr i32* %ms, i32 %k.069.0 ; i32* [#uses=1] + %tmp43 = load i32* %tmp42 ; i32 [#uses=1] + %tmp44 = add i32 %tmp43, %tmp39 ; i32 [#uses=2] + store i32 %tmp44, i32* %tmp13 + %tmp52 = icmp slt i32 %tmp44, -987654321; i1 [#uses=1] + br i1 %tmp52, label %cond_true55, label %cond_next59 + + cond_true55: ; preds = %cond_next + store i32 -987654321, i32* %tmp13 + br label %cond_next59 + + cond_next59: ; preds = %cond_true55, %cond_next + %tmp61 = add i32 %indvar, 2 ; i32 [#uses=1] + %tmp65 = icmp sgt i32 %tmp61, %M; i1 [#uses=1] + br i1 %tmp65, label %return, label %bb + + return: ; preds = %cond_next59, %entry + ret void + } ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
Changes in directory llvm/lib/Transforms/Scalar: LoopStrengthReduce.cpp updated: 1.128 - 1.129 --- Log message: Now that codegen prepare isn't defeating me, I can finally fix what I set out to do! :) This fixes a problem where LSR would insert a bunch of code into each MBB that uses a particular subexpression (e.g. IV+base+C). The problem is that this code cannot be CSE'd back together if inserted into different blocks. This patch changes LSR to attempt to insert a single copy of this code and share it, allowing codegenprepare to duplicate the code if it can be sunk into various addressing modes. On CodeGen/ARM/lsr-code-insertion.ll, for example, this gives us code like: add r8, r0, r5 str r6, [r8, #+4] .. ble LBB1_4 @cond_next LBB1_3: @cond_true str r10, [r8, #+4] LBB1_4: @cond_next ... LBB1_5: @cond_true55 ldr r6, LCPI1_1 str r6, [r8, #+4] instead of: add r10, r0, r6 str r8, [r10, #+4] ... ble LBB1_4 @cond_next LBB1_3: @cond_true add r8, r0, r6 str r10, [r8, #+4] LBB1_4: @cond_next ... LBB1_5: @cond_true55 add r8, r0, r6 ldr r10, LCPI1_1 str r10, [r8, #+4] Besides being smaller and more efficient, this makes it immediately obvious that it is profitable to predicate LBB1_3 now :) --- Diffs of the changes: (+19 -1) LoopStrengthReduce.cpp | 20 +++- 1 files changed, 19 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp diff -u llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.128 llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.129 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp:1.128 Mon Apr 9 17:20:14 2007 +++ llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp Fri Apr 13 15:42:26 2007 @@ -568,7 +568,25 @@ SCEVExpander Rewriter, Loop *L, Pass *P) { if (!isaPHINode(Inst)) { -Value *NewVal = InsertCodeForBaseAtPosition(NewBase, Rewriter, Inst, L); +// By default, insert code at the user instruction. +BasicBlock::iterator InsertPt = Inst; + +// However, if the Operand is itself an instruction, the (potentially +// complex) inserted code may be shared by many users. Because of this, we +// want to emit code for the computation of the operand right before its old +// computation. This is usually safe, because we obviously used to use the +// computation when it was computed in its current block. However, in some +// cases (e.g. use of a post-incremented induction variable) the NewBase +// value will be pinned to live somewhere after the original computation. +// In this case, we have to back off. +if (!isUseOfPostIncrementedValue) { + if (Instruction *OpInst = dyn_castInstruction(OperandValToReplace)) { +InsertPt = OpInst; +while (isaPHINode(InsertPt)) ++InsertPt; + } +} + +Value *NewVal = InsertCodeForBaseAtPosition(NewBase, Rewriter, InsertPt, L); // Replace the use of the operand Value with the new Phi we just created. Inst-replaceUsesOfWith(OperandValToReplace, NewVal); DOUT CHANGED: IMM = *ImmInst = *Inst; ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.106 - 1.107 --- Log message: make the reid happier. --- Diffs of the changes: (+6 -6) DevMtgMay2007.html | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.106 llvm-www/DevMtgMay2007.html:1.107 --- llvm-www/DevMtgMay2007.html:1.106 Fri Apr 13 15:03:35 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 16:41:47 2007 @@ -33,10 +33,10 @@ libWhen/b: May 25, 2007, 8:00am to 6:00pm/li libWhere/b: a href=http://www.cupertinoinn.com/;Cupertino Inn/a - a - href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/abr - across the street from Apple/li + href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/abr/ - across the street from Apple/li /ul center - img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250br + img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250br/ Yes, this is the actual room. /center /td/tr/table @@ -287,7 +287,7 @@ tr style=vertical-align:top td table class=www -trth colspan=2Confirmed Attendees (A-Ler)/th/tr +trth colspan=2Confirmed Attendees/th/tr trthName/ththOrganization/th/tr trtdVikram Adve/tdtdUIUC/td/tr trtdBob Archer/tdtdAdobe Systems Incorporated./td/tr @@ -306,13 +306,13 @@ trtdChris Lattner/tdtdApple Inc./td/tr trtdAndrew Lenharth/tdtdUIUC/td/tr trtdJulien Lerouge/tdtdApple Inc./td +trtdNick Lewycky/tdtdIndependent/td/tr /table /td td table class=www -trth colspan=2Confirmed Attendees (Lew-Z)/th/tr +trth colspan=2Confirmed Attendees/th/tr trthName/ththOrganization/th/tr -trtdNick Lewycky/tdtdIndependent/td/tr trtdEfrem Lipkin/tdtdCoDesign/td/tr trtdGabe McArthur/tdtdIndependent/td/tr trtdPaul McJones/tdtdAdobe Systems Incorporated./td/tr @@ -353,6 +353,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 20:03:35 $ +br/Last modified: $Date: 2007/04/13 21:41:47 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.107 - 1.108 --- Log message: Hopefully fix validation problems. --- Diffs of the changes: (+5 -5) DevMtgMay2007.html | 10 +- 1 files changed, 5 insertions(+), 5 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.107 llvm-www/DevMtgMay2007.html:1.108 --- llvm-www/DevMtgMay2007.html:1.107 Fri Apr 13 16:41:47 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 17:13:27 2007 @@ -33,12 +33,12 @@ libWhen/b: May 25, 2007, 8:00am to 6:00pm/li libWhere/b: a href=http://www.cupertinoinn.com/;Cupertino Inn/a - a - href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/abr/ - across the street from Apple/li + href=http://maps.google.com/maps?f=qamp;hl=enamp;q=10889+N+De+Anza+Blvd,+Cupertino,+CA,+95014amp;sll=37.0625,-95.677068amp;sspn=48.106236,62.050781amp;layer=amp;ie=UTF8amp;z=16amp;om=1amp;iwloc=addr;10889 N De Anza Blvd, Cupertino, CA, 95014/a - across the street from Apple/li /ul - center - img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250br/ + div style=text-align:center + img src=http://www.cupertinoinn.com/images/conference.jpg; width=381 height=250 alt=Meeting Roombr/ Yes, this is the actual room. - /center + /div /td/tr/table !-- *** -- @@ -353,6 +353,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 21:41:47 $ +br/Last modified: $Date: 2007/04/13 22:13:27 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll
Changes in directory llvm/test/CodeGen/ARM: 2007-03-15-GEP-Idx-Sink.ll updated: 1.1 - 1.2 --- Log message: xfail this for now --- Diffs of the changes: (+3 -0) 2007-03-15-GEP-Idx-Sink.ll |3 +++ 1 files changed, 3 insertions(+) Index: llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll diff -u llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll:1.1 llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll:1.2 --- llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.ll:1.1Fri Mar 16 22:18:32 2007 +++ llvm/test/CodeGen/ARM/2007-03-15-GEP-Idx-Sink.llFri Apr 13 17:20:27 2007 @@ -1,6 +1,9 @@ ; RUN: llvm-as %s | llc -march=arm ; RUN: llvm-as %s | llc -march=arm -stats 21 | not grep 'register spills' +;; Must talk to evan about this. +; XFAIL: * + define void @foo(i8** %buf, i32 %size, i32 %col, i8* %p) { entry: icmp sgt i32 %size, 0 ; i1:0 [#uses=1] ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] llvm-gcc: implement CEIL_DIV_EXPR
CEIL_DIV_EXPR performs integer division with rounding towards positive infinity, thus 3 cdiv 2 = 2 while -3 cdiv 2 = -1. Testing is tricky, because CEIL_DIV_EXPR is only generated in unusual circumstances, giving little coverage, so I modified the llvm- and mainline gcc compilers to output CEIL_DIV_EXPR for normal division, and compared the results for all possible signed and unsigned i8 values for the left- and right-hand sides. Best wishes, Duncan. Index: gcc.llvm.master/gcc/llvm-convert.cpp === --- gcc.llvm.master.orig/gcc/llvm-convert.cpp 2007-04-12 23:27:17.0 +0200 +++ gcc.llvm.master/gcc/llvm-convert.cpp 2007-04-13 20:27:10.0 +0200 @@ -814,6 +814,7 @@ Result = EmitBinOp(exp, DestLoc, Instruction::SDiv); break; case RDIV_EXPR: Result = EmitBinOp(exp, DestLoc, Instruction::FDiv); break; + case CEIL_DIV_EXPR: Result = EmitCEIL_DIV_EXPR(exp); break; case ROUND_DIV_EXPR: Result = EmitROUND_DIV_EXPR(exp); break; case TRUNC_MOD_EXPR: if (TYPE_UNSIGNED(TREE_TYPE(exp))) @@ -3342,6 +3343,82 @@ return new SelectInst(SameAsRem, Rem, RemPlusRHS, mod, CurBB); } +Value *TreeToLLVM::EmitCEIL_DIV_EXPR(tree exp) { + // Notation: CEIL_DIV_EXPR - CDiv, TRUNC_DIV_EXPR - Div. + + // CDiv calculates LHS/RHS by rounding up to the nearest integer. In terms + // of Div this means if the values of LHS and RHS have opposite signs or if + // LHS is zero, then CDiv necessarily equals Div; and + // LHS CDiv RHS = (LHS - Sign(RHS)) Div RHS + 1 + // otherwise. + + const Type *Ty = ConvertType(TREE_TYPE(exp)); + Constant *Zero = ConstantInt::get(Ty, 0); + Constant *One = ConstantInt::get(Ty, 1); + Constant *MinusOne = ConstantInt::get(Ty, -1); + + Value *LHS = Emit(TREE_OPERAND(exp, 0), 0); + Value *RHS = Emit(TREE_OPERAND(exp, 1), 0); + + if (!TYPE_UNSIGNED(TREE_TYPE(exp))) { +// In the case of signed arithmetic, we calculate CDiv as follows: +// LHS CDiv RHS = (LHS - Sign(RHS) * Offset) Div RHS + Offset, +// where Offset is 1 if LHS and RHS have the same sign and LHS is +// not zero, and 0 otherwise. + +// On some machines INT_MIN Div -1 traps. You might expect a trap for +// INT_MIN CDiv -1 too, but this implementation will not generate one. +// Quick quiz question: what value is returned for INT_MIN CDiv -1? + +// Determine the signs of LHS and RHS, and whether they have the same sign. +Value *LHSIsPositive = new ICmpInst(ICmpInst::ICMP_SGE, LHS, Zero, tmp, +CurBB); +Value *RHSIsPositive = new ICmpInst(ICmpInst::ICMP_SGE, RHS, Zero, tmp, +CurBB); +Value *HaveSameSign = new ICmpInst(ICmpInst::ICMP_EQ, LHSIsPositive, + RHSIsPositive, tmp, CurBB); + +// Offset equals 1 if LHS and RHS have the same sign and LHS is not zero ... +Value *LHSNotZero = new ICmpInst(ICmpInst::ICMP_NE, LHS, Zero, tmp, + CurBB); +Value *OffsetOne = BinaryOperator::create(Instruction::And, HaveSameSign, + LHSNotZero, tmp, CurBB); +// ... otherwise it is 0. +Value *Offset = new SelectInst(OffsetOne, One, Zero, tmp, CurBB); + +// Calculate Sign(RHS) ... +Value *SignRHS = new SelectInst(RHSIsPositive, One, MinusOne, tmp, CurBB); +// ... and Sign(RHS) * Offset +Value *SignedOffset = CastToType(Instruction::SExt, OffsetOne, Ty); +SignedOffset = BinaryOperator::create(Instruction::And, SignRHS, + SignedOffset, tmp, CurBB); + +// Return CDiv = (LHS - Sign(RHS) * Offset) Div RHS + Offset. +Value *CDiv = BinaryOperator::create(Instruction::Sub, LHS, SignedOffset, + tmp, CurBB); +CDiv = BinaryOperator::create(Instruction::SDiv, CDiv, RHS, tmp, CurBB); +return BinaryOperator::create(Instruction::Add, CDiv, Offset, cdiv, + CurBB); + } else { +// In the case of unsigned arithmetic, LHS and RHS necessarily have the +// same sign, so we can use +// LHS CDiv RHS = (LHS - 1) Div RHS + 1 +// as long as LHS is non-zero. + +// Offset is 1 if LHS is non-zero, 0 otherwise. +Value *LHSNotZero = new ICmpInst(ICmpInst::ICMP_NE, LHS, Zero, tmp, + CurBB); +Value *Offset = new SelectInst(LHSNotZero, One, Zero, tmp, CurBB); + +// Return CDiv = (LHS - Offset) Div RHS + Offset. +Value *CDiv = BinaryOperator::create(Instruction::Sub, LHS, Offset, tmp, + CurBB); +CDiv = BinaryOperator::create(Instruction::UDiv, CDiv, RHS, tmp, CurBB); +return BinaryOperator::create(Instruction::Add, CDiv, Offset, cdiv, + CurBB); + } +} + Value *TreeToLLVM::EmitROUND_DIV_EXPR(tree exp) { // Notation:
[llvm-commits] CVS: llvm/test/Transforms/SCCP/apint-array.ll apint-basictest.ll apint-basictest2.ll apint-basictest3.ll apint-basictest4.ll apint-bigarray.ll apint-bigint.ll apint-bigint2.ll apint-ips
Changes in directory llvm/test/Transforms/SCCP: apint-array.ll added (r1.1) apint-basictest.ll added (r1.1) apint-basictest2.ll added (r1.1) apint-basictest3.ll added (r1.1) apint-basictest4.ll added (r1.1) apint-bigarray.ll added (r1.1) apint-bigint.ll added (r1.1) apint-bigint2.ll added (r1.1) apint-ipsccp1.ll added (r1.1) apint-ipsccp2.ll added (r1.1) apint-ipsccp3.ll added (r1.1) apint-ipsccp4.ll added (r1.1) apint-load.ll added (r1.1) apint-phi.ll added (r1.1) apint-select.ll added (r1.1) --- Log message: Add the SCCP regression tests for APInt expressions. These test cases turned up some regressions that have since been fixed. We don't want to loose the regression tests. Test cases by Guoling Han. --- Diffs of the changes: (+360 -0) apint-array.ll | 23 +++ apint-basictest.ll | 17 + apint-basictest2.ll | 18 ++ apint-basictest3.ll | 24 apint-basictest4.ll | 26 ++ apint-bigarray.ll | 24 apint-bigint.ll | 10 ++ apint-bigint2.ll| 19 +++ apint-ipsccp1.ll| 23 +++ apint-ipsccp2.ll| 21 + apint-ipsccp3.ll| 24 apint-ipsccp4.ll| 51 +++ apint-load.ll | 38 ++ apint-phi.ll| 20 apint-select.ll | 22 ++ 15 files changed, 360 insertions(+) Index: llvm/test/Transforms/SCCP/apint-array.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-array.ll:1.1 *** /dev/null Fri Apr 13 17:33:20 2007 --- llvm/test/Transforms/SCCP/apint-array.llFri Apr 13 17:33:10 2007 *** *** 0 --- 1,23 + ; RUN: llvm-as %s | opt -sccp | llvm-dis | grep 'ret i101 12' + + @Y = constant [6 x i101] [ i101 12, i101 12345678900, i101 -12,i101 + -12345678900, i101 0,i101 912345678900] + + define i101 @array() + { + Head: +%A = getelementptr [6 x i101]* @Y, i32 0, i32 1 + +%B = load i101* %A +%C = icmp sge i101 %B, 1 +br i1 %C, label %True, label %False + True: +%D = and i101 %B, 1 +%E = trunc i101 %D to i32 +%F = getelementptr [6 x i101]* @Y, i32 0, i32 %E +%G = load i101* %F +br label %False + False: +%H = phi i101 [%G, %True], [-1, %Head] +ret i101 %H + } Index: llvm/test/Transforms/SCCP/apint-basictest.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-basictest.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-basictest.llFri Apr 13 17:33:10 2007 *** *** 0 --- 1,17 + ; This is a basic sanity check for constant propogation. The add instruction + ; should be eliminated. + + ; RUN: llvm-as %s | opt -sccp | llvm-dis -o /dev/null -f + ; RUN: llvm-as %s | opt -sccp | llvm-dis | not grep add + + define i128 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 + BB1: + %Val = add i128 0, 1 + br label %BB3 + BB2: + br label %BB3 + BB3: + %Ret = phi i128 [%Val, %BB1], [2, %BB2] + ret i128 %Ret + } Index: llvm/test/Transforms/SCCP/apint-basictest2.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-basictest2.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-basictest2.ll Fri Apr 13 17:33:10 2007 *** *** 0 --- 1,18 + ; This is a basic sanity check for constant propogation. The add instruction + ; and phi instruction should be eliminated. + + ; RUN: llvm-as %s | opt -sccp | llvm-dis -o /dev/null -f + ; RUN: llvm-as %s | opt -sccp | llvm-dis | not grep phi + ; RUN: llvm-as %s | opt -sccp | llvm-dis | not grep add + + define i128 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 + BB1: + %Val = add i128 0, 1 + br label %BB3 + BB2: + br label %BB3 + BB3: + %Ret = phi i128 [%Val, %BB1], [1, %BB2] + ret i128 %Ret + } Index: llvm/test/Transforms/SCCP/apint-basictest3.ll diff -c /dev/null llvm/test/Transforms/SCCP/apint-basictest3.ll:1.1 *** /dev/null Fri Apr 13 17:33:27 2007 --- llvm/test/Transforms/SCCP/apint-basictest3.ll Fri Apr 13 17:33:10 2007 *** *** 0 --- 1,24 + ; This is a basic sanity check for constant propogation. It tests the basic + ; arithmatic operations. + + + ; RUN: llvm-as %s | opt -sccp | llvm-dis -o /dev/null -f + ; RUN: llvm-as %s | opt -sccp | llvm-dis | not grep mul + ; RUN: llvm-as %s | opt -sccp | llvm-dis | not grep umod + + define i128 @test(i1 %B) { + br i1 %B, label %BB1, label %BB2 + BB1: + %t1 = add i128 0, 1 + %t2 = sub i128 0, %t1 + %t3 = mul i128 %t2, -1 + br label %BB3 + BB2: + %f1 = udiv i128 -1, 1 + %f2 = add i128 %f1, 1 + %f3 = umod i128 %f2, 2121 + br label %BB3 + BB3: + %Ret = phi
[llvm-commits] CVS: llvm-www/Name.html
Changes in directory llvm-www: Name.html updated: 1.10 - 1.11 --- Log message: Yet another name suggestion. --- Diffs of the changes: (+3 -2) Name.html |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.10 llvm-www/Name.html:1.11 --- llvm-www/Name.html:1.10 Fri Apr 13 12:38:05 2007 +++ llvm-www/Name.html Fri Apr 13 17:42:50 2007 @@ -183,13 +183,14 @@ ALCS to make it even more unique./td/tr trtdZhongxing Xu/tdthOmniCbr/Omnipilerbr/Omnicom/thtdStands for Omnipotent Compiler. I prefer the first./td/tr -trtd rowspan=4Duncan Sands/tdthOptLib/thtdPortmanteau of optimizing +trtd rowspan=5Duncan Sands/tdthOptLib/thtdPortmanteau of optimizing and library./td/tr trthllvroom/thtdAs in the vrooming of a motorcycle engine. trthOptLOC/thtdPortmanteau of Optimization and Lines Of Code/td/tr trthLoveByte/thtdAlong the Warloc - Loveloc lines as baldric4 suggested in IRC. LOC = Lines of Code/td/tr +trthTuneful or TuneUp/thtdAs in tuning/td/tr trtdPaolo Invernizzi/tdthMithril/thtdThe fictional metal from JRR Tolkien The Lord of the Rings. Gandalf says: Mithril! All folk desired it. It could be beaten like copper, and polished like glass; and the Dwarves could @@ -249,6 +250,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 17:38:05 $ +br/Last modified: $Date: 2007/04/13 22:42:50 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Target/CBackend/CBackend.cpp
Changes in directory llvm/lib/Target/CBackend: CBackend.cpp updated: 1.336 - 1.337 --- Log message: Silence VC++ warning. --- Diffs of the changes: (+1 -1) CBackend.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Target/CBackend/CBackend.cpp diff -u llvm/lib/Target/CBackend/CBackend.cpp:1.336 llvm/lib/Target/CBackend/CBackend.cpp:1.337 --- llvm/lib/Target/CBackend/CBackend.cpp:1.336 Thu Apr 12 16:57:15 2007 +++ llvm/lib/Target/CBackend/CBackend.cpp Fri Apr 13 17:52:03 2007 @@ -2372,7 +2372,7 @@ // Examine all the instructions in this function to find the intrinsics that // need to be lowered. - for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB) + for (Function::iterator BB = F.begin(), EE = F.end(); BB != EE; ++BB) for (BasicBlock::iterator I = BB-begin(), E = BB-end(); I != E; ) if (CallInst *CI = dyn_castCallInst(I++)) if (Function *F = CI-getCalledFunction()) ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] [126086] Allow reg-sized structs and unions as inputs to asm.
Revision: 126086 Author: johannes Date: 2007-04-13 15:52:00 -0700 (Fri, 13 Apr 2007) Log Message: --- Allow reg-sized structs and unions as inputs to asm. Modified Paths: -- apple-local/branches/llvm/gcc/llvm-convert.cpp Modified: apple-local/branches/llvm/gcc/llvm-convert.cpp === --- apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-13 22:35:30 UTC (rev 126085) +++ apple-local/branches/llvm/gcc/llvm-convert.cpp 2007-04-13 22:52:00 UTC (rev 126086) @@ -3638,7 +3638,20 @@ return 0; if (AllowsReg || !AllowsMem) {// Register operand. - Value *Op = Emit(Val, 0); + const Type *LLVMTy = ConvertType(type); + Value *Op; + if (!LLVMTy-isFirstClassType()) { +// Structs and unions are permitted here, as long as they're the +// same size as a register. +Value *Target = CreateTemporary(LLVMTy); +LValue LV = EmitLV(Val); +EmitAggregateCopy(Target, LV.Ptr, type, false, TREE_THIS_VOLATILE (Val)); +LLVMTy = IntegerType::get(TD.getTypeSizeInBits(LLVMTy)); +Op = new LoadInst(CastToType(Instruction::BitCast, Target, + PointerType::get(LLVMTy)), tmp, CurBB); + } else { +Op = Emit(Val, 0); + } CallOps.push_back(Op); CallArgTypes.push_back(Op-getType()); } else { // Memory operand. ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c 2007-04-13-InlineAsmUnion2.c
Changes in directory llvm/test/CFrontend: 2007-04-13-InlineAsmStruct2.c added (r1.1) 2007-04-13-InlineAsmUnion2.c added (r1.1) --- Log message: tests for struct/union as input operands to asm. --- Diffs of the changes: (+16 -0) 2007-04-13-InlineAsmStruct2.c |9 + 2007-04-13-InlineAsmUnion2.c |7 +++ 2 files changed, 16 insertions(+) Index: llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c diff -c /dev/null llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c:1.1 *** /dev/null Fri Apr 13 17:54:21 2007 --- llvm/test/CFrontend/2007-04-13-InlineAsmStruct2.c Fri Apr 13 17:54:11 2007 *** *** 0 --- 1,9 + // RUN: %llvmgcc %s -S -emit-llvm -o - | grep 'call void asm' + + struct V { short X, Y; }; + int bar() { + struct V bar; + __asm__ volatile(foo %0\n :: r(bar)); + return bar.X; + } + Index: llvm/test/CFrontend/2007-04-13-InlineAsmUnion2.c diff -c /dev/null llvm/test/CFrontend/2007-04-13-InlineAsmUnion2.c:1.1 *** /dev/null Fri Apr 13 17:54:29 2007 --- llvm/test/CFrontend/2007-04-13-InlineAsmUnion2.cFri Apr 13 17:54:11 2007 *** *** 0 --- 1,7 + // RUN: %llvmgcc %s -S -emit-llvm -o - | grep 'call void asm' + + union U { int x; char* p; }; + void foo() { + union U bar; + __asm__ volatile(foo %0\n :: r(bar)); + } ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Support/APInt.cpp
Changes in directory llvm/lib/Support: APInt.cpp updated: 1.77 - 1.78 --- Log message: We want the number of bits needed, not the power of 2. --- Diffs of the changes: (+1 -1) APInt.cpp |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index: llvm/lib/Support/APInt.cpp diff -u llvm/lib/Support/APInt.cpp:1.77 llvm/lib/Support/APInt.cpp:1.78 --- llvm/lib/Support/APInt.cpp:1.77 Fri Apr 13 14:19:07 2007 +++ llvm/lib/Support/APInt.cpp Fri Apr 13 19:00:10 2007 @@ -693,7 +693,7 @@ APInt tmp(sufficient, str, slen, radix); // Compute how many bits are required. - return isNegative + tmp.logBase2(); + return isNegative + tmp.logBase2() + 1; } uint64_t APInt::getHashValue() const { ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/include/llvm/Instructions.h
Changes in directory llvm/include/llvm: Instructions.h updated: 1.65 - 1.66 --- Log message: add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method. Writing it twice in the same day was too much for me. --- Diffs of the changes: (+5 -0) Instructions.h |5 + 1 files changed, 5 insertions(+) Index: llvm/include/llvm/Instructions.h diff -u llvm/include/llvm/Instructions.h:1.65 llvm/include/llvm/Instructions.h:1.66 --- llvm/include/llvm/Instructions.h:1.65 Mon Apr 9 13:00:57 2007 +++ llvm/include/llvm/Instructions.hFri Apr 13 19:12:57 2007 @@ -408,6 +408,11 @@ inline bool hasIndices() const { return getNumOperands() 1; } + + /// hasAllZeroIndices - Return true if all of the indices of this GEP are + /// zeros. If so, the result pointer and the first operand have the same + /// value, just potentially different types. + bool hasAllZeroIndices() const; // Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const GetElementPtrInst *) { return true; } ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/VMCore/Instructions.cpp
Changes in directory llvm/lib/VMCore: Instructions.cpp updated: 1.84 - 1.85 --- Log message: add GetElementPtrInst::hasAllZeroIndices, a long-overdue helper method. Writing it twice in the same day was too much for me. --- Diffs of the changes: (+16 -0) Instructions.cpp | 16 1 files changed, 16 insertions(+) Index: llvm/lib/VMCore/Instructions.cpp diff -u llvm/lib/VMCore/Instructions.cpp:1.84 llvm/lib/VMCore/Instructions.cpp:1.85 --- llvm/lib/VMCore/Instructions.cpp:1.84 Wed Apr 11 08:04:48 2007 +++ llvm/lib/VMCore/Instructions.cppFri Apr 13 19:12:57 2007 @@ -966,6 +966,22 @@ return PTy-getElementType(); } + +/// hasAllZeroIndices - Return true if all of the indices of this GEP are +/// zeros. If so, the result pointer and the first operand have the same +/// value, just potentially different types. +bool GetElementPtrInst::hasAllZeroIndices() const { + for (unsigned i = 1, e = getNumOperands(); i != e; ++i) { +if (ConstantInt *CI = dyn_castConstantInt(getOperand(i))) { + if (!CI-isZero()) return false; +} else { + return false; +} + } + return true; +} + + //===--===// // ExtractElementInst Implementation //===--===// ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp
Changes in directory llvm/lib/Transforms/Scalar: CodeGenPrepare.cpp updated: 1.4 - 1.5 --- Log message: use an accessor to simplify code. --- Diffs of the changes: (+1 -15) CodeGenPrepare.cpp | 16 +--- 1 files changed, 1 insertion(+), 15 deletions(-) Index: llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp diff -u llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.4 llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.5 --- llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp:1.4 Fri Apr 13 15:30:56 2007 +++ llvm/lib/Transforms/Scalar/CodeGenPrepare.cpp Fri Apr 13 19:17:39 2007 @@ -886,21 +886,7 @@ SI-getOperand(0)-getType(), SunkAddrs); } else if (GetElementPtrInst *GEPI = dyn_castGetElementPtrInst(I)) { - bool HasNonZeroIdx = false; - for (GetElementPtrInst::op_iterator OI = GEPI-op_begin()+1, - E = GEPI-op_end(); OI != E; ++OI) { -if (ConstantInt *CI = dyn_castConstantInt(*OI)) { - if (!CI-isZero()) { -HasNonZeroIdx = true; -break; - } -} else { - HasNonZeroIdx = true; - break; -} - } - - if (!HasNonZeroIdx) { + if (GEPI-hasAllZeroIndices()) { /// The GEP operand must be a pointer, so must its result - BitCast Instruction *NC = new BitCastInst(GEPI-getOperand(0), GEPI-getType(), GEPI-getName(), GEPI); ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Transforms/InstCombine/malloc-free-delete.ll
Changes in directory llvm/test/Transforms/InstCombine: malloc-free-delete.ll added (r1.1) --- Log message: testcase for PR1201: http://llvm.org/PR1201 --- Diffs of the changes: (+12 -0) malloc-free-delete.ll | 12 1 files changed, 12 insertions(+) Index: llvm/test/Transforms/InstCombine/malloc-free-delete.ll diff -c /dev/null llvm/test/Transforms/InstCombine/malloc-free-delete.ll:1.1 *** /dev/null Fri Apr 13 19:19:46 2007 --- llvm/test/Transforms/InstCombine/malloc-free-delete.ll Fri Apr 13 19:19:36 2007 *** *** 0 --- 1,12 + ; RUN: llvm-as %s | opt -instcombine | llvm-dis | grep 'ret i32 0' + ; RUN: llvm-as %s | opt -instcombine | llvm-dis | not grep malloc + ; PR1201 + define i32 @main(i32 %argc, i8** %argv) { + %c_19 = alloca i8* ; i8** [#uses=2] + %malloc_206 = malloc i8, i32 10 ; i8* [#uses=1] + store i8* %malloc_206, i8** %c_19 + %tmp_207 = load i8** %c_19 ; i8* [#uses=1] + free i8* %tmp_207 + ret i32 0 + } + ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/Scalar/InstructionCombining.cpp
Changes in directory llvm/lib/Transforms/Scalar: InstructionCombining.cpp updated: 1.742 - 1.743 --- Log message: Implement PR1201: http://llvm.org/PR1201 and test/Transforms/InstCombine/malloc-free-delete.ll --- Diffs of the changes: (+23 -8) InstructionCombining.cpp | 31 +++ 1 files changed, 23 insertions(+), 8 deletions(-) Index: llvm/lib/Transforms/Scalar/InstructionCombining.cpp diff -u llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.742 llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.743 --- llvm/lib/Transforms/Scalar/InstructionCombining.cpp:1.742 Wed Apr 11 01:57:46 2007 +++ llvm/lib/Transforms/Scalar/InstructionCombining.cpp Fri Apr 13 19:20:02 2007 @@ -8367,13 +8367,6 @@ Instruction *InstCombiner::visitFreeInst(FreeInst FI) { Value *Op = FI.getOperand(0); - // Change free ty* (cast ty2* X to ty*) into free ty2* X - if (CastInst *CI = dyn_castCastInst(Op)) -if (isaPointerType(CI-getOperand(0)-getType())) { - FI.setOperand(0, CI-getOperand(0)); - return FI; -} - // free undef - unreachable. if (isaUndefValue(Op)) { // Insert a new store to null because we cannot modify the CFG here. @@ -8381,11 +8374,33 @@ UndefValue::get(PointerType::get(Type::Int1Ty)), FI); return EraseInstFromFunction(FI); } - + // If we have 'free null' delete the instruction. This can happen in stl code // when lots of inlining happens. if (isaConstantPointerNull(Op)) return EraseInstFromFunction(FI); + + // Change free ty* (cast ty2* X to ty*) into free ty2* X + if (BitCastInst *CI = dyn_castBitCastInst(Op)) { +FI.setOperand(0, CI-getOperand(0)); +return FI; + } + + // Change free (gep X, 0,0,0,0) into free(X) + if (GetElementPtrInst *GEPI = dyn_castGetElementPtrInst(Op)) { +if (GEPI-hasAllZeroIndices()) { + AddToWorkList(GEPI); + FI.setOperand(0, GEPI-getOperand(0)); + return FI; +} + } + + // Change free(malloc) into nothing, if the malloc has a single use. + if (MallocInst *MI = dyn_castMallocInst(Op)) +if (MI-hasOneUse()) { + EraseInstFromFunction(FI); + return EraseInstFromFunction(*MI); +} return 0; } ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/Name.html
Changes in directory llvm-www: Name.html updated: 1.11 - 1.12 --- Log message: Add some submission rules. --- Diffs of the changes: (+8 -1) Name.html |9 - 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm-www/Name.html diff -u llvm-www/Name.html:1.11 llvm-www/Name.html:1.12 --- llvm-www/Name.html:1.11 Fri Apr 13 17:42:50 2007 +++ llvm-www/Name.html Fri Apr 13 19:34:54 2007 @@ -120,6 +120,13 @@ as you think of names. Can a logo be developed? If you have graphical talents, please send a JPEG/GIF to go with your name idea./li /ul + pSome submissions rules:/p + ul +liIf you have commit access, please just commit your idea to this file +directly./li +liIf you don't have commit access, please submit a patch against this file +and send it to llvm-commits mailing list. It will get committed./li + /ul /div div class=www_subsectiona name=namesCandidate Names/a/div @@ -250,6 +257,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 22:42:50 $ +br/Last modified: $Date: 2007/04/14 00:34:54 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/IPO/ConstantMerge.cpp
Changes in directory llvm/lib/Transforms/IPO: ConstantMerge.cpp updated: 1.35 - 1.36 --- Log message: in addition to merging, constantmerge should also delete trivially dead globals, in order to clean up after simplifylibcalls. --- Diffs of the changes: (+8 -1) ConstantMerge.cpp |9 - 1 files changed, 8 insertions(+), 1 deletion(-) Index: llvm/lib/Transforms/IPO/ConstantMerge.cpp diff -u llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.35 llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.36 --- llvm/lib/Transforms/IPO/ConstantMerge.cpp:1.35 Mon Feb 5 17:32:05 2007 +++ llvm/lib/Transforms/IPO/ConstantMerge.cpp Fri Apr 13 20:11:54 2007 @@ -61,7 +61,13 @@ // invalidating the Constant* pointers in CMap. // for (Module::global_iterator GV = M.global_begin(), E = M.global_end(); - GV != E; ++GV) + GV != E; ++GV) { + // If this GV is dead, remove it. + GV-removeDeadConstantUsers(); + if (GV-use_empty() GV-hasInternalLinkage()) { +(GV++)-eraseFromParent(); + } + // Only process constants with initializers. if (GV-isConstant() GV-hasInitializer()) { Constant *Init = GV-getInitializer(); @@ -80,6 +86,7 @@ Slot = GV; } } +} if (Replacements.empty()) return MadeChange; ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp
Changes in directory llvm/lib/Transforms/IPO: SimplifyLibCalls.cpp updated: 1.110 - 1.111 --- Log message: Implement a few missing xforms: printf(foo\n) - puts. printf(x) - putchar printf() - noop. Still need to do the xforms for fprintf. This implements Transforms/SimplifyLibCalls/Printf.ll --- Diffs of the changes: (+48 -9) SimplifyLibCalls.cpp | 57 ++- 1 files changed, 48 insertions(+), 9 deletions(-) Index: llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp diff -u llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.110 llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.111 --- llvm/lib/Transforms/IPO/SimplifyLibCalls.cpp:1.110 Sun Apr 8 13:11:26 2007 +++ llvm/lib/Transforms/IPO/SimplifyLibCalls.cppFri Apr 13 20:17:48 2007 @@ -1154,22 +1154,61 @@ /// @brief Make sure that the printf function has the right prototype virtual bool ValidateCalledFunction(const Function *F, SimplifyLibCalls SLC){ -// Just make sure this has at least 1 arguments -return F-arg_size() = 1; +// Just make sure this has at least 1 argument and returns an integer or +// void type. +const FunctionType *FT = F-getFunctionType(); +return FT-getNumParams() = 1 + (isaIntegerType(FT-getReturnType()) || + FT-getReturnType() == Type::VoidTy); } /// @brief Perform the printf optimization. virtual bool OptimizeCall(CallInst *CI, SimplifyLibCalls SLC) { -// If the call has more than 2 operands, we can't optimize it -if (CI-getNumOperands() != 3) - return false; - // All the optimizations depend on the length of the first argument and the // fact that it is a constant string array. Check that now std::string FormatStr; if (!GetConstantStringInfo(CI-getOperand(1), FormatStr)) return false; + +// If this is a simple constant string with no format specifiers that ends +// with a \n, turn it into a puts call. +if (FormatStr.empty()) { + // Tolerate printf's declared void. + if (CI-use_empty()) return ReplaceCallWith(CI, 0); + return ReplaceCallWith(CI, ConstantInt::get(CI-getType(), 0)); +} + +if (FormatStr.size() == 1) { + // Turn this into a putchar call, even if it is a %. + Value *V = ConstantInt::get(Type::Int32Ty, FormatStr[0]); + new CallInst(SLC.get_putchar(), V, , CI); + if (CI-use_empty()) return ReplaceCallWith(CI, 0); + return ReplaceCallWith(CI, ConstantInt::get(CI-getType(), 1)); +} +// Check to see if the format str is something like foo\n, in which case +// we convert it to a puts call. We don't allow it to contain any format +// characters. +if (FormatStr[FormatStr.size()-1] == '\n' +FormatStr.find('%') == std::string::npos) { + // Create a string literal with no \n on it. We expect the constant merge + // pass to be run after this pass, to merge duplicate strings. + FormatStr.erase(FormatStr.end()-1); + Constant *Init = ConstantArray::get(FormatStr, true); + Constant *GV = new GlobalVariable(Init-getType(), true, +GlobalVariable::InternalLinkage, +Init, str, + CI-getParent()-getParent()-getParent()); + // Cast GV to be a pointer to char. + GV = ConstantExpr::getBitCast(GV, PointerType::get(Type::Int8Ty)); + new CallInst(SLC.get_puts(), GV, , CI); + + if (CI-use_empty()) return ReplaceCallWith(CI, 0); + return ReplaceCallWith(CI, + ConstantInt::get(CI-getType(), FormatStr.size())); +} + + // Only support %c or %s\n for now. if (FormatStr.size() 2 || FormatStr[0] != '%') return false; @@ -1178,7 +1217,7 @@ switch (FormatStr[1]) { default: return false; case 's': - if (FormatStr != %s\n || + if (FormatStr != %s\n || CI-getNumOperands() 3 || // TODO: could insert strlen call to compute string length. !CI-use_empty()) return false; @@ -1189,7 +1228,7 @@ return ReplaceCallWith(CI, 0); case 'c': { // printf(%c,c) - putchar(c) - if (FormatStr.size() != 2) + if (FormatStr.size() != 2 || CI-getNumOperands() 3) return false; Value *V = CI-getOperand(2); @@ -1917,7 +1956,7 @@ // * pow(pow(x,y),z)- pow(x,y*z) // // puts: -// * puts() - fputc(\n,stdout) (how do we get stdout?) +// * puts() - putchar(\n) // // round, roundf, roundl: // * round(cnst) - cnst' ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/test/Transforms/SimplifyLibCalls/Printf.ll
Changes in directory llvm/test/Transforms/SimplifyLibCalls: Printf.ll added (r1.1) --- Log message: new testcase --- Diffs of the changes: (+20 -0) Printf.ll | 20 1 files changed, 20 insertions(+) Index: llvm/test/Transforms/SimplifyLibCalls/Printf.ll diff -c /dev/null llvm/test/Transforms/SimplifyLibCalls/Printf.ll:1.1 *** /dev/null Fri Apr 13 20:17:48 2007 --- llvm/test/Transforms/SimplifyLibCalls/Printf.ll Fri Apr 13 20:17:38 2007 *** *** 0 --- 1,20 + ; RUN: llvm-as %s | opt -simplify-libcalls | llvm-dis | grep putchar + ; RUN: llvm-as %s | opt -simplify-libcalls | llvm-dis | not grep 'call.*printf' + + @str = internal constant [13 x i8] chello world\0A\00 ; [13 x i8]* [#uses=1] + @str1 = internal constant [2 x i8] ch\00 ; [2 x i8]* [#uses=1] + + define void @foo() { + entry: + %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([13 x i8]* @str, i32 0, i32 0) ) ; i32 [#uses=0] + ret void + } + + declare i32 @printf(i8*, ...) + + define void @bar() { + entry: + %tmp1 = tail call i32 (i8*, ...)* @printf( i8* getelementptr ([2 x i8]* @str1, i32 0, i32 0) ) ; i32 [#uses=0] + ret void + } + ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Changes in directory llvm/lib/CodeGen/SelectionDAG: SelectionDAGISel.cpp updated: 1.418 - 1.419 --- Log message: disable shift/and lowering to work around PR1325: http://llvm.org/PR1325 for now. --- Diffs of the changes: (+3 -1) SelectionDAGISel.cpp |4 +++- 1 files changed, 3 insertions(+), 1 deletion(-) Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.418 llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.419 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp:1.418Fri Apr 13 01:53:51 2007 +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Fri Apr 13 21:26:56 2007 @@ -1677,7 +1677,9 @@ bool SelectionDAGLowering::handleBitTestsSwitchCase(CaseRec CR, CaseRecVector WorkList, Value* SV, -MachineBasicBlock* Default) { +MachineBasicBlock* Default){ + return false; // DISABLED FOR NOW: PR1325. + unsigned IntPtrBits = getSizeInBits(TLI.getPointerTy()); Case FrontCase = *CR.Range.first; ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
[llvm-commits] CVS: llvm-www/DevMtgMay2007.html
Changes in directory llvm-www: DevMtgMay2007.html updated: 1.108 - 1.109 --- Log message: Add Gabe McArthur. --- Diffs of the changes: (+3 -2) DevMtgMay2007.html |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) Index: llvm-www/DevMtgMay2007.html diff -u llvm-www/DevMtgMay2007.html:1.108 llvm-www/DevMtgMay2007.html:1.109 --- llvm-www/DevMtgMay2007.html:1.108 Fri Apr 13 17:13:27 2007 +++ llvm-www/DevMtgMay2007.html Fri Apr 13 22:59:36 2007 @@ -320,6 +320,7 @@ trtdSteve Naroff/tdtdApple Inc./td/tr trtdDevang Patel/tdtdApple Inc./td/tr trtdFernando Magno Quintao Pereira/tdtdUCLA/td/tr +trtdGabe McArthur/tdtdIndependent/td/tr trtdJeff Poznanovic/tdtdCray Inc./td/tr trtdRon Price/tdtdApple Inc./td/tr trtdChuck Rose/tdtdAdobe Systems Incorporated./td/tr @@ -334,7 +335,7 @@ /td /tr /table - pbTotal confirmed: 35/b/p + pbTotal confirmed: 36/b/p table class=www trth colspan=2Unconfirmed Attendees/th/tr trthName/ththOrganization/th/tr @@ -353,6 +354,6 @@ src=http://jigsaw.w3.org/css-validator/images/vcss; alt=Valid CSS!/a a href=http://validator.w3.org/check/referer;img src=http://www.w3.org/Icons/valid-html401; alt=Valid HTML 4.01!/a -br/Last modified: $Date: 2007/04/13 22:13:27 $ +br/Last modified: $Date: 2007/04/14 03:59:36 $ /address !--#include virtual=footer.incl -- ___ llvm-commits mailing list [EMAIL PROTECTED] http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits