summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2015-11-19 23:04:59 +0000
committerDan Gohman <dan433584@gmail.com>2015-11-19 23:04:59 +0000
commit3192ddfebac52b75e623d186839ae0ffa58247b9 (patch)
treefa5d98aa8c6e00041dfd9db034f41ad265a1e118 /llvm/lib
parent11922d2c1d3a45106a7e3921f7950941e0bcb7a7 (diff)
downloadbcm5719-llvm-3192ddfebac52b75e623d186839ae0ffa58247b9.tar.gz
bcm5719-llvm-3192ddfebac52b75e623d186839ae0ffa58247b9.zip
[WebAssembly] Implement isCheapToSpeculateCtlz and isCheapToSpeculateCttz.
This unbreaks test/CodeGen/WebAssembly/i32.ll and test/CodeGen/WebAssembly/i64.ll after r224899. llvm-svn: 253617
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp10
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
index bae4f526723..dbfe00e95ed 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -228,6 +228,16 @@ WebAssemblyTargetLowering::getRegForInlineAsmConstraint(
return TargetLowering::getRegForInlineAsmConstraint(TRI, Constraint, VT);
}
+bool WebAssemblyTargetLowering::isCheapToSpeculateCttz() const {
+ // Assume ctz is a relatively cheap operation.
+ return true;
+}
+
+bool WebAssemblyTargetLowering::isCheapToSpeculateCtlz() const {
+ // Assume clz is a relatively cheap operation.
+ return true;
+}
+
//===----------------------------------------------------------------------===//
// WebAssembly Lowering private implementation.
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
index c79ffb29c25..3621571151a 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.h
@@ -52,6 +52,8 @@ private:
std::pair<unsigned, const TargetRegisterClass *>
getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI,
StringRef Constraint, MVT VT) const override;
+ bool isCheapToSpeculateCttz() const override;
+ bool isCheapToSpeculateCtlz() const override;
SDValue LowerCall(CallLoweringInfo &CLI,
SmallVectorImpl<SDValue> &InVals) const override;
OpenPOWER on IntegriCloud