summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2018-03-13 06:47:05 +0000
committerYonghong Song <yhs@fb.com>2018-03-13 06:47:05 +0000
commit80b882ecc565ae8b27dd6a61f37d74a0aef7e959 (patch)
tree5a6b27d74b14ec7e46ceab9e9c15c2789986b9c4
parent1d28a759d95922068395de3a0a3d4353a63e2e07 (diff)
downloadbcm5719-llvm-80b882ecc565ae8b27dd6a61f37d74a0aef7e959.tar.gz
bcm5719-llvm-80b882ecc565ae8b27dd6a61f37d74a0aef7e959.zip
bpf: Don't expand BSWAP on i32, promote it
Currently, there is no ALU32 bswap support in eBPF ISA. BSWAP on i32 was set to EXPAND which would need about eight instructions for single BSWAP. It would be more efficient to promote it to i64, then doing BSWAP on i64. For eBPF programs, most of the promotion are zero extensions which are likely be elimiated later by peephole optimizations. Signed-off-by: Jiong Wang <jiong.wang@netronome.com> Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 327369
-rw-r--r--llvm/lib/Target/BPF/BPFISelLowering.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/BPF/BPFISelLowering.cpp b/llvm/lib/Target/BPF/BPFISelLowering.cpp
index 4ad99e798fb..e02cdf579d2 100644
--- a/llvm/lib/Target/BPF/BPFISelLowering.cpp
+++ b/llvm/lib/Target/BPF/BPFISelLowering.cpp
@@ -105,7 +105,7 @@ BPFTargetLowering::BPFTargetLowering(const TargetMachine &TM,
}
if (STI.getHasAlu32()) {
- setOperationAction(ISD::BSWAP, MVT::i32, Expand);
+ setOperationAction(ISD::BSWAP, MVT::i32, Promote);
setOperationAction(ISD::BR_CC, MVT::i32, Promote);
}
OpenPOWER on IntegriCloud