- Oct 13, 2011
-
-
Jakob Stoklund Olesen authored
The inline asm operand constraint is initially encoded in the virtual register for the operand, but that register class may change during coalescing, and the original constraint is lost. Encode the original register class as part of the flag word for each inline asm operand. This makes it possible to recover the actual constraint required by inline asm, just like we can for normal instructions. llvm-svn: 141833
-
- Sep 29, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 140767
-
Jakob Stoklund Olesen authored
The function needs to scan the implicit operands anyway, so no performance is won by caching the number of implicit operands added to an instruction. This also fixes a bug when adding operands after an implicit operand has been added manually. The NumImplicitOps count wasn't kept up to date. MachineInstr::addOperand() will now consistently place all explicit operands before all the implicit operands, regardless of the order they are added. It is possible to change an MI opcode and add additional explicit operands. They will be inserted before any existing implicit operands. The only exception is inline asm instructions where operands are never reordered. This is because of a hack that marks explicit clobber regs on inline asm as <implicit-def> to please the fast register allocator. This hack can go away when InstrEmitter and FastIsel can add exact <dead> flags to physreg defs. llvm-svn: 140744
-
- Aug 30, 2011
-
-
Jim Grosbach authored
llvm-svn: 138773
-
- Aug 24, 2011
-
-
Jim Grosbach authored
llvm-svn: 138437
-
- Aug 19, 2011
-
-
Jakob Stoklund Olesen authored
Normally, a partial register def is treated as reading the super-register unless it also defines the full register like this: %vreg110:sub_32bit<def> = COPY %vreg77:sub_32bit, %vreg110<imp-def> This patch also uses the <undef> flag on partial defs to recognize non-reading operands: %vreg110:sub_32bit<def,undef> = COPY %vreg77:sub_32bit This fixes a subtle bug in RegisterCoalescer where LIS->shrinkToUses would treat a coalesced copy as still reading the register, extending the live range artificially. My test case only works when I disable DCE so a dead copy is left for RegisterCoalescer, so I am not including it. <rdar://problem/9967101> llvm-svn: 138018
-
- Aug 04, 2011
-
-
Devang Patel authored
llvm-svn: 136916
-
- Jul 07, 2011
-
-
Devang Patel authored
If known DebugLocs do not match then two DBG_VALUE machine instructions are not identical. For example, DBG_VALUE 3.310000e+02, 0, !"ds"; dbg:sse.stepfft.c:138:18 @[ sse.stepfft.c:32:10 ] DBG_VALUE 3.310000e+02, 0, !"ds"; dbg:sse.stepfft.c:138:18 @[ sse.stepfft.c:31:10 ] These two MIs represent identical value, 3.31..., for one variable, ds, but they are not identical because the represent two separate instances of inlined variable "ds". llvm-svn: 134620
-
- Jul 02, 2011
-
-
Jakob Stoklund Olesen authored
Add a MI->emitError() method that the backend can use to report errors related to inline assembly. Call it from X86FloatingPoint.cpp when the constraints are wrong. This enables proper clang diagnostics from the backend: $ clang -c pr30848.c pr30848.c:5:12: error: Inline asm output regs must be last on the x87 stack __asm__ ("" : "=u" (d)); /* { dg-error "output regs" } */ ^ 1 error generated. llvm-svn: 134307
-
Cameron Zwarich authored
llvm-svn: 134287
-
- Jun 28, 2011
-
-
Evan Cheng authored
sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. llvm-svn: 134021
-
- Jun 27, 2011
-
-
Jakob Stoklund Olesen authored
Both become <earlyclobber> defs on the INLINEASM MachineInstr, but we now use two different asm operand kinds. The new Kind_Clobber is treated identically to the old Kind_RegDefEarlyClobber for now, but x87 floating point stack inline assembly does care about the difference. This will pop a register off the stack: asm("fstp %st" : : "t"(x) : "st"); While this will pop the input and push an output: asm("fst %st" : "=&t"(r) : "t"(x)); We need to know if ST0 was a clobber or an output operand, and we can't depend on <dead> flags for that. llvm-svn: 133902
-
Jakob Stoklund Olesen authored
The INLINEASM MachineInstrs have an immediate operand describing each original inline asm operand. Decode the bits in MachineInstr::print() so it is easier to read: INLINEASM <es:rorq $1,$0>, $0:[regdef], %vreg0<def>, %vreg1<def>, $1:[imm], 1, $2:[reguse] [tiedto:$0], %vreg2, %vreg3, $3:[regdef-ec], %EFLAGS<earlyclobber,imp-def> llvm-svn: 133901
-
- Jun 24, 2011
-
-
Devang Patel authored
llvm-svn: 133821
-
- May 12, 2011
-
-
Evan Cheng authored
markers. In some cases a register def is dead on one path, but not on another. This is passing Clang self-hosting. llvm-svn: 131214
-
- May 08, 2011
-
-
Jakob Stoklund Olesen authored
It can happen that a live debug variable is the last use of a sub-register, and the register allocator will pick a larger register class for the virtual register. If the allocated register doesn't support the sub-register index, just use %noreg for the debug variables instead of asserting. In PR9872, a debug variable ends up in the sub_8bit_hi part of a GR32_ABCD register. The register is split and one part is inflated to GR32 and assigned %ESI because there are no more normal uses of sub_8bit_hi. Since %ESI doesn't have that sub-register, substPhysReg asserted. Now it will simply insert a %noreg instead, and the debug variable will be marked unavailable in that range. We don't currently have a way of saying: !"value" is in bits 8-15 of %ESI, I don't know if DWARF even supports that. llvm-svn: 131073
-
- Apr 30, 2011
-
-
Bill Wendling authored
llvm-svn: 130562
-
- Apr 05, 2011
-
-
Jakob Stoklund Olesen authored
There can be multiple defs for a single virtual register when they are defining sub-registers. The missing <dead> flag was stopping the inline spiller from eliminating dead code after rematerialization. llvm-svn: 128888
-
- Mar 05, 2011
-
-
Anton Korobeynikov authored
llvm-svn: 127098
-
- Jan 10, 2011
-
-
Jakob Stoklund Olesen authored
These functions not longer assert when passed 0, but simply return false instead. No functional change intended. llvm-svn: 123155
-
- Jan 09, 2011
-
-
Jakob Stoklund Olesen authored
Print virtual registers numbered from 0 instead of the arbitrary FirstVirtualRegister. The first virtual register is printed as %vreg0. TRI::NoRegister is printed as %noreg. llvm-svn: 123107
-
- Jan 08, 2011
-
-
Evan Cheng authored
Instead encode llvm IR level property "HasSideEffects" in an operand (shared with IsAlignStack). Added MachineInstrs::hasUnmodeledSideEffects() to check the operand when the instruction is an INLINEASM. This allows memory instructions to be moved around INLINEASM instructions. llvm-svn: 123044
-
- Jan 07, 2011
-
-
Evan Cheng authored
llvm-svn: 123031
-
- Oct 22, 2010
-
-
Evan Cheng authored
llvm-svn: 117155
-
- Oct 20, 2010
-
-
Dan Gohman authored
llvm-svn: 116890
-
- Oct 19, 2010
-
-
Jakob Stoklund Olesen authored
Pull an unsigned out of the Contents union such that it has the same size as two pointers and no padding. Arrange members such that the Contents union and all pointers can be 8-byte aligned without padding. This speeds up code generation by 0.8% on a 64-bit host. 32-bit hosts should be unaffected. llvm-svn: 116857
-
- Sep 21, 2010
-
-
Chris Lattner authored
llvm-svn: 114463
-
Chris Lattner authored
llvm-svn: 114409
-
Chris Lattner authored
"getFixedStack" on the MachinePointerInfo class. While this isn't the problem I'm setting out to solve, it is the right way to eliminate PseudoSourceValue, so lets go with it. llvm-svn: 114406
-
Chris Lattner authored
llvm-svn: 114400
-
Chris Lattner authored
to the MachineFunction construction methods. llvm-svn: 114390
-
Chris Lattner authored
MachinePointerInfo struct, no functionality change. This also adds an assert to MachineMemOperand::MachineMemOperand that verifies that the Value* is either null or is an IR pointer type. llvm-svn: 114389
-
- Aug 02, 2010
-
-
Oscar Fuentes authored
Fixes potential ambiguity problems on VS 2010. Patch by nobled! llvm-svn: 110029
-
- Jul 28, 2010
-
-
Jakob Stoklund Olesen authored
llvm-svn: 109608
-
- Jul 05, 2010
-
-
Jakob Stoklund Olesen authored
llvm-svn: 107602
-
- Jul 02, 2010
-
-
Dale Johannesen authored
PrologEpilog code, and use it to determine whether the asm forces stack alignment or not. gcc consistently does not do this for GCC-style asms; Apple gcc inconsistently sometimes does it for asm blocks. There is no convenient place to put a bit in either the SDNode or the MachineInstr form, so I've added an extra operand to each; unlovely, but it does allow for expansion for more bits, should we need it. PR 5125. Some existing testcases are affected. The operand lists of the SDNode and MachineInstr forms are indexed with awesome mnemonics, like "2"; I may fix this someday, but not now. I'm not making it any worse. If anyone is inspired I think you can find all the right places from this patch. llvm-svn: 107506
-
- Jun 29, 2010
-
-
Devang Patel authored
llvm-svn: 107208
-
- Jun 19, 2010
-
-
Dan Gohman authored
on calls and similar instructions. llvm-svn: 106353
-
- Jun 03, 2010
-
-
Jakob Stoklund Olesen authored
instruction defines subregisters. Any existing subreg indices on the original instruction are preserved or composed with the new subreg index. Also substitute multiple operands mentioning the original register by using the new MachineInstr::substituteRegister() function. This is necessary because there will soon be <imp-def> operands added to non read-modify-write partial definitions. This instruction: %reg1234:foo = FLAP %reg1234<imp-def> will reMaterialize(%reg3333, bar) like this: %reg3333:bar-foo = FLAP %reg333:bar<imp-def> Finally, replace the TargetRegisterInfo pointer argument with a reference to indicate that it cannot be NULL. llvm-svn: 105358
-
- Jun 02, 2010
-
-
Jakob Stoklund Olesen authored
The comment about ordering of subreg indices is no longer true. This exposed a bug in the new substVirtReg method that is also fixed. llvm-svn: 105294
-