Dan Gohman
5dda19035d
Implement Hash for ExternalName.
...
This allows users to have HashMaps etc. with ExternalNames as keys.
2017-11-06 11:34:09 -08:00
Dan Gohman
1d8df2ed1e
Remove the requirement that Variable implement Default.
2017-11-06 11:10:14 -08:00
Dan Gohman
4091688cc0
Avoid unnecessary name qualification.
2017-11-06 11:10:03 -08:00
Dan Gohman
d9743290ea
Elide elidable lifetime parameters.
2017-11-06 11:09:56 -08:00
Dan Gohman
8501cb798e
Minor comment cleanups.
2017-11-03 16:43:29 -07:00
Dan Gohman
acc6d941a3
Combine redundant match arm bodies.
2017-11-03 16:40:51 -07:00
Dan Gohman
c7f01f88b2
Clarify some comments.
2017-11-03 11:44:58 -07:00
Dan Gohman
e21479a843
Mark check_return_args as #[cfg(debug_assertions)].
2017-11-02 12:28:01 -07:00
Dan Gohman
1cbf921d9d
Add a function to seal all the blocks at once.
2017-11-02 08:00:55 -07:00
Dan Gohman
c6d39dea5d
Add a comment about shrink_to_fit().
2017-11-01 11:35:15 -07:00
Dan Gohman
61a51f5275
Rename a variable to clarify its purpose.
2017-11-01 11:34:16 -07:00
Dan Gohman
57041ea9eb
Tidy up semicolons.
2017-11-01 11:30:37 -07:00
Dan Gohman
39c0fbb6c7
Assert that sealed blocks cannot accept new predecessors.
2017-11-01 11:27:54 -07:00
Dan Gohman
1663f141c8
Tidy up unneeded parentheses.
2017-11-01 11:26:55 -07:00
Dan Gohman
aa724846f6
Clear the wasm operand stack at the end of a function.
...
This preserves an invariant that the stack is empty between function
body translations.
2017-11-01 11:25:22 -07:00
Dan Gohman
5f8b1b9f04
Fix a flake8 lint.
2017-10-31 13:05:26 -07:00
Dan Gohman
3d83d0e4f0
Clean up redundant blank lines.
2017-10-31 12:45:22 -07:00
Dan Gohman
871bf95acf
Change reloc_ebb to pass a CodeOffset rather than an Ebb index.
2017-10-31 12:26:38 -07:00
Dan Gohman
5d063eb8bc
Merge reloc_func and reloc_globalsym into reloc_external.
2017-10-31 12:26:33 -07:00
Dan Gohman
b60b2ce135
Change parse_multiline to follow PEP 257.
...
The main change is that it avoids creating blank lines when processing
docstrings.
This also adds blank lines in various places to make the generated code
prettier.
2017-10-31 12:21:23 -07:00
Dan Gohman
149a41a684
Clean up copypasta.
2017-10-31 12:21:14 -07:00
Dan Gohman
9c54c3fff0
Introduce globalsym_addr.
...
This is an instruction used in legalization of GlobalVarData::Sym global
variables.
2017-10-30 13:26:56 -07:00
Dan Gohman
cb805f704d
Put BaldrMonkey-specific behavior under a setting.
...
BaldrMonkey will need to enable allones_funcaddrs.
2017-10-30 13:26:56 -07:00
Dan Gohman
6fc45b070a
Add a new kind of GlobalVar for symbolic addresses.
...
These addresses will allow referencing C/C++/Rust-style global variables
by name directly.
2017-10-30 13:26:56 -07:00
Dan Gohman
c2665385b1
Rename FunctionName to ExternalName.
2017-10-30 13:26:56 -07:00
Dan Gohman
fae5ffb556
Make generated code more consistent with current rustfmt.
2017-10-30 10:06:23 -07:00
Dan Gohman
683408f30b
Break alias cycles by inserting zero values.
2017-10-26 12:22:16 -07:00
Dan Gohman
53e93d94a8
Avoid creating cyclic aliases in unreachable code.
2017-10-26 11:39:53 -07:00
Jakob Stoklund Olesen
d37126565e
Also consider fixed outputs for replace_global_defines.
...
Fixes #178 .
When an instruction with a fixed output operand defines a globally live
SSA value, we need to check if the fixed register is available in the
`regs.global` set of registers that can be used across EBB boundaries.
If the fixed output register is not available in regs.global, set the
replace_global_defines flag so the output operands are rewritten as
local values.
2017-10-25 14:28:30 -07:00
Jakob Stoklund Olesen
1b71285b34
Return bools in GPR registers.
...
Boolean types are returned in %rax, so regclass_for_abi_type() should
return GPR.
Fixes #179 .
2017-10-25 13:34:55 -07:00
Jakob Stoklund Olesen
02e81dd1d7
Fix build after flake8 update.
...
There's a new version of flake8 out which doesn't like variables names
i, l, I.
No functional change intended.
2017-10-25 11:40:37 -07:00
Jakob Stoklund Olesen
e8ecf1f809
Add a FixedTied constraint kind for operand constraints.
...
Fixes #175 .
The Intel division instructions have fixed input operands that are
clobbered by fixed output operands, so the value passed as an input will
be clobbered just like a tied operand.
The FixedTied operand constraint is used to indicate a fixed input
operand that has a corresponding output operand with the same fixed
register.
Teach the spiller to teach a FixedTied operand the same as a Tied
operand constraint and make sure that the input value is killed by the
instruction.
2017-10-25 11:22:20 -07:00
Dan Gohman
2932a9314d
Don't allocate srclocs if we only have default SourceLoc values.
...
This avoids needless extra indentation in `write_function` in the
case where no SourceLoc information is available.
2017-10-25 11:17:29 -07:00
Dan Gohman
dbd75483e8
Rename arg_value to param_value for consistency.
...
Also rename FunctionBuilder's `pristine` to `params_values_initialized`
to avoid confusion with the unrelated `is_pristine` accessor function.
2017-10-25 10:14:10 -07:00
Dan Gohman
fc0671a0cf
Avoid dangling references to block params when sealing an unreachable block.
2017-10-25 10:04:18 -07:00
Dan Gohman
2d5faa01af
Simplify code using the FunctionBuilder helper functions.
2017-10-24 15:28:28 -07:00
Dan Gohman
bbdce7e3e0
Update the comment for 'notrap()'.
2017-10-24 10:39:01 -07:00
Dan Gohman
fdf2486c0a
Handle uninitialized values of type b1 and vector.
2017-10-23 15:23:57 -07:00
Dan Gohman
c93959de7e
Fix a bug handling a use_var of a value not defined in the entry block.
2017-10-20 15:55:04 -07:00
Dan Gohman
f4b25ff058
Have FunctionBuilder clear the ILBuilder's state in its drop().
2017-10-20 11:37:25 -07:00
Dan Gohman
9fdf44afd4
Clean up a stale comment.
2017-10-20 11:37:25 -07:00
Dan Gohman
d3077acf1c
TranslationState can assert that its stacks are empty between functions.
2017-10-20 11:37:25 -07:00
Jakob Stoklund Olesen
8e9ac361bd
Remove the CFG entry_block member.
...
It was not used.
2017-10-20 09:40:28 -07:00
Jakob Stoklund Olesen
b3fb41087e
Use the term "Function parameter" instead of "argument".
...
Rename the ArgumentType type to AbiParam since it describes the ABI
characteristics of a parameter or return value, not just the value type.
In Signature, rename members argument_types and return_types to "params"
and "returns". Again, they are not just types.
Fix a couple lingering references to "EBB arguments".
2017-10-19 17:39:23 -07:00
Jakob Stoklund Olesen
921bcc6c25
Use the term "EBB parameter" everywhere.
...
Add EBB parameter and EBB argument to the langref glossary to clarify
the distinction between formal EBB parameter values and arguments passed
to branches.
- Replace "ebb_arg" with "ebb_param" in function names that deal with
EBB parameters.
- Rename the ValueDef variants to Result and Param.
- A bunch of other small langref fixes.
No functional changes intended.
2017-10-19 16:17:09 -07:00
Jakob Stoklund Olesen
ea68a69f8b
Fix a flake8 lint.
...
Also don't infer writes_cpu_flags if it is specified explicitly.
2017-10-19 16:17:09 -07:00
Dan Gohman
7c9b9e3d27
Mark spill and fill as can_store and can_load.
...
This allows GVN to avoid hoisting them. These will be to coarse for
things that want more precise dependence information, however we can
work that out when we build such things.
2017-10-19 13:11:33 -07:00
Dan Gohman
cc0bb70c5d
Make GVN aware of instructions that write to CPU flags.
2017-10-19 12:59:10 -07:00
Dan Gohman
3ccee371a7
Remove the todo for smod.
...
It's not present in either WebAssembly or Rust, for example. We can
still add smod in the future if future use cases need it.
2017-10-19 12:59:10 -07:00
Dan Gohman
1a1774af15
Fix a typo in a comment.
2017-10-19 12:59:10 -07:00