summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2016-01-19 16:59:23 +0000
committerDan Gohman <dan433584@gmail.com>2016-01-19 16:59:23 +0000
commitb6fd39a3a779295dc7939fd4d79dde513fa73fbe (patch)
tree880a2aeee05182a9b07e4539eb845348734d5f08 /llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
parent1a7e8b4bc1cde3fea2de164c26bb499bfce3ad39 (diff)
downloadbcm5719-llvm-b6fd39a3a779295dc7939fd4d79dde513fa73fbe.tar.gz
bcm5719-llvm-b6fd39a3a779295dc7939fd4d79dde513fa73fbe.zip
[WebAssembly] Rematerialize constants rather than hold them live in registers.
Teach the register stackifier to rematerialize constants that have multiple uses instead of leaving them in registers. In the WebAssembly encoding, it's the same code size to materialize most constants as it is to read a value from a register. llvm-svn: 258142
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
index 2e682a47547..75b76565c3f 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.td
@@ -123,7 +123,7 @@ defm : LOCAL<I64>;
defm : LOCAL<F32>;
defm : LOCAL<F64>;
-let isMoveImm = 1 in {
+let isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1 in {
def CONST_I32 : I<(outs I32:$res), (ins i32imm:$imm),
[(set I32:$res, imm:$imm)],
"i32.const\t$res, $imm">;
@@ -136,7 +136,7 @@ def CONST_F32 : I<(outs F32:$res), (ins f32imm_op:$imm),
def CONST_F64 : I<(outs F64:$res), (ins f64imm_op:$imm),
[(set F64:$res, fpimm:$imm)],
"f64.const\t$res, $imm">;
-} // isMoveImm = 1
+} // isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1
} // Defs = [ARGUMENTS]
OpenPOWER on IntegriCloud