[SLP] Load sorting should not try to sort things that aren't loads.
We may get a VL where the first element is a load, but the others aren't. Trying to sort such VLs can only lead to sorrow. llvm-svn: 296411
This commit is contained in:
@@ -1052,7 +1052,12 @@ bool llvm::sortMemAccesses(ArrayRef<Value *> VL, const DataLayout &DL,
|
||||
Value *Obj0 = GetUnderlyingObject(Ptr0, DL);
|
||||
|
||||
for (auto *Val : VL) {
|
||||
// The only kind of access we care about here is load.
|
||||
if (!isa<LoadInst>(Val))
|
||||
return false;
|
||||
|
||||
Value *Ptr = getPointerOperand(Val);
|
||||
assert(Ptr && "Expected value to have a pointer operand.");
|
||||
|
||||
// If a pointer refers to a different underlying object, bail - the
|
||||
// pointers are by definition incomparable.
|
||||
|
||||
Reference in New Issue
Block a user