This should *actually* fix PR30244. This cranks up the workaround for PR30188 so that we never sink loads or stores of allocas.
The idea is that these should be removed by SROA/Mem2Reg, and any movement of them may well confuse SROA or just cause unwanted code churn. It's not ideal that the midend should be crippled like this, but that unwanted churn can really cause significant regressions in important workloads (tsan).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281162 91177308-0d34-0410-b5e6-96231b3b80d8
How I missed this locally is beyond me. I suspect llc didn't recompile. This is just changing the CHECK line back to what it was before r280364.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281161 91177308-0d34-0410-b5e6-96231b3b80d8
Exposed by PR30244, we will split a block currently if we think we can sink at least one instruction. However this isn't right - the reason we split predecessors is so that we can sink instructions that otherwise couldn't be sunk because it isn't safe to do so - stores, for example.
So, change the heuristic to only split if it thinks it can sink at least one non-speculatable instruction.
Should fix PR30244.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281160 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
With this change (plus some changes to prevent !invariant from being
clobbered within llvm), clang will be able to model the __ldg CUDA
builtin as an invariant load, rather than as a target-specific llvm
intrinsic. This will let the optimizer play with these loads --
specifically, we should be able to vectorize them in the load-store
vectorizer.
Reviewers: tra
Subscribers: jholewinski, hfinkel, llvm-commits, chandlerc
Differential Revision: https://reviews.llvm.org/D23477
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281152 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
An IR load can be invariant, dereferenceable, neither, or both. But
currently, MI's notion of invariance is IR-invariant &&
IR-dereferenceable.
This patch splits up the notions of invariance and dereferenceability at
the MI level. It's NFC, so adds some probably-unnecessary
"is-dereferenceable" checks, which we can remove later if desired.
Reviewers: chandlerc, tstellarAMD
Subscribers: jholewinski, arsenm, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D23371
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281151 91177308-0d34-0410-b5e6-96231b3b80d8
should have been (1ULL << MCID::XYZ). Currently this works because enum Flag
has 31 values, but extending it will result in a compile warnings/errors.
This was part of the accepted patch in https://reviews.llvm.org/D23601, but
it was suggested to apply this first as a separate patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281149 91177308-0d34-0410-b5e6-96231b3b80d8
This generates invalid IR: the only users of swifterror can be call
arguments, loads, and stores.
rdar://28242257
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281144 91177308-0d34-0410-b5e6-96231b3b80d8
... and make a few ilist-internal API changes, in preparation for
changing how ilist_node is templated. The only effect for ilist users
should be changing the friend target from llvm::ilist_node_access to
llvm::ilist_detail::NodeAccess (which is only necessary when they
inherit privately from ilist_node).
- Split out SpecificNodeAccess, which has overloads of getNodePtr and
getValuePtr that are untemplated.
- Use more typedefs to prevent more changes later.
- Force inheritance to use *NodeAccess (to emphasize that ilist *users*
shouldn't be doing this).
There should be no functionality change here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281142 91177308-0d34-0410-b5e6-96231b3b80d8
This is a prep commit to minimize changes in a follow-up that is adding
a template parameter to ilist_node_base and ilist_base.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281141 91177308-0d34-0410-b5e6-96231b3b80d8
1. Rename variables to be consistent with related/preceding code (may want to reorganize).
2. Fix comments/formatting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281140 91177308-0d34-0410-b5e6-96231b3b80d8
Everything under foldICmpInstWithConstant() should now be working for
splat vectors via m_APInt matchers. Ie, I've removed all of the FIXMEs
that I added while cleaning that section up. Note that not all of the
associated FIXMEs in the regression tests are gone though, because some
of the tests require earlier folds that are still scalar-only.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281139 91177308-0d34-0410-b5e6-96231b3b80d8
These defaulted to Write32Bit. I don't think this actually matters
since these don't exist during scheduling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281127 91177308-0d34-0410-b5e6-96231b3b80d8
Summary:
I want to separate out the notions of invariance and dereferenceability
at the MI level, so that they correspond to the equivalent concepts at
the IR level. (Currently an MI load is MI-invariant iff it's
IR-invariant and IR-dereferenceable.)
First step is renaming this function.
Reviewers: chandlerc
Subscribers: MatzeB, jfb, llvm-commits
Differential Revision: https://reviews.llvm.org/D23370
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281125 91177308-0d34-0410-b5e6-96231b3b80d8
If the literal is being folded into src0, it doesn't matter
if it's an SGPR because it's being replaced with the literal.
Also fixes initially selecting 32-bit versions of some instructions
which also confused commuting.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281117 91177308-0d34-0410-b5e6-96231b3b80d8
This would create a bitcast use which fails the verifier: swifterror values may
only be used by loads, stores, and as function arguments.
rdar://28233244
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281114 91177308-0d34-0410-b5e6-96231b3b80d8
If the unaligned access has a dynamic offset, it may be odd which
would make the adjusted alignment incorrect to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281110 91177308-0d34-0410-b5e6-96231b3b80d8
When p0 was added as an explicit operand to the duplex subinstructions,
the disassembler was not updated to reflect this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281104 91177308-0d34-0410-b5e6-96231b3b80d8