- Sep 26, 2012
-
-
Michael Liao authored
- Instead of embedding 'lock' into each mnemonic of atomic instructions except 'xchg', we teach X86 assembly printer to output 'lock' prefix similar to or consistent with code emitter. llvm-svn: 164659
-
- Sep 22, 2012
-
-
Michael Liao authored
llvm-svn: 164453
-
Michael Liao authored
llvm-svn: 164452
-
- Sep 21, 2012
-
-
Michael Liao authored
llvm-svn: 164372
-
Michael Liao authored
- Rewirte most atomic instructions in templates for both better maintenance and future extensions, such as HLE in TSX. llvm-svn: 164357
-
- Sep 20, 2012
-
-
Michael Liao authored
- Rewrite/merge pseudo-atomic instruction emitters to address the following issue: * Reduce one unnecessary load in spin-loop previously the spin-loop looks like thisMBB: newMBB: ld t1 = [bitinstr.addr] op t2 = t1, [bitinstr.val] not t3 = t2 (if Invert) mov EAX = t1 lcs dest = [bitinstr.addr], t3 [EAX is implicit] bz newMBB fallthrough -->nextMBB the 'ld' at the beginning of newMBB should be lift out of the loop as lcs (or CMPXCHG on x86) will load the current memory value into EAX. This loop is refined as: thisMBB: EAX = LOAD [MI.addr] mainMBB: t1 = OP [MI.val], EAX LCMPXCHG [MI.addr], t1, [EAX is implicitly used & defined] JNE mainMBB sinkMBB: * Remove immopc as, so far, all pseudo-atomic instructions has all-register form only, there is no immedidate operand. * Remove unnecessary attributes/modifiers in pseudo-atomic instruction td * Fix issues in PR13458 - Add comprehensive tests on atomic ops on various data types. NOTE: Some of them are turned off due to missing functionality. - Revise tests due to the new spin-loop generated. llvm-svn: 164281
-
- Sep 13, 2012
-
-
Jakob Stoklund Olesen authored
Add a PatFrag to match X86tcret using 6 fixed registers or less. This avoids folding loads into TCRETURNmi64 using 7 or more volatile registers. <rdar://problem/12282281> llvm-svn: 163819
-
Jakob Stoklund Olesen authored
The patch caused "Wrong topological sorting" assertions. llvm-svn: 163810
-
Jakob Stoklund Olesen authored
We don't have enough GR64_TC registers when calling a varargs function with 6 arguments. Since %al holds the number of vector registers used, only %r11 is available as a scratch register. This means that addressing modes using both base and index registers can't be folded into TCRETURNmi64. <rdar://problem/12282281> llvm-svn: 163761
-
- Jun 01, 2012
-
-
Hans Wennborg authored
This implements codegen support for accesses to thread-local variables using the local-dynamic model, and adds a clean-up pass so that the base address for the TLS block can be re-used between local-dynamic access on an execution path. llvm-svn: 157818
-
- May 09, 2012
-
-
Jakob Stoklund Olesen authored
The getPointerRegClass() hook will return GR32_TC, or whatever is appropriate for the current function. Patch by Yiannis Tsiouris! llvm-svn: 156459
-
- May 07, 2012
-
-
Manman Ren authored
This patch will optimize -(x != 0) on X86 FROM cmpl $0x01,%edi sbbl %eax,%eax notl %eax TO negl %edi sbbl %eax %eax In order to generate negl, I added patterns in Target/X86/X86InstrCompiler.td: def : Pat<(X86sub_flag 0, GR32:$src), (NEG32r GR32:$src)>; rdar: 10961709 llvm-svn: 156312
-
- Apr 04, 2012
-
-
Rafael Espindola authored
This allows us to keep passing reduced masks to SimplifyDemandedBits, but know about all the bits if SimplifyDemandedBits fails. This allows instcombine to simplify cases like the one in the included testcase. llvm-svn: 154011
-
- Mar 29, 2012
-
-
Lang Hames authored
llvm-svn: 153680
-
- Mar 19, 2012
-
-
Preston Gurd authored
X86InstrCompiler.td. It also adds –mcpu-generic to the legalize-shift-64.ll test so the test will pass if run on an Intel Atom CPU, which would otherwise produce an instruction schedule which differs from that which the test expects. llvm-svn: 153033
-
- Feb 24, 2012
-
-
Michael J. Spencer authored
used by the Win32 _ftol2 runtime function. Patch by Joe Groff! llvm-svn: 151382
-
- Feb 16, 2012
-
-
Jakob Stoklund Olesen authored
The different calling conventions and call-preserved registers are represented with regmask operands that are added dynamically. llvm-svn: 150708
-
- Jan 16, 2012
-
-
Eli Friedman authored
llvm-svn: 148240
-
Eli Friedman authored
llvm-svn: 148239
-
- Jan 12, 2012
-
-
Benjamin Kramer authored
X86: Generalize the x << (y & const) optimization to also catch masks with more set bits set than 31 or 63. llvm-svn: 148024
-
- Dec 24, 2011
-
-
Chandler Carruth authored
X86ISelLowering C++ code. Because this is lowered via an xor wrapped around a bsr, we want the dagcombine which runs after isel lowering to have a chance to clean things up. In particular, it is very common to see code which looks like: (sizeof(x)*8 - 1) ^ __builtin_clz(x) Which is trying to compute the most significant bit of 'x'. That's actually the value computed directly by the 'bsr' instruction, but if we match it too late, we'll get completely redundant xor instructions. The more naive code for the above (subtracting rather than using an xor) still isn't handled correctly due to the dagcombine getting confused. Also, while here fix an issue spotted by inspection: we should have been expanding the zero-undef variants to the normal variants when there is an 'lzcnt' instruction. Do so, and test for this. We don't want to generate unnecessary 'bsr' instructions. These two changes fix some regressions in encoding and decoding benchmarks. However, there is still a *lot* to be improve on in this type of code. llvm-svn: 147244
-
- Dec 20, 2011
-
-
Chandler Carruth authored
use the zero-undefined variants of CTTZ and CTLZ. These are just simple patterns for now, there is more to be done to make real world code using these constructs be optimized and codegen'ed properly on X86. The existing tests are spiffed up to check that we no longer generate unnecessary cmov instructions, and that we generate the very important 'xor' to transform bsr which counts the index of the most significant one bit to the number of leading (most significant) zero bits. Also they now check that when the variant with defined zero result is used, the cmov is still produced. llvm-svn: 146974
-
- Oct 26, 2011
-
-
Rafael Espindola authored
Patch by Sanjoy Das. llvm-svn: 143064
-
Rafael Espindola authored
MORESTACK_RET_RESTORE_R10; which are lowered to a RET and a RET followed by a MOV respectively. Having a fake instruction prevents the verifier from seeing a MachineBasicBlock end with a non-terminator (MOV). It also prevents the rather eccentric case of a MachineBasicBlock ending with RET but having successors nevertheless. Patch by Sanjoy Das. llvm-svn: 143062
-
- Sep 13, 2011
-
-
Eli Friedman authored
Fix the assembler strings for a couple of atomic instructions. Doesn't really matter much in practice, but it's a bit cleaner. llvm-svn: 139563
-
- Sep 07, 2011
-
-
Eli Friedman authored
Fix atomic load and store on x86 to pass -verify-machineinstrs (and possibly fix some subtle bugs involving passes which check mayStore()). This isn't exactly ideal, but it is good enough for the moment. llvm-svn: 139245
-
- Sep 03, 2011
-
-
Jakob Stoklund Olesen authored
The explanation about a 0 argument being materialized as xor is no longer valid. Rematerialization will check if EFLAGS is live before clobbering it. The code produced by X86TargetLowering::EmitLoweredSelect does not clobber EFLAGS. This causes one less testb instruction to be generated in the cmov.ll test case. llvm-svn: 139057
-
- Aug 30, 2011
-
-
Rafael Espindola authored
from DYNAMIC_STACKALLOC. Two new pseudo instructions (SEG_ALLOCA_32 and SEG_ALLOCA_64) which will match X86SegAlloca (based on word size) are also added. They will be custom emitted to inject the actual stack handling code. Patch by Sanjoy Das. llvm-svn: 138814
-
- Aug 26, 2011
-
-
Eli Friedman authored
llvm-svn: 138660
-
- Aug 24, 2011
-
-
Eli Friedman authored
llvm-svn: 138478
-
- Aug 10, 2011
-
-
Bruno Cardoso Lopes authored
llvm-svn: 137179
-
-
- Jul 27, 2011
-
-
Eli Friedman authored
X86ISD::MEMBARRIER does not require SSE2; it doesn't actually generate any code, and all x86 processors will honor the required semantics. llvm-svn: 136249
-
- Jun 16, 2011
-
-
Dan Gohman authored
considered safe enough in this context. llvm-svn: 133159
-
- May 21, 2011
-
-
Benjamin Kramer authored
llvm-svn: 131801
-
- May 20, 2011
-
-
Stuart Hastings authored
rdar://problem/8614450 llvm-svn: 131746
-
- May 19, 2011
-
-
Stuart Hastings authored
llvm-svn: 131654
-
Stuart Hastings authored
pseudos. rdar://problem/8614450 llvm-svn: 131641
-
- May 17, 2011
-
-
Eric Christopher authored
Finishes off rdar://8470697 llvm-svn: 131458
-
- May 11, 2011
-
-
Eric Christopher authored
Next up: xor and and. Part of rdar://8470697 llvm-svn: 131171
-