mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
[SLSR] handles non-canonicalized Mul candidates
such as (2 + B) * S. Tested by @non_canonicalized in slsr-mul.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237216 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -408,8 +408,8 @@ void StraightLineStrengthReduce::allocateCandidatesAndFindBasisForMul(
|
||||
Value *LHS, Value *RHS, Instruction *I) {
|
||||
Value *B = nullptr;
|
||||
ConstantInt *Idx = nullptr;
|
||||
// Only handle the canonical operand ordering.
|
||||
if (match(LHS, m_Add(m_Value(B), m_ConstantInt(Idx)))) {
|
||||
if (match(LHS, m_Add(m_Value(B), m_ConstantInt(Idx))) ||
|
||||
match(LHS, m_Add(m_ConstantInt(Idx), m_Value(B)))) {
|
||||
// If LHS is in the form of "Base + Index", then I is in the form of
|
||||
// "(Base + Index) * RHS".
|
||||
allocateCandidatesAndFindBasis(Candidate::Mul, SE->getSCEV(B), Idx, RHS, I);
|
||||
|
Reference in New Issue
Block a user