diff options
author | Yonghong Song <yhs@fb.com> | 2018-02-23 23:49:26 +0000 |
---|---|---|
committer | Yonghong Song <yhs@fb.com> | 2018-02-23 23:49:26 +0000 |
commit | 63cf273f5597f9e6cc9c3604acab5a00298a794b (patch) | |
tree | 3aa2c4840d0f3fc44af9be970954ec6af92072e4 /llvm/lib/Target/BPF | |
parent | 59fc805c7e2e8edab9cc1adc2d91bb3d42971520 (diff) | |
download | bcm5719-llvm-63cf273f5597f9e6cc9c3604acab5a00298a794b.tar.gz bcm5719-llvm-63cf273f5597f9e6cc9c3604acab5a00298a794b.zip |
bpf: Support i32 in getScalarShiftAmountTy method
getScalarShiftAmount method should be implemented for eBPF backend to make
sure shift amount could still get correct type once 32-bit subregisters
support are enabled.
Signed-off-by: Jiong Wang <jiong.wang@netronome.com>
Reviewed-by: Yonghong Song <yhs@fb.com>
llvm-svn: 325986
Diffstat (limited to 'llvm/lib/Target/BPF')
-rw-r--r-- | llvm/lib/Target/BPF/BPFISelLowering.cpp | 5 | ||||
-rw-r--r-- | llvm/lib/Target/BPF/BPFISelLowering.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Target/BPF/BPFISelLowering.cpp b/llvm/lib/Target/BPF/BPFISelLowering.cpp index 194996989e5..0d604e099c3 100644 --- a/llvm/lib/Target/BPF/BPFISelLowering.cpp +++ b/llvm/lib/Target/BPF/BPFISelLowering.cpp @@ -713,3 +713,8 @@ EVT BPFTargetLowering::getSetCCResultType(const DataLayout &, LLVMContext &, EVT VT) const { return getHasAlu32() ? MVT::i32 : MVT::i64; } + +MVT BPFTargetLowering::getScalarShiftAmountTy(const DataLayout &DL, + EVT VT) const { + return (getHasAlu32() && VT == MVT::i32) ? MVT::i32 : MVT::i64; +} diff --git a/llvm/lib/Target/BPF/BPFISelLowering.h b/llvm/lib/Target/BPF/BPFISelLowering.h index badc0b82c16..3eb099cf369 100644 --- a/llvm/lib/Target/BPF/BPFISelLowering.h +++ b/llvm/lib/Target/BPF/BPFISelLowering.h @@ -60,6 +60,8 @@ public: EVT getSetCCResultType(const DataLayout &DL, LLVMContext &Context, EVT VT) const override; + MVT getScalarShiftAmountTy(const DataLayout &, EVT) const override; + private: // Control Instruction Selection Features bool HasAlu32; |