aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen
AgeCommit message (Collapse)Author
2012-10-26This patch addresses a 64-bit PowerPC ELF ABI compatibility issue withBill Schmidt
varargs parameter passing. A strict reading of the ABI indicates that any argument with alignment greater than 8 may require skipping doublewords in the parameter save area to align the argument, and hence require skipping GPRs. In practice, this is not done by GCC. The alignment restriction is used for internal alignment of a structure, but a structure with 16-byte alignment, for example, is not itself 16-byte aligned in the parameter save area. Although this is messy, it has become the de facto standard used in building existing libraries. My initial varargs support followed the ABI language, but not the de facto standard. Running the GCC compatibility test suite exposed this issue, and indeed showed that LLVM didn't pass parameters self-consistently with my original logic. Removing the additional alignment logic allows the affected tests to now pass. I modified the ppc64-varargs-struct.c test case to remove the existing test for generation of alignment code, which is no longer appropriate. Built and tested on powerpc64-unknown-linux-gnu with no new regressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166805 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26[ms-inline asm] Test case for r166790.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166791 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26These tests require an actual x86 registered target, so mark them as such. ↵David Tweed
Tested on ARM. Patch by Joey Gouly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166765 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26Oz optimization level sets ForceSizeOpt attribute for each functionQuentin Colombet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166744 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-26X86 SSE Intrinsics: update header for sqrt_ss, rsqrt_ss and rcp_ss.Manman Ren
There intrinsics pass through the upper FP values from the input. rdar://12558838 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166743 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25Recommit Eric's code to validate ASM string's constraints and modifiers.Bill Wendling
This code checks the ASM string to see if the output size is able to fit within the variable specified as the output. For instance, scalar-to-vector conversions may not really work. It's on by default, but can be turned off with a flag if you think you know what you're doing. This is placed under a flag ('-Wasm-operand-widths') and flag group ('-Wasm'). <rdar://problem/12284092> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166737 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-25[ms-inline asm] Add a test case for r166723 and r166724.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166725 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24[ms-inline asm] Test case for r166632.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166633 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24[ms-inline asm] Add test cases for r166451.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166600 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24[ms-inline asm] Add test cases for r166592. The test cases only works if theChad Rosier
source operand is a register. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166594 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24A number of test cases assume that an "int" parameter or return valueUlrich Weigand
will be represented in the IR as a plain "i32" type. This causes the tests to spuriously fail on platforms where int is not a 32-bit type, or where the ABI requires attributes like "signext" or "zeroext" to be used. This patch adds -triple or -target parameters to force those tests to use the i386-unknown-unknown target. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166551 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Revert r166541, "clang/test: Add appropriate requirements as REQUIRES, ↵NAKAMURA Takumi
corresponding to r166532." According to r166543, it is not needed for now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24clang/test: Add appropriate requirements as REQUIRES, corresponding to r166532.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166541 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Add padding inreg registers to cause llvm to skip ecx when needed withRafael Espindola
the x86_fastcallcc calling convention. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166538 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-24Add inreg markers with the x86_fastcallcc calling convention.Rafael Espindola
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166537 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23[ms-inline asm] Test case for r166526.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166527 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23[ms-inline asm] Update the triple to test r166523.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166524 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-23[ms-inline asm] Update for r166433.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166489 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-22Testcase change for r166440.Eli Friedman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166441 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-22[ms-inline asm] Test case for r166433.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166434 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-21When used in a compound expression FP_CONTRACT should proceed all explicitLang Hames
declarations and statements. Emit an error if the FP_CONTRACT is used later in a compound statement. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166383 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-20[ms-inline asm] Update test case for r166357.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166358 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19[ms-inline asm] Test case for r166349 and r166352.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166353 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19[ms-inline asm] Update testcase for r166316.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166317 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19[ms-inline asm] Revert accidental commit. Sorry for the churn.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166312 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19[ms-inline asm] Set the SemaCallback in the TargetAsmParser.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166310 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19tests: Fix two tests to just use -triple instead of XFAIL+XTARGET.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166304 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-19Prior to adding the new "expected-no-diagnostics" directive to ↵Andy Gibbs
VerifyDiagnosticConsumer, make the necessary adjustment to 580 test-cases which will henceforth require this new directive. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166280 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18Add a new option for and disable column number information as thereEric Christopher
are no known current users of column info. Robustify and fix up a few tests in the process. Reduces the size of debug information by a small amount. Part of PR14106 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166236 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18[ms-inline asm] Remove accidental commit.Chad Rosier
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166193 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-18[ms-inline asm] Move most of the AsmParsing logic in clang back into the MCChad Rosier
layer. Use the new ParseMSInlineAsm() API and add an implementation of the MCAsmParserSemaCallback interface. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166184 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16ARM ABI: fix testing case arm-abi-vector.c by using [[VAR]]Manman Ren
rdar://12439123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166066 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16Add pnaclcall convention to Native Client targets.Derek Schuff
Because PNaCl bitcode must be target-independent, it uses some different bitcode representations from other targets (e.g. byval and sret for structures). This means that without additional type information, it cannot meet some native ABI requirements for some targets (e.g. passing structures containing unions by value on x86-64). To allow generation of code which uses the correct native ABIs, we also support triples such as x86_64-nacl, which uses target-dependent IR (as opposed to le32-nacl, which uses byval and sret). To allow interoperation between the two types of code, this patch adds a calling convention attribute to be used in code compiled with the target-dependent triple, which will generate code using the le32-style bitcode. This calling convention does not need to be explicitly supported in the backend because it determines bitcode representation rather than native conventions (the backend just needs to undersand how to handle byval and sret for the Native Client OS). This patch implements __attribute__((pnaclcall)) to generate calls in bitcode according to the le32 bitcode conventions, an attribute which is accepted by any Native Client target, but issues a warning otherwise. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166065 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16XFAIL this testing case to recover buildbotManman Ren
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166064 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16ARM ABI: fix ABI alignment issues in varargs.Manman Ren
We generalize r166040 to handle ABI alignment issues for all types. rdar://12439123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166052 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16ARM ABI: passing illegal vector types as varargs.Manman Ren
We expand varargs in clang and the call site is handled in the back end, it is hard to match exactly how illegal vectors are handled in the backend. Therefore, we legalize the illegal vector types in clang: if (Size <= 32), legalize to i32. if (Size == 64), legalize to v2i32. if (Size == 128), legalize to v4i32. if (Size > 128), use indirect. rdar://12439123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16ARM ABI: fix ABI alignment issues when passing legal vector types as varargs.Manman Ren
We create an aligned temporary space and copy the content over from ap.cur to the temporary space. This is necessary if the natural alignment of the type is greater than the ABI alignment. rdar://12439123 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166040 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-16When using a symbol with attribute weakref, search for it first andJoerg Sonnenberger
don't try the normal GetOrCreateLLVM. The latter could drop the weak atrtibute on the second reference, if there is no explicit declaration of the aliasee. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166032 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15[ms-inline asm] Rework the front-end to use the API introduced in r165946.Chad Rosier
-The front-end now builds a single assembly string and feeds it to the AsmParser. The front-end iterates on a per statement basis by calling the ParseStatement() function. Please note, the calling of ParseStatement() and and any notion of MCAsmParsedOperands will be sunk into the MC layer in the near future. I plan to expose more basic APIs such as getClobbers, etc. -The enumeration of the AsmString expressions have been reworked to use SMLocs rather than assembly Pieces, which were being parsed in the front-end. -The test case, t8(), was modified due to r129223. I'll have to find a way to work around things such as these. Sorry for the large commit, but breaking this in multiple smaller commits proved too irritating. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165957 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-13"Implement" codegen support for __noop().Nico Weber
Eli discovered that __noop's sema behavior also needs some love. I filed PR14081 for that and intend to improve it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165886 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12-fcatch-undefined-behavior: Trap undefined behavior due to conversions to orRichard Smith
from a floating-point type where the source value is not in the range of representable values of the destination type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165843 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12[ms-inline asm] Remove a bunch of parsing code from the front-end, which will beChad Rosier
reimplemented in the AsmParser where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165825 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12Remove XFAIL,fix testBill Schmidt
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165819 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12XFAIL pending further investigationBill Schmidt
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165818 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-12This patch addresses PR13948.Bill Schmidt
For 64-bit PowerPC SVR4, an aggregate containing only one floating-point field (float, double, or long double) must be passed in a register as though just that field were present. This patch addresses the issue during Clang code generation by specifying in the ABIArgInfo for the argument that the underlying type is passed directly in a register. The included test case verifies flat and nested structs for the three data types. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165816 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11[ms-inline asm] Remove a bunch of parsing code from the front-end, which will beChad Rosier
reimplemented in the AsmParser where it belongs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165752 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11[ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove theChad Rosier
now unused static helper function. The test case needs to be remove temporarily until I can better filter memory operands that aren't actual variable reference. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165751 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11Properly factor Native Client defines to support NaCl as an OSDerek Schuff
with x86/ARM architecture git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165722 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11X86: add F16C support in ClangManman Ren
Support the following intrinsics: _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph rdar://12407875 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165685 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-10Apply the same fundamental fix for PR14048 as was applied for PR11905.Chandler Carruth
The issue arises when coercing to/from types of different sizes. We need to be certain that the allocation on either end has sufficient room for the coerced type. When it doesn't, we need to make room, copy across, and then proceed. PR11905 handled the case of storing function arguments back into allocas in the function prolog, this patch handles the case of setting up the function arguments in a call expression. This is actually significantly simpler than the fix for PR11905. It ends up being a trivial change to create a temporary alloca when the source is too small and memcpy across. This should preserve the compile-time fast-isel benefits of doing gep+load sequences and avoiding FCAs. Reviewed by Benjamin and Evgeniy (who fixed PR11905). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@165615 91177308-0d34-0410-b5e6-96231b3b80d8