summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-12-14 22:37:23 +0000
committerDan Gohman <dan433584@gmail.com>2015-12-14 22:37:23 +0000
commita712a6c4ce53588b1ee332b3cc1e14ed6d015f38 (patch)
tree347e4da40d8f45aa03de2ec134382238fffa359b /llvm/lib
parentdb9a91e32466b7f99fdf7f198d8b736f216bb34d (diff)
downloadbcm5719-llvm-a712a6c4ce53588b1ee332b3cc1e14ed6d015f38.tar.gz
bcm5719-llvm-a712a6c4ce53588b1ee332b3cc1e14ed6d015f38.zip
[WebAssembly] Avoid adding redundant EXPR_STACK uses.
llvm-svn: 255563
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
index d890310ac50..0b04a6355a9 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
@@ -78,9 +78,10 @@ static void ImposeStackOrdering(MachineInstr *MI, MachineRegisterInfo &MRI) {
ImposeStackInputOrdering(MI);
// Also read the opaque EXPR_STACK register.
- MI->addOperand(MachineOperand::CreateReg(WebAssembly::EXPR_STACK,
- /*isDef=*/false,
- /*isImp=*/true));
+ if (!MI->readsRegister(WebAssembly::EXPR_STACK))
+ MI->addOperand(MachineOperand::CreateReg(WebAssembly::EXPR_STACK,
+ /*isDef=*/false,
+ /*isImp=*/true));
// Also, mark any inputs to this instruction as being consumed by an
// instruction on the expression stack.
OpenPOWER on IntegriCloud