llvm-project/llvm/lib/Target/BPF
Yonghong Song c430533771 [BPF] fix a bug in __builtin_preserve_field_info() with FIELD_BYTE_SIZE
During deriving proper bitfield access FIELD_BYTE_SIZE,
function Member->getStorageOffsetInBits() is used to
get llvm IR type storage offset in bits so that
the byte size can permit aligned loads/stores with previously
derived FIELD_BYTE_OFFSET.

The function should only be used with bitfield members and it will
assert if ASSERT is turned on during cmake build.
  Constant *getStorageOffsetInBits() const {
    assert(getTag() == dwarf::DW_TAG_member && isBitField());
    if (auto *C = cast_or_null<ConstantAsMetadata>(getExtraData()))
      return C->getValue();
    return nullptr;
  }

This patch fixed the issue by using Member->isBitField()
directly and a test case is added to cover this missing case.
This issue is discovered when running Andrii's linux kernel CO-RE
tests.

Differential Revision: https://reviews.llvm.org/D69761
2019-11-03 08:18:28 -08:00
..
AsmParser [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
Disassembler Revert CMake: Make most target symbols hidden by default 2019-06-11 03:21:13 +00:00
MCTargetDesc [Mips] Use appropriate private label prefix based on Mips ABI 2019-10-23 12:24:35 +02:00
TargetInfo Revert CMake: Make most target symbols hidden by default 2019-06-11 03:21:13 +00:00
BPF.h bpf: fix wrong truncation elimination when there is back-edge/loop 2019-10-16 15:27:59 +00:00
BPF.td [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFAbstractMemberAccess.cpp [BPF] fix a bug in __builtin_preserve_field_info() with FIELD_BYTE_SIZE 2019-11-03 08:18:28 -08:00
BPFAsmPrinter.cpp Second attempt to add iterator_range::empty() 2019-10-07 18:14:24 +00:00
BPFCORE.h [BPF] Remove relocation for patchable externs 2019-10-10 15:33:09 +00:00
BPFCallingConv.td Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFFrameLowering.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFFrameLowering.h [Alignment][NFC] Use Align for TargetFrameLowering/Subtarget 2019-10-17 07:49:39 +00:00
BPFISelDAGToDAG.cpp bpf: fix wrong truncation elimination when there is back-edge/loop 2019-10-16 15:27:59 +00:00
BPFISelLowering.cpp [Alignment][NFC] Remove unneeded llvm:: scoping on Align types 2019-09-27 12:54:21 +00:00
BPFISelLowering.h [TargetLowering] Change getOptimalMemOpType to take a function attribute list 2019-04-30 08:38:12 +00:00
BPFInstrFormats.td [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFInstrInfo.cpp Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM 2019-08-15 19:22:08 +00:00
BPFInstrInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFInstrInfo.td [BPF] fix indirect call assembly code 2019-10-21 03:22:03 +00:00
BPFMCInstLower.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFMCInstLower.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFMIChecking.cpp Prune a LegacyDivergenceAnalysis and MachineLoopInfo include each 2019-10-19 01:31:09 +00:00
BPFMIPeephole.cpp Prune a LegacyDivergenceAnalysis and MachineLoopInfo include each 2019-10-19 01:31:09 +00:00
BPFMISimplifyPatchable.cpp [BPF] fix a CO-RE issue with -mattr=+alu32 2019-10-25 14:27:25 -07:00
BPFRegisterInfo.cpp Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM 2019-08-15 19:22:08 +00:00
BPFRegisterInfo.h CodeGen: Introduce a class for registers 2019-06-24 15:50:29 +00:00
BPFRegisterInfo.td Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFSelectionDAGInfo.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFSelectionDAGInfo.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BPFSubtarget.cpp [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFSubtarget.h [BPF] add code-gen support for JMP32 instructions 2019-02-07 10:43:09 +00:00
BPFTargetMachine.cpp bpf: fix wrong truncation elimination when there is back-edge/loop 2019-10-16 15:27:59 +00:00
BPFTargetMachine.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BTF.def [BPF] Add BTF Var and DataSec Support 2019-03-16 15:36:31 +00:00
BTF.h [BPF] Remove relocation for patchable externs 2019-10-10 15:33:09 +00:00
BTFDebug.cpp [BPF] Remove relocation for patchable externs 2019-10-10 15:33:09 +00:00
BTFDebug.h [BPF] Remove relocation for patchable externs 2019-10-10 15:33:09 +00:00
CMakeLists.txt [BPF] Fix a typo in the file name 2019-07-09 18:35:46 +00:00
LLVMBuild.txt [BPF] Move InstPrinter files to MCTargetDesc. NFC 2019-05-11 01:13:21 +00:00