summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
Commit message (Collapse)AuthorAgeFilesLines
* Fix some comment typos.Bob Wilson2010-02-031-3/+3
| | | | llvm-svn: 95170
* Recommit this, looks like it wasn't the cause.Eric Christopher2010-02-032-70/+100
| | | | llvm-svn: 95165
* Hopefully temporarily revert this.Eric Christopher2010-02-022-100/+70
| | | | llvm-svn: 95154
* Reformat my last patch slightly.Eric Christopher2010-02-021-4/+4
| | | | llvm-svn: 95147
* Re-add strcmp and known size object size checking optimization.Eric Christopher2010-02-022-12/+41
| | | | | | Passed bootstrap and nightly test run here. llvm-svn: 95145
* don't turn (A & (C0?-1:0)) | (B & ~(C0?-1:0)) -> C0 ? A : BChris Lattner2010-02-021-9/+13
| | | | | | | for vectors. Codegen is generating awful code or segfaulting in various cases (e.g. PR6204). llvm-svn: 95058
* fix a crash in loop unswitch on a loop invariant vector condition.Chris Lattner2010-02-021-1/+5
| | | | llvm-svn: 95055
* LangRef.html says that inttoptr and ptrtoint always use zero-extensionDan Gohman2010-02-021-21/+32
| | | | | | when the cast is extending. llvm-svn: 95046
* Don't need to check the last argument since it'll always be bool. We alsoEric Christopher2010-02-021-5/+1
| | | | | | don't use TargetData here. llvm-svn: 95040
* More indentation/tabification fixes.Eric Christopher2010-02-021-13/+13
| | | | llvm-svn: 95036
* Untabify previous commit.Eric Christopher2010-02-021-3/+3
| | | | llvm-svn: 95035
* Formatting.Eric Christopher2010-02-011-3/+3
| | | | llvm-svn: 95027
* Add an option to GVN to remove all partially redundant loads. This is currentlyBob Wilson2010-02-011-80/+107
| | | | | | | | | disabled by default. This divides the existing load PRE code into 2 phases: first it checks that it is safe to move the load to each of the predecessors where it is unavailable, and then if it is safe, the code is changed to move the load. Radar 7571861. llvm-svn: 95007
* cleanups.Chris Lattner2010-02-011-4/+4
| | | | llvm-svn: 94995
* fix rdar://7590304, a miscompilation of objc apps on arm. The callerChris Lattner2010-02-011-3/+7
| | | | | | | | | of objc message send was getting marked arm_apcscc, but the prototype isn't. This is fine at runtime because objcmsgsend is implemented in assembly. Only turn a mismatched caller and callee into 'unreachable' if the callee is a definition. llvm-svn: 94986
* fix rdar://7590304, an infinite loop in instcombine. In the invokeChris Lattner2010-02-011-1/+6
| | | | | | | | | | | | | case, instcombine can't zap the invoke for fear of changing the CFG. However, we have to do something to prevent the next iteration of instcombine from inserting another store -> undef before the invoke thereby getting into infinite iteration between dead store elim and store insertion. Just zap the callee to null, which will prevent the next iteration from doing anything. llvm-svn: 94985
* Fix pr6198 by moving the isSized() check to an outer conditional.Bob Wilson2010-02-011-6/+8
| | | | | | | The testcase from pr6198 does not crash for me -- I don't know what's up with that -- so I'm not adding it to the tests. llvm-svn: 94984
* Simplify/generalize the xor+add->sign-extend instcombine.Eli Friedman2010-01-311-35/+19
| | | | llvm-svn: 94943
* Add a small transform: transform -(X<<Y) to (-X<<Y) when the shift has a singleEli Friedman2010-01-311-0/+7
| | | | | | use and X is free to negate. llvm-svn: 94941
* Do not mark no-return calls tail calls. It'll screw up special calls like ↵Evan Cheng2010-01-311-4/+5
| | | | | | longjmp and it doesn't make much sense for performance reason. If my logic is faulty, please let me know. llvm-svn: 94937
* Check alignment of loads when deciding whether it is safe to execute themBob Wilson2010-01-304-15/+25
| | | | | | | unconditionally. Besides checking the offset, also check that the underlying object is aligned as much as the load itself. llvm-svn: 94875
* Use more specific types to avoid casts. No functionality change.Bob Wilson2010-01-301-6/+6
| | | | llvm-svn: 94863
* Keep iterating over all uses when meeting a phi node in ↵Jakob Stoklund Olesen2010-01-291-2/+2
| | | | | | | | | | | AllUsesOfValueWillTrapIfNull(). This bug was exposed by my inliner cost changes in r94615, and caused failures of lencod on most architectures when building with LTO. This patch fixes lencod and 464.h264ref on x86-64 (and likely others). llvm-svn: 94858
* Preserve load alignment in instcombine transformations. I've been unable toBob Wilson2010-01-291-0/+3
| | | | | | | | | | create a testcase where this matters. The select+load transformation only occurs when isSafeToLoadUnconditionally is true, and in those situations, instcombine also changes the underlying objects to be aligned. This seems like a good idea regardless, and I've verified that it doesn't pessimize the subsequent realignment. llvm-svn: 94850
* Revert my last couple of patches. They appear to have broken bison.Eric Christopher2010-01-292-43/+15
| | | | llvm-svn: 94841
* Use uint64_t instead of unsigned for offsets and sizes.Bob Wilson2010-01-291-3/+3
| | | | llvm-svn: 94835
* Improve isSafeToLoadUnconditionally to recognize that GEPs with constantBob Wilson2010-01-293-11/+65
| | | | | | | indices are safe if the result is known to be within the bounds of the underlying object. llvm-svn: 94829
* Having RHSKnownZero and RHSKnownOne be alternative names for KnownZero and ↵Duncan Sands2010-01-291-75/+69
| | | | | | | | | | | KnownOne (via APInt &RHSKnownZero = KnownZero, etc) seems dangerous and confusing to me: it is easy not to notice this, and then wonder why KnownZero/RHSKnownZero changed underneath you when you modified RHSKnownZero/KnownZero etc. So get rid of this. No intended functionality change (tested with "make check" + llvm-gcc bootstrap). llvm-svn: 94802
* Make strcpy_chk lower to strcpy if we have a safe size.Eric Christopher2010-01-291-5/+7
| | | | llvm-svn: 94783
* Add constant support to object size handling and remove defaultEric Christopher2010-01-291-10/+36
| | | | | | | | | lowering. We'll either figure it out, or not and be lowered by SelectionDAGBuild. Add test. llvm-svn: 94775
* Generic reformatting and comment fixing. No functionality change.Bill Wendling2010-01-291-19/+20
| | | | llvm-svn: 94771
* Add newline to debugging output, and fix some grammar-os in comment.Bill Wendling2010-01-291-5/+5
| | | | llvm-svn: 94765
* mem2reg erases the dbg.declare intrinsics that it converts to dbg.val intrinsicsVictor Hernandez2010-01-291-3/+13
| | | | llvm-svn: 94763
* Fix PR6165. The bug was that LHSKnownZero was being and'd with DemandedMaskDuncan Sands2010-01-281-2/+11
| | | | | | | when it should have been and'd with LowBits. Fix that and while there beef up the logic in the case of a negative LHS. llvm-svn: 94745
* Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.Bob Wilson2010-01-271-41/+75
| | | | | | | This was already being done in SSAUpdater::GetValueAtEndOfBlock so I've just changed SSAUpdater to check for existing PHIs in both places. llvm-svn: 94690
* Kill ModuleProvider and ghost linkage by inverting the relationship betweenJeffrey Yasskin2010-01-271-1/+0
| | | | | | | | | | | | | | | | | | | | | Modules and ModuleProviders. Because the "ModuleProvider" simply materializes GlobalValues now, and doesn't provide modules, it's renamed to "GVMaterializer". Code that used to need a ModuleProvider to materialize Functions can now materialize the Functions directly. Functions no longer use a magic linkage to record that they're materializable; they simply ask the GVMaterializer. Because the C ABI must never change, we can't remove LLVMModuleProviderRef or the functions that refer to it. Instead, because Module now exposes the same functionality ModuleProvider used to, we store a Module* in any LLVMModuleProviderRef and translate in the wrapper methods. The bindings to other languages still use the ModuleProvider concept. It would probably be worth some time to update them to follow the C++ more closely, but I don't intend to do it. Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735. llvm-svn: 94686
* Don't bother with sprintf, just pass the Twine through.Benjamin Kramer2010-01-272-6/+2
| | | | llvm-svn: 94684
* Use the less expensive getName function instead of getNameStr.Benjamin Kramer2010-01-271-5/+4
| | | | llvm-svn: 94683
* some cleanups.Chris Lattner2010-01-271-14/+15
| | | | llvm-svn: 94649
* no need to check for nullChris Lattner2010-01-271-1/+1
| | | | llvm-svn: 94648
* When converting dbg.declare to dbg.value, attach promoted store's debug ↵Victor Hernandez2010-01-271-1/+4
| | | | | | metadata to dbg.value llvm-svn: 94634
* Avoid extra calls to MD->getNumOperands()Victor Hernandez2010-01-261-1/+1
| | | | llvm-svn: 94618
* Switch AllocaDbgDeclares to SmallVector and don't leak DIFactoryVictor Hernandez2010-01-261-1/+4
| | | | llvm-svn: 94567
* In mem2reg, for all alloca/stores that get promoted where the alloca has an ↵Victor Hernandez2010-01-261-1/+52
| | | | | | associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store. llvm-svn: 94493
* Remove check for an impossible condition: the condition of the while loop hasBob Wilson2010-01-251-2/+0
| | | | | | already checked that TmpBB->getSinglePredecessor() is non-null. llvm-svn: 94451
* Change Value::getUnderlyingObject to have the MaxLookup value specified as aBob Wilson2010-01-251-3/+3
| | | | | | | | | | | | parameter with a default value, instead of just hardcoding it in the implementation. The limit of MaxLookup = 6 was introduced in r69151 to fix a performance problem with O(n^2) behavior in instcombine, but the scalarrepl pass is relying on getUnderlyingObject to go all the way back to an AllocaInst. Making the limit part of the method signature makes it clear that by default the result is limited and should help avoid similar problems in the future. This fixes pr6126. llvm-svn: 94433
* Revert r94260 until findDbgDeclare() is made more efficientVictor Hernandez2010-01-251-38/+3
| | | | llvm-svn: 94432
* make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.Chris Lattner2010-01-246-6/+0
| | | | llvm-svn: 94378
* change the canonical form of "cond ? -1 : 0" to be Chris Lattner2010-01-243-60/+44
| | | | | | | | "sext cond" instead of a select. This simplifies some instcombine code, matches the policy for zext (cond ? 1 : 0 -> zext), and allows us to generate better code for a testcase on ppc. llvm-svn: 94339
* fix a potential overflow issue Eli pointed out.Chris Lattner2010-01-231-3/+3
| | | | llvm-svn: 94336
OpenPOWER on IntegriCloud