[all-commits] [llvm/llvm-project] 3ef169: [WebAssembly][InstrEmitter] Foundation for multiva...
Thomas Lively via All-commits
all-commits at lists.llvm.org
Tue Jan 21 11:13:51 PST 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 3ef169e586f4d14efe690c23c878d5aa92a80eb5
https://github.com/llvm/llvm-project/commit/3ef169e586f4d14efe690c23c878d5aa92a80eb5
Author: Thomas Lively <tlively at google.com>
Date: 2020-01-21 (Tue, 21 Jan 2020)
Changed paths:
M llvm/include/llvm/Target/TargetMachine.h
M llvm/lib/CodeGen/PrologEpilogInserter.cpp
M llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
M llvm/lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h
M llvm/lib/Target/WebAssembly/WebAssemblyISD.def
M llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyInstrCall.td
M llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h
M llvm/lib/Target/WebAssembly/WebAssemblyUtilities.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyUtilities.h
M llvm/test/CodeGen/WebAssembly/multivalue.ll
Log Message:
-----------
[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
More information about the All-commits
mailing list