BPF has cpu_to_be and cpu_to_le instructions.
For now assume little endian and generate cpu_to_be for ISD::BSWAP.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233620 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
This adds a simple DFSan-based (i.e. taint-guided) fuzzer mutator,
see the comments for details.
Test Plan: a test added
Reviewers: samsonov, pcc
Reviewed By: samsonov, pcc
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D8669
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233613 91177308-0d34-0410-b5e6-96231b3b80d8
There's no benefit to using `DebugLoc` here. Moreover, this will let a
follow-up commit work with `MDScope` directly instead of `DebugLoc`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233610 91177308-0d34-0410-b5e6-96231b3b80d8
This pushes the use of PointerType::getElementType up into several
callers - I'll essentially just have to keep pushing that up the stack
until I can eliminate every call to it...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233604 91177308-0d34-0410-b5e6-96231b3b80d8
Keep a note in the materializer that we are stripping debug info so that
user doing a lazy read of the module don't hit outdated formats.
Thanks to Duncan for suggesting the fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233603 91177308-0d34-0410-b5e6-96231b3b80d8
Since I'm slowly gutting `DISubprogram` and `DICompileUnit`, update the
`CloneFunc` unit tests to call `verifyModule()` (where the checks are
moving to).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233602 91177308-0d34-0410-b5e6-96231b3b80d8
Don't use `DebugLoc::getFnDebugLoc()`, which creates new `MDLocation`s,
in the backend. We just want to grab the subprogram here anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233601 91177308-0d34-0410-b5e6-96231b3b80d8
Remove old API for `DebugLoc` now that all the callers have been
updated. If this broke your out-of-tree build, here's a quick map from
the old API to the new one:
DebugLoc DebugLoc::getFromMDLocation(MDNode *)
=> DebugLoc::DebugLoc(MDLocation *)
=> explicit DebugLoc::DebugLoc(MDNode *) // works with broken code
MDNode *DebugLoc::getAsMDNode(LLVMContext &)
=> MDLocation *DebugLoc::get()
=> DebugLoc::operator MDLocation *()
=> MDNode *DebugLoc::getAsMDNode() // works with broken code
bool DebugLoc::isUnknown()
=> DebugLoc::operator MDLocation *()
i.e.: if (MDLocation *DL = ...)
=> DebugLoc::operator bool() // works with broken code
i.e.: if (DebugLoc DL = ...)
void DebugLoc::getScopeAndInlinedAt(MDNode *&, MDNode *&)
=> use: MDNode *DebugLoc::getScope()
and: MDLocation *DebugLoc::getInlinedAt()
MDNode *DebugLoc::getScopeNode(LLVMContext &)
=> MDNode *DebugLoc::getInlinedAtScope()
void DebugLoc::dump(LLVMContext &)
=> void DebugLoc::dump()
void DebugLoc::getFnDebugLoc(LLVMContext &)
=> void DebugLoc::getFnDebugLoc()
MDNode *DebugLoc::getScope(LLVMContext &)
=> MDNode *DebugLoc::getScope()
MDNode *DebugLoc::getInlinedAt(LLVMContext &)
=> MDLocation *DebugLoc::getInlinedAt()
I've noted above the only functions that won't crash on broken code (due
to downcasting to `MDLocation`). If your code could be dealing with
broken IR (i.e., you haven't run the verifier yet, or you've used a
temporary node that will eventually (but not yet) get RAUW'ed to an
`MDLocation`), you need to restrict yourself to those.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233599 91177308-0d34-0410-b5e6-96231b3b80d8
Update lib/IR and lib/Bitcode to use the new `DebugLoc` API. Added an
explicit conversion to `bool` (avoiding a conversion to `MDLocation`),
since a couple of these use cases need to handle broken code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233585 91177308-0d34-0410-b5e6-96231b3b80d8
Adds a test to verify the behavior that r233153 restored: 'optnone'
does not spuriously disable the DAG combiner, and in fact there are
cases where the DAG combiner must run (even at -O0 or 'optnone') in
order for codegen to succeed.
Differential Revision: http://reviews.llvm.org/D8614
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233584 91177308-0d34-0410-b5e6-96231b3b80d8
When a new SM architecture is introduced, it is only supported by the
current PTX version and later. Make sure we are using at least the
minimum PTX version for the target architecture.
This also removes support for PTX ISA < 3.2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233583 91177308-0d34-0410-b5e6-96231b3b80d8
There was a change to the way some of the HTM and crypto builtins are being
handled in Clang. Previously, some of the builtins were dealt with in the
CodeGenFunction::EmitPPCBuiltinExpr method (in order to do range checking on
constant arguments). These check will been moved to Sema
http://reviews.llvm.org/D8672), which means those builtins will not be handled
in the EmitPPCBuiltinExpr method anymore. As a result, the definition of the
intrinsics in IntrinsicsPowerPC.td needs to be modified to inherit from the
GCCBuiltin definition.
http://reviews.llvm.org/D8673
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233581 91177308-0d34-0410-b5e6-96231b3b80d8
Rewrite `DebugLoc` with a cleaner API that reflects its current status
as a wrapper around an `MDLocation` pointer.
- Add accessors/constructors to/from `MDLocation`.
- Simplify construction from `MDNode`.
- Remove unnecessary `LLVMContext` from APIs.
- Drop some API that isn't useful any more.
- Rewrite documentation.
Actually, I've left the old API behind temporarily at the bottom of the
class so that I can update callers in separate commits. I'll remove it
once the callers are updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233573 91177308-0d34-0410-b5e6-96231b3b80d8
Write `MDLocation::getInlinedAtScope()` and use it to re-implement
`DebugLoc::getScopeNode()` (and simplify `DISubprogram::Verify()`).
This follows the inlined-at linked list and returns the scope of the
deepest/last location.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233568 91177308-0d34-0410-b5e6-96231b3b80d8
Simplify the logic in `DISubprogram::Verify()` by using the new debug
info hierarchy directly instead of the `DebugLoc` wrapper.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233563 91177308-0d34-0410-b5e6-96231b3b80d8
Add operand checks for `MDLexicalBlock` and `MDLexicalBlockFile`. Like
`MDLocalVariable` and `MDLocation`, these nodes always require a scope.
There was no test bitrot to fix here (just updated the serialization
tests in test/Assembler/mdlexicalblock.ll).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233561 91177308-0d34-0410-b5e6-96231b3b80d8
Momentarily (but never in tree), the `scope:` field was called
`parent:`. Apparently a few testcases were left behind with "parent" in
the name, so rename them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233560 91177308-0d34-0410-b5e6-96231b3b80d8
Check operands of `MDSubprogram`s in the verifier, and update the
accessors and factory functions to use more specific types.
There were a lot of broken testcases, which I fixed in r233466. If you
have out-of-tree tests for debug info, you probably need similar changes
to the ones I made there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233559 91177308-0d34-0410-b5e6-96231b3b80d8
Compiling the following function with -O0 would crash, since LLVM would
hit an assertion in getTestUnderMaskCond:
int test(unsigned long x)
{
return x >= 0 && x <= 15;
}
Fixed by detecting the case in the caller of getTestUnderMaskCond.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233541 91177308-0d34-0410-b5e6-96231b3b80d8