summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/ConstantFolding.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix constant folding to deal with external weak global values.Reid Spencer2006-12-061-14/+22
| | | | llvm-svn: 32247
* Can't make these fail now with just BitCast. Previous failures must haveReid Spencer2006-12-051-2/+2
| | | | | | | been in conjunction with something else. By right, they should just be BitCasts. llvm-svn: 32219
* Remove the last inferred casts from VMCore.Reid Spencer2006-12-051-10/+7
| | | | llvm-svn: 32213
* For PR950: Implement a stub for folding ICmp and FCmp instructionsReid Spencer2006-12-041-0/+7
| | | | llvm-svn: 32169
* Change inferred casts to explicit casts.Reid Spencer2006-12-041-12/+23
| | | | llvm-svn: 32165
* These should be rewritten to fold without using the 'Rules' mechanism, butChris Lattner2006-12-011-0/+3
| | | | | | | until this happens at least make sext from bool and sitofp from bool do the right thing. llvm-svn: 32087
* this logic is broken for trunc to bool, replace the folding logic for truncChris Lattner2006-12-011-5/+8
| | | | | | | completely, as it is trivial. We should probably do this for the rest of the cast operations. This fixes ConstProp/2006-12-01-TruncBoolBug.ll. llvm-svn: 32081
* Fix a typo introduced by the cast patch that horribly broke a lot of vectorChris Lattner2006-12-011-1/+1
| | | | | | code. Testcase here: Transforms/ConstProp/2006-11-30-vector-cast.ll llvm-svn: 32062
* Don't fold "ptrtoint GV to bool" since this should be doing a truncate notReid Spencer2006-12-011-7/+27
| | | | | | | a comparison against zero. Instead fold setne(GV,null) and seteq(GV,null) to ConstantBool::True or ConstantBool::False, respectively. llvm-svn: 32060
* Introducing external weak linkage. Darwin codegen should be added later.Anton Korobeynikov2006-12-011-5/+2
| | | | llvm-svn: 32052
* For PR950:Reid Spencer2006-11-271-104/+194
| | | | | | | | | | The long awaited CAST patch. This introduces 12 new instructions into LLVM to replace the cast instruction. Corresponding changes throughout LLVM are provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the exception of 175.vpr which fails only on a slight floating point output difference. llvm-svn: 31931
* Remove redundant <cmath>.Jim Laskey2006-11-081-1/+0
| | | | llvm-svn: 31561
* For PR950:Reid Spencer2006-11-081-29/+33
| | | | | | | | This patch converts the old SHR instruction into two instructions, AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not dependent on the sign of their operands. llvm-svn: 31542
* Remove unused variables.Reid Spencer2006-11-021-6/+5
| | | | llvm-svn: 31375
* For PR950:Reid Spencer2006-11-021-34/+58
| | | | | | Replace the REM instruction with UREM, SREM and FREM. llvm-svn: 31369
* For PR950:Reid Spencer2006-10-261-26/+56
| | | | | | | | Make necessary changes to support DIV -> [SUF]Div. This changes llvm to have three division instructions: signed, unsigned, floating point. The bytecode and assembler are bacwards compatible, however. llvm-svn: 31195
* For PR950:Reid Spencer2006-10-201-139/+170
| | | | | | | | This patch implements the first increment for the Signless Types feature. All changes pertain to removing the ConstantSInt and ConstantUInt classes in favor of just using ConstantInt. llvm-svn: 31063
* Fix another dtor issue. The function local statics in this function wereChris Lattner2006-10-131-32/+42
| | | | | | | being destroyed at inconvenient times. Switch to using non-local ManagedStatic objects, which actually also speeds up ConstRules::get. llvm-svn: 30931
* Eliminate ConstantBool::True and ConstantBool::False. Instead, ↵Chris Lattner2006-09-281-17/+15
| | | | | | provideConstantBool::getTrue() and ConstantBool::getFalse(). llvm-svn: 30664
* Add new SetCondInst::isRelational/isEquality methods. RenameChris Lattner2006-09-171-1/+1
| | | | | | Instruction::isRelational to Instruction::isComparison. llvm-svn: 30444
* s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|Chris Lattner2006-08-271-1/+1
| | | | llvm-svn: 29911
* Use hidden visibility to reduce the sizes of some .o files. This chops 60K ↵Chris Lattner2006-06-281-12/+17
| | | | | | off a release llvm-dis. llvm-svn: 28969
* Add more anonymous namespaces to make it clear that these are private classesChris Lattner2006-06-211-1/+18
| | | | llvm-svn: 28901
* Add shufflevector support, todo, implement better constant folding.Chris Lattner2006-04-081-0/+8
| | | | llvm-svn: 27510
* Constant fold extractelement(zero, x) -> zeroChris Lattner2006-04-071-0/+3
| | | | llvm-svn: 27479
* Constant fold casts from things like <4 x int> -> <4 x uint>, likewise int<->fp.Chris Lattner2006-04-021-0/+108
| | | | llvm-svn: 27336
* constant fold extractelement with undef operands.Chris Lattner2006-03-311-1/+7
| | | | llvm-svn: 27301
* VMCore support for the insertelement operation.Robert Bocchino2006-01-171-0/+57
| | | | llvm-svn: 25408
* Added constant folding support for the extractelement operation.Robert Bocchino2006-01-101-0/+10
| | | | llvm-svn: 25187
* Implement a few symbolic constant folding things. X ? Y : Y is Y.Chris Lattner2006-01-051-7/+32
| | | | | | | | | | | | | Fold: seteq ({ short }* cast (int 1 to { short }*), { short }* null) setlt ({ short }* cast (int 1 to { short }*), { short }* cast (int 2 to { short }*)) to false/true. These last two commonly occur in the output of compilers that tag integers, like cozmic's scheme compiler. Tested by Regression/Assembler/ConstantExprFold.llx llvm-svn: 25112
* fix some formatting problemsChris Lattner2006-01-051-7/+7
| | | | llvm-svn: 25110
* implement constant folding of ==/!= on constant packed, simplify some code.Chris Lattner2006-01-041-3/+11
| | | | llvm-svn: 25074
* implement constant folding for the element-wise binary operationsChris Lattner2006-01-041-0/+50
| | | | llvm-svn: 25073
* don't crash when trying to constant fold packed expressions.Chris Lattner2006-01-041-0/+29
| | | | llvm-svn: 25072
* Use ANSI-approved way of getting the value infinity (otherwise VC++ won't ↵Jeff Cohen2005-05-031-3/+4
| | | | | | compile it) llvm-svn: 21662
* fold fp div by 0 to inf, the way gcc does. This is legal according to the ↵Andrew Lenharth2005-05-021-0/+7
| | | | | | FP spec llvm-svn: 21655
* Shut GCC 4.0 up about classes with virtual functions but no virtualReid Spencer2005-04-241-0/+5
| | | | | | destructor. llvm-svn: 21510
* Remove trailing whitespaceMisha Brukman2005-04-211-40/+40
| | | | llvm-svn: 21427
* Fix a nasty thinko in my previous commit.Chris Lattner2005-01-281-1/+1
| | | | llvm-svn: 19881
* Fix ConstProp/2005-01-28-SetCCGEP.ll: indexing over zero sized elements doesChris Lattner2005-01-281-5/+36
| | | | | | not change the address. llvm-svn: 19874
* No need to pessimize current code for future possibilities.Chris Lattner2005-01-061-4/+3
| | | | llvm-svn: 19311
* Fix test/Regression/CFrontend/2003-11-01-EmptyStructCrash.cChris Lattner2004-11-221-0/+1
| | | | llvm-svn: 18115
* Generalize this code to turn any cast-to-first-element-of into a gep constexprChris Lattner2004-11-171-8/+21
| | | | llvm-svn: 17914
* fold gep undef, ... -> undefChris Lattner2004-10-171-1/+8
| | | | | | This comes up many times in perlbmk and probably others. llvm-svn: 17100
* Fix constant folding relational operators with undef operands.Chris Lattner2004-10-171-7/+4
| | | | llvm-svn: 17077
* Implement constant folding of undef values.Chris Lattner2004-10-161-4/+54
| | | | llvm-svn: 17070
* Allow creation of GEP constantexprs with a vector of value* operands asChris Lattner2004-10-111-15/+16
| | | | | | | well as a vector of constant*'s. It turns out that this is more efficient and all of the clients want to do that, so we should cater to them. llvm-svn: 16923
* If we are trying to create a ConstantExpr cast that is really a GEP to theChris Lattner2004-10-111-0/+11
| | | | | | | | | | | | | first element of an array, return a GEP instead of a cast. This allows us to transparently fold this: int* getelementptr (int* cast ([100 x int]* %Gbody to int*), int 40) into this: int* getelementptr ([100 x int]* %Gbody, int 0, int 40) llvm-svn: 16911
* bug 122:Reid Spencer2004-07-171-23/+20
| | | | | | | | - Replace ConstantPointerRef usage with GlobalValue usage - Minimize redundant isa<GlobalValue> usage - Correct isa<Constant> for GlobalValue subclass llvm-svn: 14927
* Implement folding of expressions like 'uint cast (int* getelementptr (int*Chris Lattner2004-07-151-0/+12
| | | | | | | null, uint 1) to uint)' to a constant integer. We can only do this with primitive LLVM types, because other types have target-specific sizes. llvm-svn: 14837
OpenPOWER on IntegriCloud