Commit graph

444 commits

Author SHA1 Message Date
Alexey Prokhin
66a392a5c2 Rename Type::irtype to ctype for consistency with dmd and gdc 2014-10-05 16:55:12 +04:00
Alexey Prokhin
0f7a3b64c5 Make FuncDeclaration::isIntrinsic and FuncDeclaration::isVaIntrinsic free functions 2014-10-05 16:08:58 +04:00
David Nadlinger
3d1be20470 Remove availableExternally logic and extra inlining semantic passes.
Turns out that since the change to use DMD's symbol emission
logic a few releases back we didn't actually ever emit code
for the extra modules. Thus, all the effort for the extra
semantic passes went to waste.

If we want to implement DMD-style cross-module inlining, we
need to add the extra semantic3s back in, and then iterate
over all the non-root modules with a codegen visitor that
only emits symbols as available_externally.

We probably won't need the availableExternally members if
we start with a clean design in the new symbol emission
framework. Thus, remove everything in the meantime. This
will make some release builds a bit faster, and should not
negatively affect generated code.
2014-10-04 20:02:13 +02:00
David Nadlinger
8fafb59157 [cleanup] Slight comment improvements. 2014-09-15 23:19:52 +02:00
David Nadlinger
9b9d6035aa [cleanup] Remove unused DtoBaseFunctionType. 2014-09-14 18:13:43 +02:00
David Nadlinger
73735dd98c Fix assertions-enabled build.
needsCodegen was moved to TemplateInstance in 2.066.1.
2014-09-14 18:13:19 +02:00
David Nadlinger
28f4bce28c Merge DMD 2.066.1-rc1 plus dmd#3985.
This corresponds to DMD commit 9ca87d2855e30a42c65aea0be93a93449f82400c,
which will likely be released as 2.066.1.
2014-09-14 16:07:19 +02:00
David Nadlinger
e1ffd58732 Merge branch 'master' into merge-2.066
Conflicts:
	gen/functions.cpp
2014-09-14 15:29:43 +02:00
David Nadlinger
934c67dc75 Emit functions as available_externally instead of skipping them.
This finally fixes the performance regression due to missing
inlining after the switch to the DMD-style symbol emission
logic (what later became FuncDeclaration::needsCodegen).

In my tests, this slightly increased compile times in release
mode (~7% for a set of small-ish programs) due to the extra
codegen. The impact is that small because we were doing all the
extra semantic{2, 3}s anyway (only to throw their results away)
and still get to avoid the LLVM backend. The performance gains
are, depending on the benchmark, spectacular, as this was
responsible for things like std.array.front not getting inlined.
2014-09-14 14:54:17 +02:00
Kai Nacke
382ad184d8 Merge branch 'master' into merge-2.066
Conflicts:
	dmd2/builtin.c
	gen/classes.cpp
	gen/functions.cpp
	gen/llvmhelpers.cpp
	gen/statements.cpp
	gen/toir.cpp
	runtime/druntime
	runtime/phobos
2014-09-13 23:11:54 +02:00
David Nadlinger
5370f52e8a [cleanup] Remove stale debug output statements. 2014-09-13 20:58:05 +02:00
David Nadlinger
42f5ea7cbb [cleanup] Don't check global.params.useUnitTests twice. 2014-09-13 20:58:02 +02:00
Alexey Prokhin
960d84508b [Refactoring] Turn IrDsymbol flags into an enum value 2014-09-12 16:27:13 +04:00
Alexey Prokhin
32b1d4cc55 Reduce size of IrDsymbol even more
resolved/defined/declared/initialized are turned into flags.
2014-09-12 14:43:54 +04:00
Alexey Prokhin
18f33b1815 Make IrDsymbol to be a typesafe union to reduce memory usage 2014-09-12 14:43:49 +04:00
Alexey Prokhin
5b15095c81 IrDsymbol::DModule is not used 2014-09-11 18:52:27 +04:00
kai
b8a75be61c Use LLVM intrinsic name as mangled name.
If the mangled name is viewed as the name emitted into IR code then the mangled name of an intrinsic is the intrinsic's name.
The name is unique because of the `llvm.` prefix. The only point is that overloaded intrinsics must be resolved earlier.

This commit moves the resolution of oveloaded intrinsics into the semantic analysis pass. The
2014-08-29 08:05:09 +02:00
Alexey Prokhin
d9189acbc4 Move toElem/toConstElem to visitors 2014-08-27 16:22:02 +04:00
Alexey Prokhin
ce1a41305b Set enclosingScopeExit in glue layer after semantic is done
Otherwise, we may end up with a wrong enclosing statement. It could
happen if a try-finally is rewritten as a try-catch (see NrvoWalker).
In this case, enclosingScopeExit will still point to the old unused
try-finally.
2014-08-24 13:59:18 +04:00
kai
2d49563ade Fix typo 2014-08-23 20:30:43 +02:00
kai
aa35307f54 Fix LLVM 3.6 build 2014-08-23 20:02:43 +02:00
Alexey Prokhin
76dec46df5 WIP: merge dmdfe 2.066 2014-08-22 16:01:28 +04:00
Alexey Prokhin
a6f358c59b Remove LINKintrisic 2014-07-10 18:10:46 +04:00
Alexey Prokhin
4555af39fa Fix assert in DtoDefineFunction() 2014-07-10 15:50:44 +04:00
David Nadlinger
b0ff0de9c1 Make function entry basic blocks unnamed.
The performance impact should be completely immeasurable,
but the main benefit is that this makes IR dumps slightly
nicer to look at (as the redundant "empty:" labels are
now omitted entirely).
2014-06-29 16:47:44 +02:00
Alexey Prokhin
7597808a2d Ignore nested functions with a parent that had errors during semantic3. 2014-06-27 18:27:05 +04:00
Alexey Prokhin
61110e3ea4 Fix crash in runnable/arrayop 2014-06-26 19:47:21 +04:00
kai
2b6dbb03f4 Add IF_LOG to more logging statements.
Evaluating arguments which call toChars() or toPrettyChars() are much more expensive then checking Logger::enabled().
2014-06-26 06:54:38 +02:00
kai
ecd59cbb77 Fix compilation error 2014-06-23 18:02:14 +02:00
kai
b7615f6a28 Merge branch 'master' into merge-2.065
Conflicts:
	dmd2/declaration.h
	dmd2/dsymbol.h
	dmd2/func.c
	gen/functions.cpp
	gen/toir.cpp
	runtime/druntime
2014-06-23 07:57:30 +02:00
kai
7c289fd673 Introduce needsCodegen.
This is a backport of the code from 2.065.
2014-06-19 13:20:28 +02:00
Kai Nacke
09da15be0f Merge branch 'merge-2.064' into merge-2.065 2014-06-16 07:30:31 +02:00
kai
bef0a62622 Merge branch 'master' into merge-2.064 2014-06-15 14:07:58 +02:00
Christian Kamm
bb46ac8758 doc: Fix description of when template function instances are skipped. 2014-06-14 14:22:43 +02:00
kai
5372e57595 Fix for issue #624 2014-06-13 14:08:27 +02:00
kai
f8a53ab3dc Merge branch 'merge-2.064' into merge-2.065
Conflicts:
	runtime/druntime
2014-03-12 18:27:43 +01:00
kai
2f2fa92df3 Fix includes for LLVM 3.5 2014-03-07 06:40:39 +01:00
Kai Nacke
fe39da53e3 Merge of 2.065.0-b3.
The new visitor class is used for IR generation. This removes some modifications from DMD source.
2014-02-10 08:47:25 +01:00
Kai Nacke
4006fbbd85 Merge branch 'master' into merge-2.064 2014-01-19 13:43:15 +01:00
Kai Nacke
49599f71e9 Add sanitizer attributes.
If the sanitizer is enabled (e.g. -sanitize=address) then the corresponding
attribute (e.g. llvm::Attribute::SanitizerAddress) must be set.
2014-01-19 13:03:37 +01:00
Kai Nacke
680568bb62 Merge branch 'master' into merge-2.064 2014-01-12 11:53:00 +01:00
Kai Nacke
b4b71e6c79 Fix include for LLVM 3.5 2014-01-12 11:37:52 +01:00
Kai Nacke
1463f4a275 Merge branch 'master' into merge-2.064 2014-01-06 11:24:03 +01:00
Jernej Krempuš
7436d94e09 Fixed a bug in DtoInlineIR
Before this fix, debug info was removed from the module while
parsing inline ir.
2014-01-06 01:27:26 +01:00
Kai Nacke
731f2a8fdf Merge branch 'master' into merge-2.064
Conflicts:
	dmd2/root/rmem.c
2014-01-03 15:56:01 +01:00
Kai Nacke
9b4a70c367 Use caching in DtoVaFunctionType.
Remove now unused method IrFuncTy.reset().
2014-01-03 15:14:39 +01:00
Kai Nacke
87006d0a5b Merge branch 'master' into merge-2.064 2014-01-03 13:54:10 +01:00
Kai Nacke
551bce6d18 Change location of assign to irFty.
If the comment about this function is still right (can be called recursively) then the assignment
to irFty should be done after all functions are called.
Takes advantage of move assignment, too.
2014-01-03 13:14:12 +01:00
Kai Nacke
58aadf88ef Merge branch 'master' into merge-2.064 2014-01-02 20:31:28 +01:00
Kai Nacke
1619b18f73 Small cleanup of attribute mess. 2013-12-31 17:29:25 +01:00