llvm-6502/test
Chandler Carruth 81ff90db44 First major step toward addressing PR14059. This teaches SROA to handle
cases where we have partial integer loads and stores to an otherwise
promotable alloca to widen[1] those loads and stores to cover the entire
alloca and bitcast them into the appropriate type such that promotion
can proceed.

These partial loads and stores stem from an annoying confluence of ARM's
calling convention and ABI lowering and the FCA pre-splitting which
takes place in SROA. Clang lowers a { double, double } in-register
function argument as a [4 x i32] function argument to ensure it is
placed into integer 32-bit registers (a really unnerving implicit
contract between Clang and the ARM backend I would add). This results in
a FCA load of [4 x i32]* from the { double, double } alloca, and SROA
decomposes this into a sequence of i32 loads and stores. Inlining
proceeds, code gets folded, but at the end of the day, we still have i32
stores to the low and high halves of a double alloca. Widening these to
be i64 operations, and bitcasting them to double prior to loading or
storing allows promotion to proceed for these allocas.

I looked quite a bit changing the IR which Clang produces for this case
to be more friendly, but small changes seem unlikely to help. I think
the best representation we could use currently would be to pass 4 i32
arguments thereby avoiding any FCAs, but that would still require this
fix. It seems like it might eventually be nice to somehow encode the ABI
register selection choices outside of the parameter type system so that
the parameter can be a { double, double }, but the CC register
annotations indicate that this should be passed via 4 integer registers.

This patch does not address the second problem in PR14059, which is the
reverse: when a struct alloca is loaded as a *larger* single integer.

This patch also does not address some of the code quality issues with
the FCA-splitting. Those don't actually impede any optimizations really,
but they're on my list to clean up.

[1]: Pedantic footnote: for those concerned about memory model issues
here, this is safe. For the alloca to be promotable, it cannot escape or
have any use of its address that could allow these loads or stores to be
racing. Thus, widening is always safe.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165928 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-15 08:40:30 +00:00
..
Analysis dependence analysis 2012-10-11 07:32:34 +00:00
Archive
Assembler Don't crash if a .ll file contains a forward-reference that looks like a global 2012-10-11 00:38:25 +00:00
Bindings/Ocaml Move TargetData to DataLayout. 2012-10-08 16:39:34 +00:00
Bitcode Change encoding of instruction operands in bitcode binaries to be relative 2012-10-11 20:20:40 +00:00
BugPoint
CodeGen Drop <def,dead> flags when merging into an unused lane. 2012-10-13 17:26:47 +00:00
DebugInfo Make sure to generate the right kind of MDNode for enum forward declarations. 2012-10-05 01:49:14 +00:00
ExecutionEngine Some regression tests which are testing the old jit and are exercising functionality which is both known to be broken and not expected to be fixed in the old jit. To remove these from the regression test output, I've marked them XFAIL (for lit tests) and ifdef'd them out (unit tests). These modifications remove the last long-standing regression test failures from the buildbots (though updating the triple to reflect new ubuntu configuration has temporarily caused some new failures). Tested on x86-64 and ARM Linux. 2012-10-08 13:06:30 +00:00
Feature Change the linker_private_weak_def_auto' linkage to linkonce_odr_auto_hide' to 2012-08-17 18:33:14 +00:00
Instrumentation tsan: update the test for new atomic enums 2012-10-03 13:19:20 +00:00
Integer Convert all tests using TCL-style quoting to use shell-style quoting. 2012-07-02 12:47:22 +00:00
Linker Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
MC X86: Depending on the local semantics of .align this test can also emit a nopl instead of nopw. 2012-10-13 17:38:00 +00:00
Object Fix SymbolRef::getAddress implementation for ELF. The 'value' field in symbol table entry should be treated differently for relocatable and relocated files. This patch fixes symbol addresses printed by llvm-nm for executables and shared objects. 2012-09-21 07:08:08 +00:00
Other Enable response files in all tools. Patch by Liu, Yaxun (Sam). I have simplified 2012-10-09 19:52:10 +00:00
Scripts This allows hello world to be compiled for Mips 64 direct object. 2012-06-27 22:48:25 +00:00
TableGen Re-work bit/bits value resolving in tblgen 2012-09-06 23:32:48 +00:00
Transforms First major step toward addressing PR14059. This teaches SROA to handle 2012-10-15 08:40:30 +00:00
Unit
Verifier Assert that dominates is not given a multiple edge. Finding out if we have 2012-08-17 18:21:28 +00:00
YAMLParser Convert the uses of '|&' to use '2>&1 |' instead, which works on old 2012-07-02 18:37:59 +00:00
CMakeLists.txt [CMake] check-all: Don't include check-llvm into check-all without LLVM_BUILD_TOOLS. 2012-10-10 13:33:00 +00:00
lit.cfg Enable llvm/test/ExecutionEngine/MCJIT also for cygwin. 2012-10-05 14:10:29 +00:00
lit.site.cfg.in Remove 'site.exp' building from both CMake and configure+make. 2012-06-28 00:16:51 +00:00
Makefile Revert r117093, "test/Makefile: Force lit -j1 on Cygwin." 2012-10-09 05:07:18 +00:00
Makefile.tests
TestRunner.sh