aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCall.cpp
AgeCommit message (Collapse)Author
2009-02-14x86_64 ABI: Pass simple types directly when possible. This isDaniel Dunbar
important for both keeping the generated LLVM simple and for ensuring that integer types are passed/promoted correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64529 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13x86_64 ABI: Support va_arg passed in mixed registers.Daniel Dunbar
- Now at 1274 passes on gcc compat suite vs 1262. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12x86_64: Initial varargs support.Daniel Dunbar
- Doesn't yet handle case where values are passed in mixed (general purpose & floating point) registers; otherwise largely functional. Code still needs some cleaning. Fixes: MultiSource/Applications/lua/lua MultiSource/Applications/siod/siod MultiSource/Applications/sqlite3/sqlite3 SingleSource/Regression/C/PR640 SingleSource/UnitTests/2003-07-09-SignedArgs SingleSource/UnitTests/2007-03-02-VaCopy gcc compat test suite results (Darwin x86-32 & -64): -- # of expected passes 1262 # of unexpected failures 56 # of unresolved testcases 34 # of unsupported tests 2 Compare to: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090209/012050.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10Tweak x86-64 ABI to allow reuse for vararg handling.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64221 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10ABI: Correctly handle load/store of values which have a different LLVMDaniel Dunbar
memory representation (e.g., bool). - This upgrades (downgrades) MultiSource/Applications/ClamAV/clamscan to a miscompile and fixes SingleSource/UnitTests/2003-05-31-CastToBool. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10Make sure to initialize local variables, even if they were ignored byDaniel Dunbar
ABI. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64187 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-07Set load/store alignment when doing ABI coercions.Daniel Dunbar
- Currently, this is producing poor code, but we prefer correctness to performance for now. Eventually we should be able to generally avoid having to set the alignment when we control the alignment of the alloca. - This knocks out 33/1000 failures on my single argument ABI tests, down to 22/1000 and 18 of these appear to be gcc bugs. Woot. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Implement Direct ABIInfo semantics.Daniel Dunbar
- No intended functionality change, this is essentially enabling direct passing of complex and aggregate values, which no ABI is using. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63863 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Simplify test for whether we need an alloca to hold an indirect returnDaniel Dunbar
value. - No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Implement ABI Indirect sematics for arguments.Daniel Dunbar
- No intended functionality change, all current ABI implementations were only using indirect for complex/aggregate types, which were being passed indirectly with the Direct ABIInfo kind. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63858 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Merge ABIInfo StructRet/ByVal into Indirect. Daniel Dunbar
- No (intended) functionality change, the semantic changes are to come. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63850 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Pull CodeGenFunction::GetUndefRValue() out of EmitUnsupportedRValue.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05x86-32: Use Ignore to avoid passing empty structs (instead of Expand).Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63813 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Honor ByVal alignment. Patch by Nate Begeman!Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05Unbreak CGFunctionInfo::Profile method and reenable caching of ABIDaniel Dunbar
information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63799 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Add ABIArgInfo::dump()Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63794 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Temporarily disable caching of ABI results; this is going horriblyDaniel Dunbar
wrong in some cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63780 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Add asserts that the function signature matches the other arguments provideDaniel Dunbar
to CGCall functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63775 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Handle demotion of coerced arguments (as in void a(x) short x; { ... }).Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63726 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Use ConvertTypeForMem when creating alloca for scalar argument.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63681 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03x86_64 ABI: Initial implementation of ABI compliant parameter passing.Daniel Dunbar
- Now only 27/500 failures on ABITest single argument tests; from 350/500. :) - As with return types, a large percentage of these are likely to be gcc bugs, not yet reviewed. Also, fix bug in handling of Ignore ABI type in argument lists. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63654 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03ABI handling: Implement coercion for argument types (in addition toDaniel Dunbar
return types). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Change ABIInfo to compute information for a full signature at a timeDaniel Dunbar
(the main point of this restructing). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63619 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Remove ABIArgInfo::Default kind, ABI is now responsible for specifyingDaniel Dunbar
acceptable kind with more precise semantics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63617 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Add ABIArgInfo::Direct kind, which passes arguments using whatever theDaniel Dunbar
native IRgen type is. This is like Default, but without any extra semantics (like automatic tweaking of structures or void). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63615 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Add two FIXMEs.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63613 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Always use CGFunctionInfo to access ABI information.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63612 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Move ABIArgInfo into CGFunctionInfo, computed on creation.Daniel Dunbar
- Still have to convert some consumers over. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63610 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Move ABIInfo/ABIArgInfo classes into ABIInfo.hDaniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63586 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03Memoize CGFunctionInfo construction.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63576 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02Change CGFunctionInfo args iterator to not include the return type.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63571 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02Thread CGFunctionInfo construction through CodeGenTypes.Daniel Dunbar
- Inefficient & leaks memory currently, will be cleaned up subsequently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63567 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02More ABI API cleanup.Daniel Dunbar
- Lift CGFunctionInfo creation above ReturnTypeUsesSret and EmitFunction{Epi,Pro}log. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63553 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02ABI handling API changes.Daniel Dunbar
- Lift CGFunctionInfo creation up to callers of EmitCall. - Move isVariadic bit out of CGFunctionInfo, take as argument to GetFunctionType instead. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02Shuffle some functions around, no functionality change.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63538 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02Add FIXME.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63531 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31Remove unused overload of GetFunctionType.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31Initialize CGFunctionInfo isVariadic bit correctly.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31Err, unbreak my previous "no functionality change commit", will fix properly ↵Daniel Dunbar
later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63467 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31Kill off CGCallInfo, always use CGFunctionInfo for encapsulatingDaniel Dunbar
function/call info. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63466 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-31x86_64 ABI: Retool classification to compute lo & hi classificationsDaniel Dunbar
in terms of where the type resides in the containing object. This is a more clear embodiement of the spec & fixes a merging issue with unions. Down to 3/1000 failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30x86_64 ABI: Fix more thinkos, straddling computation for complex wasDaniel Dunbar
computing in bytes not bits. We are now down to 22/1000 failures on the return types tests, and 18 of those are gcc bugs I believe. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30x86_64 ABI: Fix thinko in prev commit, 64-bit vectors should have SSEDaniel Dunbar
class, not integer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30x86_64 ABI: Pass <1 x double> in memory. This is arguably wrong, butDaniel Dunbar
matches gcc 4.2 (not llvm-gcc). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30Remove testing -use-x86_64-abi option; current implementation isDaniel Dunbar
robust enough for general use. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63406 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30x86_64 ABI: Split small vectors which cross an eightbyte boundary. Down to ↵Daniel Dunbar
33/500 return type failures. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63404 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30x86_64 ABI: Implement classification for arrays.Daniel Dunbar
- This brings us down to an 8% failure rate on the first 500 return types tests (from 12%). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30Use uint64_t not unsigned for type sizes/offsets.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29x86_64 ABI: Handle fields / complex components which straddleDaniel Dunbar
eightbyte boundaries. - Getting harder to test now that we handle cases gcc & llvm-gcc get wrong ( { _Complex char; _Complex int; } is a good example). :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63305 91177308-0d34-0410-b5e6-96231b3b80d8