llvm-project/llvm/test/CodeGen/WebAssembly
Thomas Lively 3ef169e586 [WebAssembly][InstrEmitter] Foundation for multivalue call lowering
Summary:
WebAssembly is unique among upstream targets in that it does not at
any point use physical registers to store values. Instead, it uses
virtual registers to model positions in its value stack. This means
that some target-independent lowering activities that would use
physical registers need to use virtual registers instead for
WebAssembly and similar downstream targets. This CL generalizes the
existing `usesPhysRegsForPEI` lowering hook to
`usesPhysRegsForValues` in preparation for using it in more places.

One such place is in InstrEmitter for instructions that have variadic
defs. On register machines, it only makes sense for these defs to be
physical registers, but for WebAssembly they must be virtual registers
like any other values. This CL changes InstrEmitter to check the new
target lowering hook to determine whether variadic defs should be
physical or virtual registers.

These changes are necessary to support a generalized CALL instruction
for WebAssembly that is capable of returning an arbitrary number of
arguments. Fully implementing that instruction will require additional
changes that are described in comments here but left for a follow up
commit.

Reviewers: aheejin, dschuff, qcolombet

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71484
2020-01-21 11:13:46 -08:00
..
PR40172.ll [WebAssembly][FastISel] Do not assume naive CmpInst lowering 2019-01-14 22:03:43 +00:00
PR40267.ll [LegalizeVectorTypes] Allow illegal indices when splitting extract_vector_elt 2019-01-31 00:35:37 +00:00
PR41149.ll [SelectionDAG] Add scalarization of ABS node (PR41149) 2019-03-21 11:18:54 +00:00
PR41841.ll [WebAssembly] Don't assume that zext/sext result is i32/i64 in fast isel (PR41841) 2019-05-13 19:40:18 +00:00
add-prototypes-conflict.ll [WebAssembly] Fix a typo in a test file name 2019-07-09 01:21:04 +00:00
add-prototypes.ll [WebAssembly] Make sret parameter work with AddMissingPrototypes 2019-07-09 02:10:33 +00:00
address-offsets.ll [WebAssembly] Limit PIC support to the Emscripten target 2019-06-05 20:01:01 +00:00
atomic-fence.ll [WebAssembly] Add atomic.fence instruction 2019-08-28 23:13:43 +00:00
atomic-fence.mir [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
atomic-mem-consistency.ll [WebAssembly] Remove uses of ThreadModel 2019-02-28 18:39:08 +00:00
atomic-rmw.ll [WebAssembly] Remove uses of ThreadModel 2019-02-28 18:39:08 +00:00
bulk-memory-intrinsics.ll [WebAssembly] Bulk memory intrinsics and builtins 2019-02-13 22:11:16 +00:00
bulk-memory.ll [WebAssembly] Restore defaults for stores per memop 2019-09-18 23:18:16 +00:00
byval.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
call-pic.ll [WebAssembly] Limit PIC support to the Emscripten target 2019-06-05 20:01:01 +00:00
call.ll [WebAssembly] Implement tail calls and unify tablegen call classes 2019-06-26 16:17:15 +00:00
cfg-stackify-dbg-skip.ll [WebAssembly] Run ExplicitLocals pass after CFGStackify 2019-03-30 09:29:57 +00:00
cfg-stackify-dbg.mir [WebAssembly] Handle END_LOOP in unreachable BB in CFGStackify 2019-03-29 19:36:51 +00:00
cfg-stackify-eh.ll [WebAssembly] Fix a bug in 'try' placement 2019-10-08 16:15:39 +00:00
cfg-stackify.ll [WebAssembly] Emit br_table for most switch instructions 2019-04-23 21:30:30 +00:00
cfi.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
clear-cache.ll Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
comparisons-f32.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
comparisons-f64.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
comparisons-i32.ll [WebAssembly][FastISel] Do not assume naive CmpInst lowering 2019-01-14 22:03:43 +00:00
comparisons-i64.ll [WebAssembly][FastISel] Do not assume naive CmpInst lowering 2019-01-14 22:03:43 +00:00
conv-trap.ll [WebAssembly] Trapping fptoint builtins and intrinsics 2019-10-15 01:11:51 +00:00
conv.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
copysign-casts.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
cpus.ll Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
custom-sections.ll [WebAssembly] Add languages from debug info to producers section 2019-01-18 02:47:48 +00:00
dbgvalue.ll
dead-vreg.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
divrem-constant.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
eh-labels.mir [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
eh-lsda.ll Reland "[WebAssembly] LSDA info generation" 2018-10-25 23:55:10 +00:00
exception.ll Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
explicit-locals.mir [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
export-name.ll [WebAssembly] Add new `export_name` clang attribute for controlling wasm export names 2019-12-11 11:54:57 -08:00
f16.ll [WebAssembly] Support f16 libcalls 2019-04-30 19:17:59 +00:00
f32.ll [SelectionDAG] Do minnum->minimum at legalization time instead of building time 2019-07-01 11:00:23 +00:00
f64.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
fast-isel-br-i1.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
fast-isel-i24.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
fast-isel-i256.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
fast-isel-noreg.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
fast-isel.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
frem.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
func.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
function-bitcasts-varargs.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
function-bitcasts.ll [WebAssembly] Handle aliases in WebAssemblyFixFunctionBitcasts 2019-08-21 19:52:33 +00:00
function-info.mir [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
global.ll [WebAssembly] Remove uses of ThreadModel 2019-02-28 18:39:08 +00:00
global_dtors.ll [WebAssembly] Fix crash when @llvm.global_dtors is external 2019-03-01 00:12:13 +00:00
globl.ll
i32-load-store-alignment.ll Fix typo in comment 2019-01-09 14:20:20 +00:00
i32.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
i64-load-store-alignment.ll Fix typo in comment 2019-01-09 14:20:20 +00:00
i64.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
i128-returned.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
i128.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
ident.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
immediates.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
implicit-def.ll [WebAssembly] Disable MachineBlockPlacement pass 2019-03-05 20:35:34 +00:00
import-module.ll [WebAssembly] Add codegen support for the import_field attribute 2019-02-01 22:27:34 +00:00
indirect-import.ll Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
indirectbr.ll [WebAssembly] Enable IndirectBrExpandPass 2019-07-03 23:54:06 +00:00
inline-asm-m.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
inline-asm-roundtrip.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
inline-asm.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
inlineasm-output-template.ll [AsmPrinter] refactor to support %c w/ GlobalAddress' 2019-04-26 18:45:04 +00:00
irreducible-cfg-exceptions.ll [WebAssembly] Improve readability of irreducibility tests 2019-03-19 05:10:39 +00:00
irreducible-cfg.ll [WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG 2019-03-30 01:31:11 +00:00
irreducible-cfg.mir [WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG 2019-03-30 01:31:11 +00:00
legalize.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
libcalls.ll [WebAssembly] Expand more SIMD float ops 2019-05-24 00:15:04 +00:00
lit.local.cfg
llround-conv-i32.ll [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
load-ext-atomic.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
load-ext.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
load-store-i1.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
load-store-pic.ll [WebAssembly] Limit PIC support to the Emscripten target 2019-06-05 20:01:01 +00:00
load.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
lower-em-ehsjlj-options.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
lower-em-exceptions-lpad-only.ll [WebAssembly] Fix landingpad-only case in Emscripten EH 2020-01-06 17:02:32 -08:00
lower-em-exceptions-whitelist.ll [WebAssembly] Fix conflict between ret legalization and sjlj 2019-08-05 21:36:09 +00:00
lower-em-exceptions.ll [WebAssembly] Fix conflict between ret legalization and sjlj 2019-08-05 21:36:09 +00:00
lower-em-sjlj-alias.ll [WebAssembly] Compare functions by names in Emscripten Sjlj 2019-09-03 22:26:49 +00:00
lower-em-sjlj-sret.ll [WebAssembly] Combine emscripten SjLj tests 2019-08-26 21:41:17 +00:00
lower-em-sjlj.ll [WebAssembly] Fix SSA rebuilding in SjLj transformation 2019-08-26 21:51:35 +00:00
lower-global-dtors.ll [WebAssembly] Disable MachineBlockPlacement pass 2019-03-05 20:35:34 +00:00
main-declaration.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
main-no-args.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
main-three-args.ll [WebAssembly] Re-enable main-function signature rewriting 2019-01-29 10:53:42 +00:00
main-with-args.ll [WebAssembly] Re-enable main-function signature rewriting 2019-01-29 10:53:42 +00:00
mem-intrinsics.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
memory-addr32.ll [WebAssembly] Remove tests for old intrinsics. 2019-01-14 18:25:29 +00:00
muloti4.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
multi-return.ll [WebAssembly] Track frame registers through VReg and local allocation 2020-01-17 17:23:56 -08:00
multivalue.ll [WebAssembly][InstrEmitter] Foundation for multivalue call lowering 2020-01-21 11:13:46 -08:00
mutable-globals.ll [WebAssembly] Add mutable globals feature 2019-03-29 22:00:18 +00:00
negative-base-reg.ll Migrate function attribute "no-frame-pointer-elim"="false" to "frame-pointer"="none" as cleanups after D56351 2019-12-24 16:27:51 -08:00
null-streamer.ll [WebAssembly] Add null streamer support 2018-11-18 11:58:47 +00:00
offset-atomics.ll Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
offset-fastisel.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
offset-folding.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
offset.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
phi.ll [WebAssembly] Make LBB markers not affected by test order 2019-04-23 21:17:03 +00:00
reg-argument.mir [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
reg-copy.mir [WebAssembly] Make returns variadic 2019-10-09 21:42:08 +00:00
reg-stackify.ll [WebAssembly] Assembler/InstPrinter: support call_indirect type index. 2019-08-01 18:08:26 +00:00
return-address-emscripten.ll [WebAssembly] Implement __builtin_return_address for emscripten 2019-05-23 01:24:01 +00:00
return-address-unknown.ll [WebAssembly] Implement __builtin_return_address for emscripten 2019-05-23 01:24:01 +00:00
return-int32.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
return-void.ll [WebAssembly] replaced .param/.result by .functype 2018-11-19 17:10:36 +00:00
returned.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
select.ll [WebAssembly] Fix miscompile of select with and 2019-11-15 16:22:01 -08:00
signext-arg.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
signext-inreg.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
signext-zeroext.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
simd-arith.ll [TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::EXTRACT_VECTOR_ELT (REAPPLIED) 2020-01-04 13:15:50 +00:00
simd-bitcasts.ll [WebAssembly] Add unimplemented-simd128 subtarget feature 2019-01-10 22:32:11 +00:00
simd-build-pair.ll [WebAssembly] Expand BUILD_PAIR nodes 2019-01-28 23:44:31 +00:00
simd-build-vector.ll [WebAssembly] v8x16.swizzle and rewrite BUILD_VECTOR lowering 2019-10-09 17:39:19 +00:00
simd-comparisons.ll Reland "[WebAssembly] Expand setcc of v2i64" 2019-11-01 10:34:01 -07:00
simd-conversions.ll [WebAssembly] Add unimplemented-simd128 subtarget feature 2019-01-10 22:32:11 +00:00
simd-extended-extract.ll [TargetLowering] SimplifyDemandedBits - call SimplifyMultipleUseDemandedBits for ISD::EXTRACT_VECTOR_ELT (REAPPLIED) 2020-01-04 13:15:50 +00:00
simd-illegal-signext.ll [WebAssembly] Implement ReplaceNodeResults to fix a SIMD crash 2019-05-23 18:09:26 +00:00
simd-intrinsics.ll [WebAssembly] Add avgr_u intrinsics and require nuw in patterns 2019-12-18 15:31:38 -08:00
simd-load-splat.ll Reland "[WebAssembly] Handle multiple loads of splatted loads" 2019-10-31 20:02:24 -07:00
simd-load-store-alignment.ll [WebAssembly] Add unimplemented-simd128 subtarget feature 2019-01-10 22:32:11 +00:00
simd-nested-shuffles.ll [WebAssembly] Fix invalid machine instrs in -O0, verify in tests 2018-12-21 06:58:15 +00:00
simd-noopt.ll [WebAssembly][NFC] Elaborate on simd-noopt test comment 2019-01-02 20:43:08 +00:00
simd-offset.ll [WebAssembly] SIMD Load and extend operations 2019-09-27 02:06:50 +00:00
simd-reductions.ll [WebAssembly] Optimize ISel for SIMD Boolean reductions 2019-06-19 00:02:13 +00:00
simd-scalar-to-vector.ll [WebAssembly] Lower SCALAR_TO_VECTOR to splats 2019-01-29 23:44:48 +00:00
simd-select.ll [WebAssembly] Fix select of and (PR40805) 2019-02-23 18:59:01 +00:00
simd-sext-inreg.ll [WebAssembly] Add unimplemented-simd128 subtarget feature 2019-01-10 22:32:11 +00:00
simd-unsupported.ll [WebAssembly] Expand more SIMD float ops 2019-05-24 00:15:04 +00:00
simd.ll [SDAG] fold insert_vector_elt with undef index 2019-10-27 15:28:43 -04:00
stack-alignment.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
stack-insts.ll [WebAssembly] Fix assembler parsing of br_table. 2018-12-17 22:04:44 +00:00
stack-protector.ll [WebAssembly] Define the signature for __stack_chk_fail 2019-04-29 21:09:44 +00:00
store-trunc-atomic.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
store-trunc.ll [WebAssembly] Added default stack-only instruction mode for MC. 2018-08-27 15:45:51 +00:00
store.ll [WebAssembly] Massive instruction renaming 2019-01-08 06:25:55 +00:00
switch.ll [WebAssembly] Make LBB markers not affected by test order 2019-04-23 21:17:03 +00:00
tailcall.ll [WebAssembly] Allow multivalue signatures in object files 2019-10-18 20:27:30 +00:00
target-features-tls.ll [WebAssembly] Implement thread-local storage (local-exec model) 2019-07-16 22:00:45 +00:00
target-features.ll llc: Change behavior of -mattr with existing attribute 2020-01-15 19:46:01 -05:00
tls-general-dynamic.ll Revert "[Support] make report_fatal_error `abort` instead of `exit`" 2020-01-15 17:52:25 -08:00
tls-local-exec.ll [WebAssembly] Compile all TLS on Emscripten as local-exec 2019-07-16 22:22:08 +00:00
umulo-128-legalisation-lowering.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
umulo-i64.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
unreachable.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
unsupported-function-bitcasts.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
unused-argument.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
userstack.ll [WebAssembly] Update CodeGen test expectations after rL354697. NFC 2019-02-23 00:07:39 +00:00
varargs.ll [WebAssembly] Properly align fp128 arguments in outgoing varargs arguments 2019-02-26 05:20:19 +00:00
vector-sdiv.ll
vtable.ll [WebAssembly] Remove uses of ThreadModel 2019-02-28 18:39:08 +00:00
wasmehprepare.ll [WebAssembly] Add immarg attribute to intrinsics 2019-03-19 05:02:30 +00:00