summaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
Commit message (Collapse)AuthorAge
...
* Emit a more efficient magic number multiplication for exact sdivs.Benjamin Kramer2011-07-08
| | | | | | | | | | | | | | | | | | | | | | | | We have to do this in DAGBuilder instead of DAGCombiner, because the exact bit is lost after building. struct foo { char x[24]; }; long bar(struct foo *a, struct foo *b) { return a-b; } is now compiled into movl 4(%esp), %eax subl 8(%esp), %eax sarl $3, %eax imull $-1431655765, %eax, %eax instead of movl 4(%esp), %eax subl 8(%esp), %eax movl $715827883, %ecx imull %ecx movl %edx, %eax shrl $31, %eax sarl $2, %edx addl %eax, %edx movl %edx, %eax git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134695 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce MachineBranchProbabilityInfo class, which has similar API toJakub Staszak2011-06-16
| | | | | | | | | BranchProbabilityInfo (expect setEdgeWeight which is not available here). Branch Weights are kept in MachineBasicBlocks. To turn off this analysis set -use-mbpi=false. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133184 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve debug info during iSel by keeping DanglingDebugInfoMap live until ↵Devang Patel2011-05-23
| | | | | | | | | end of function. Patch by Micah Villmow git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131908 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unused STL header includes.Jay Foad2011-04-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
* Turn SelectionDAGBuilder::GetRegistersForValue into a local function.Benjamin Kramer2011-03-26
| | | | | | | | It couldn't be used outside of the file because SDISelAsmOperandInfo is local to SelectionDAGBuilder.cpp. Making it a static function avoids a weird linkage dance. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128342 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r124611 - "Keep track of incoming argument's location while emitting ↵Devang Patel2011-02-21
| | | | | | | | | | | | | LiveIns." In other words, do not keep track of argument's location. The debugger (gdb) is not prepared to see line table entries for arguments. For the debugger, "second" line table entry marks beginning of function body. This requires some coordination with debugger to get this working. - The debugger needs to be aware of prolog_end attribute attached with line table entries. - The compiler needs to accurately mark prolog_end in line table entries (at -O0 and at -O1+) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126155 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep track of incoming argument's location while emitting LiveIns.Devang Patel2011-01-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124611 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid zero extend bit test operands to pointer type if all the masks fit inEvan Cheng2011-01-06
| | | | | | | | the original type of the switch statement key. rdar://8781238 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122935 91177308-0d34-0410-b5e6-96231b3b80d8
* When isel is emitting instructions for an x86 target without CMOV, the CFG isJakob Stoklund Olesen2010-09-30
| | | | | | | | | | | | | | | | | edited during emission. If the basic block ends in a switch that gets lowered to a jump table, any phis at the default edge were getting updated wrong. The jump table data structure keeps a pointer to the header blocks that wasn't getting updated after the MBB is split. This bug was exposed on 32-bit Linux when disabling critical edge splitting in codegen prepare. The fix is to uipdate stale MBB pointers whenever a block is split during emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115191 91177308-0d34-0410-b5e6-96231b3b80d8
* Offset is not always unsigned number.Devang Patel2010-08-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112584 91177308-0d34-0410-b5e6-96231b3b80d8
* Trim a #include.Dan Gohman2010-08-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112340 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r112213. It is not needed.Devang Patel2010-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112242 91177308-0d34-0410-b5e6-96231b3b80d8
* Update DanglingDebugInfo so that it can be used to track llvm.dbg.declare also.Devang Patel2010-08-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112213 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment.Devang Patel2010-08-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112086 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead argument.Devang Patel2010-08-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112085 91177308-0d34-0410-b5e6-96231b3b80d8
* The SelectionDAGBuilder's handling of debug info, on rareDale Johannesen2010-07-16
| | | | | | | | | | | | occasions, caused code to be generated in a different order. All cases I've seen involved float softening in the type legalizer, and this could be perhaps be fixed there, but it's better not to generate things differently in the first place. 7797940 (6/29/2010..7/15/2010). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108484 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert. This isn't the correct way to go.Bill Wendling2010-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108478 91177308-0d34-0410-b5e6-96231b3b80d8
* Handle code gen for the unreachable instruction if it's the only instruction inBill Wendling2010-07-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the function. We'll just turn it into a "trap" instruction instead. The problem with not handling this is that it might generate a prologue without the equivalent epilogue to go with it: $ cat t.ll define void @foo() { entry: unreachable } $ llc -o - t.ll -relocation-model=pic -disable-fp-elim -unwind-tables .section __TEXT,__text,regular,pure_instructions .globl _foo .align 4, 0x90 _foo: ## @foo Leh_func_begin0: ## BB#0: ## %entry pushq %rbp Ltmp0: movq %rsp, %rbp Ltmp1: Leh_func_end0: ... The unwind tables then have bad data in them causing all sorts of problems. Fixes <rdar://problem/8096481>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108473 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r106422, splitting the code for materializing a value out ofDan Gohman2010-07-01
| | | | | | | | SelectionDAGBuilder::getValue into a helper function, with fixes to use DenseMaps safely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107371 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r106422, which is breaking the non-fast-isel path.Dan Gohman2010-06-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106423 91177308-0d34-0410-b5e6-96231b3b80d8
* More changes for non-top-down fast-isel.Dan Gohman2010-06-21
| | | | | | | | | | | Split the code for materializing a value out of SelectionDAGBuilder::getValue into a helper function, so that it can be used in other ways. Add a new getNonRegisterValue function which uses it, for use in code which doesn't want a CopyFromReg even when FuncMap.ValueMap already has an entry for it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106422 91177308-0d34-0410-b5e6-96231b3b80d8
* Keep track of incoming debug value of unused argument.Devang Patel2010-06-01
| | | | | | | Radar 7927666. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105285 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pass SDValues by non-const reference unless they may beDan Gohman2010-05-01
| | | | | | | modified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102816 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete the EdgeMapping variable itself.Dan Gohman2010-05-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102810 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not generate duplicate dbg_value instructions for function arguments.Evan Cheng2010-04-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102585 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace r102368 with code that's less fragile. This creates DBG_VALUE ↵Evan Cheng2010-04-28
| | | | | | instructions for function arguments early and insert them after instruction selection is done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102554 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink SelectionDAGBuilder's HandlePHINodesInSuccessorBlocks downDan Gohman2010-04-22
| | | | | | | into SelectionDAGBuilder itself. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102128 91177308-0d34-0410-b5e6-96231b3b80d8
* Move HandlePHINodesInSuccessorBlocks functions out of SelectionDAGISelDan Gohman2010-04-22
| | | | | | | and into SelectionDAGBuilder and FastISel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102123 91177308-0d34-0410-b5e6-96231b3b80d8
* Move PHINodesToUpdate out of SelectionDAGBuilder and intoDan Gohman2010-04-22
| | | | | | | | | | FunctionLoweringInfo, as it isn't SelectionDAG-specific. This isn't completely natural, as PHI node state is not per-function but rather per-basic-block, however there's currently no other convenient per-basic-block state to group it with. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102109 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't send PHI nodes down to SelectionDAGBuilder of FastISel, sinceDan Gohman2010-04-20
| | | | | | | they end up doing nothing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101904 91177308-0d34-0410-b5e6-96231b3b80d8
* Sink DebugLoc handling out of SelectionDAGISel into FastISel andDan Gohman2010-04-20
| | | | | | | SelectionDAGBuilder, where it doesn't have to be as complicated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101848 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the CurMBB member from SelectionDAGBuilder. For places thatDan Gohman2010-04-19
| | | | | | | | need it, just pass around the parent block of the current instruction explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101822 91177308-0d34-0410-b5e6-96231b3b80d8
* Code that needs a TargetMachine should have access to one directly, ratherDan Gohman2010-04-19
| | | | | | | than just getting one through a TargetLowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101802 91177308-0d34-0410-b5e6-96231b3b80d8
* Use const qualifiers with TargetLowering. This eliminates severalDan Gohman2010-04-17
| | | | | | | | | | | | | | const_casts, and it reinforces the design of the Target classes being immutable. SelectionDAGISel::IsLegalToFold is now a static member function, because PIC16 uses it in an unconventional way. There is more room for API cleanup here. And PIC16's AsmPrinter no longer uses TargetLowering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101635 91177308-0d34-0410-b5e6-96231b3b80d8
* Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman2010-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101334 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos in comments.Dan Gohman2010-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101266 91177308-0d34-0410-b5e6-96231b3b80d8
* Delete an obsolete comment.Dan Gohman2010-04-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101264 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the now-redundant MMI pointer in SelectionDAG.Chris Lattner2010-04-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100419 91177308-0d34-0410-b5e6-96231b3b80d8
* stop using DebugLoc::getUnknownLoc()Chris Lattner2010-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100215 91177308-0d34-0410-b5e6-96231b3b80d8
* Assign the ordering of SDNodes in a much less intrusive fashion. After theBill Wendling2010-01-28
| | | | | | | | "visit*" method is called, take the newly created nodes, walk them in a DFS fashion, and if they don't have an ordering set, then give it one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94757 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespace cleanupChris Lattner2010-01-01
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92404 91177308-0d34-0410-b5e6-96231b3b80d8
* move an optimization for memcmp out of simplifylibcalls and into Chris Lattner2009-12-24
| | | | | | | | | | SDISel. This optimization was causing simplifylibcalls to introduce type-unsafe nastiness. This is the first step, I'll be expanding the memcmp optimizations shortly, covering things that we really really wouldn't want simplifylibcalls to do. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92098 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more plumbing. This time in the LowerArguments and "get" functions whichBill Wendling2009-12-22
| | | | | | | | | return partial registers. This affected the back-end lowering code some. Also patch up some places I missed before in the "get" functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91880 91177308-0d34-0410-b5e6-96231b3b80d8
* Changes from review:Bill Wendling2009-12-18
| | | | | | | | | | | | - Move DisableScheduling flag into TargetOption.h - Move SDNodeOrdering into its own header file. Give it a minimal interface that doesn't conflate construction with storage. - Move assigning the ordering into the SelectionDAGBuilder. This isn't used yet, so there should be no functional changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91727 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename SelectionDAGLowering to SelectionDAGBuilder, and renameDan Gohman2009-11-23
SelectionDAGBuild.cpp to SelectionDAGBuilder.cpp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89681 91177308-0d34-0410-b5e6-96231b3b80d8