aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
AgeCommit message (Collapse)Author
2012-09-04[ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute. ThisChad Rosier
implementation does not co-exist well with how the sideeffect and alignstack attributes are handled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163173 91177308-0d34-0410-b5e6-96231b3b80d8
2012-09-04[ms-inline asm] The MCInstrDesc only tracks register definitions. For now,Chad Rosier
assume that if the 1st operands is an expression and the instruction mayStore, then it is a memory definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163144 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28Fix test case for Release builds.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162800 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28[ms-inline asm] Have MSAsmStmts use the generic EmitAsmStmt codegen function.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162796 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28Make test pass in Release builds, which use a different naming scheme for ↵Benjamin Kramer
llvm values. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162771 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28Merge test case for PR13704 into exprs.c to reduce test casesMichael Liao
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162769 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-28Fix PR13704Michael Liao
- The increment needs to be signed value to preserve the original value when its data type is larger than 64-bit integer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162766 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27CodeGen: When emitting stores for an initializer, only emit a GEP if we ↵Benjamin Kramer
really need the store. This avoids emitting many dead GEPs for large zero-initialized arrays. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162701 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-27Support MIPS DSP Rev2 intrinsics.Simon Atanasyan
The patch reviewed by Akira Hatanaka. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162669 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-25-fcatch-undefined-behavior: add the -ftrapv checks to the set of things caughtRichard Smith
by this mode, and also check for signed left shift overflow. The rules for the latter are a little subtle: * neither C89 nor C++98 specify the behavior of a signed left shift at all * in C99 and C11, shifting a 1 bit into the sign bit has undefined behavior * in C++11, with core issue 1457, shifting a 1 bit *out* of the sign bit has undefined behavior As of this change, we use the C99 rules for all C language variants, and the C++11 rules for all C++ language variants. Once we have individual -fcatch-undefined-behavior= flags, this should be revisited. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162634 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-24New -fcatch-undefined-behavior features:Richard Smith
* when checking that a pointer or reference refers to appropriate storage for a type, also check the alignment and perform a null check * check that references are bound to appropriate storage * check that 'this' has appropriate storage in member accesses and member function calls git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162523 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-23Use the alignment from lvalue emission to more accurately compute the alignmentEli Friedman
of a pointer for builtin emission, instead of just depending on the type of the pointee. <rdar://problem/11314941>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162425 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-22[ms-inline asm] Start sending non-simple inline asms to the AsmParser.Chad Rosier
The parser still can't handle all cases, so fall back to emitting a simple MSAsmStmt if we get into trouble. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162382 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-22Make ceil/floor/nearbyint/rint/round const even with -fmath-errno.Benjamin Kramer
The conditions described by POSIX can never happen with IEEE-754 floats. When the function is const we can emit a single sse4.1 instruction for it, without losing anything :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162379 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-22Math builtin definition tweaks.Benjamin Kramer
There were missed optimizations when the system headers didn't have attributes in place, specifically: - Add copysign, exp2, log2, nearbyint, rint and trunc to the list. These are functions that get inlined by LLVM's optimizer, but only when they have the right attributes. - Mark copysign, fabs, fmax, fmin and trunc const unconditionally. Previously these were only const with -fno-math-errno, but they never set errno per POSIX. For ceil/floor/nearbyint/round I'm not aware of any implementation that sets errno, but POSIX says it may signal overflow so I left them alone for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162375 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21[ms-inline asm] Remove this test case and the associated special case code.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162288 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-21When this test case was first created it wasJack Carter
just trying to show it did not crash and burn. This patch checks that the resultant .ll contents are correct. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162249 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-20Fix InitListExpr::isStringLiteralInit so it handles various edge cases ↵Eli Friedman
correctly. PR13643. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162226 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Add a helper function, isMSAsmKeyword().Chad Rosier
These require special handling, which we don't currently handle. This is being put in place to ensure we don't do invalid symbol table lookups or try to parse invalid assembly. The test cases just makes sure the latter isn't happening. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162050 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16Fixup test case for Release builds.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162038 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16[ms-inline asm] Start tracking which tokens are registers and which areChad Rosier
variables, function or label references. The former is a potential clobber. The latter is either an input or an output. Unfortunately, it's difficult to test this patch at the moment, but the added test case will eventually do so. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162026 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16Remove names from the CHECK lines.Tanya Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-16Convert loads and stores of vec3 to vec4 to achieve better code generation. ↵Tanya Lattner
Add test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@162002 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Use a set container to remove redundant clobbers.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161991 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] MSVC parses multiple __asm statements on a single line as oneChad Rosier
statement. For example, if (x) __asm out dx, ax __asm out dx, ax results in a single inline asm statement (i.e., both "out dx, ax" statements are predicated on if(x)). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161986 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15Fix for PR#13606: http://llvm.org/bugs/show_bug.cgi?id=13606John Criswell
Changed the alignment of an LValue to be 64 bits so that we can handle alignment values up to half of a 64-bit address space. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161971 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Add support for clobbers in CodeGen.Chad Rosier
This is a reapplication of r161914 now that the scoping issue has been resolved in r161966. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161967 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15Revert this to try to bring the i386 bots back.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161931 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-15[ms-inline asm] Add support for clobbers in CodeGen.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161914 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14[ms-inline asm] More test cases to make sure buildMSAsmString() doesn't regress.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161908 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14irgen: inline code for several of complex builtinFariborz Jahanian
calls. // rdar://8315199 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161891 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14[ms-inline asm] Add a helpful assert.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161890 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-14Avoid using i64 types for vld1q_lane/vst1q_lane intrinsics.Bob Wilson
The backend has to legalize i64 types by splitting them into two 32-bit pieces, which leads to poor quality code. If we produce code for these intrinsics that uses one-element vector types, which can live in Neon vector registers without getting split up, then the generated code is much better. Radar 11998303. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161879 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-13ARM: enable struct byval for AAPCS-VFP.Manman Ren
rdar://9877866 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161790 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-13[ms-inline asm] Have patchMSAsmStrings() return a vector or AsmStrings.Chad Rosier
The AsmParser expects a single asm instruction, but valid ms-style inline asm statements may contain multiple instructions. This happens with asm blocks __asm { mov ebx, eax mov ecx, ebx } or when multiple asm statements are adjacent to one another __asm mov ebx, eax __asm mov ecx, ebx and __asm mov ebx, eax __asm mov ecx, ebx Currently, asm blocks are not properly handled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161780 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10ARM: enable struct byval for AAPCS.Manman Ren
rdar://9877866 PR://13350 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161694 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10[ms-inline asm] Use the new Inline Asm Non-Standard Dialect attribute.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161642 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-09Fix AAPCS ABI. I can't actually test this, but it restores the behavior ↵Eli Friedman
from before r159168. PR13562. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161554 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-08[ms-inline asm] Add basic codegen support for simple asm stmts. Currently,Chad Rosier
only machine specific clobbers are modeled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161524 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-08[ms-inline asm] Add a very simple test case. Basically, we're only testing forChad Rosier
crashers at the moment (and coincidentally this case was causing a crash). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161520 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-06Fix MIPS DSP Rev1 intrinsics memory properties.Simon Atanasyan
The patch reviewed by Akira Hatanaka. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161333 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-06Re-enable pcmpistri/pcmpestri builtins in clang now that llvm supports them ↵Craig Topper
properly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161319 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-05Add __builtin_readcyclecounter() to produce the @llvm.readcyclecounter() ↵Hal Finkel
intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161310 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-02add a comment to explain this test caseNuno Lopes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161172 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-01add test for PR13497Nuno Lopes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161119 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-31Handle functions with struct arguments or return types and the regparmRafael Espindola
attribute. It is a variation of the x86_64 ABI: * A struct returned indirectly uses the first register argument to pass the pointer. * Floats, Doubles and structs containing only one of them are not passed in registers. * Other structs are split into registers if they fit on the remaining ones. Otherwise they are passed in memory. * When a struct doesn't fit it still consumes the registers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161022 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-24Don't use a temporary file.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160686 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-20Add "long double" to permitted list of ARM complex homogeneous aggregates.Tim Northover
Under AAPCS, long double is the same as double, which means it should be allowed as part of a homogeneous aggregate. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160586 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17Robustify test in the face of no assertions.Eric Christopher
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160399 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-17Fix regexp for this test to properly check.Eric Christopher
Patch by Eli Bendersky. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160385 91177308-0d34-0410-b5e6-96231b3b80d8