mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
[Reassociate] Canonicalize operands of vector binary operators.
Prior to this commit fmul and fadd binary operators were being canonicalized for both scalar and vector versions. We now canonicalize add, mul, and, or, and xor vector instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222006 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2083,14 +2083,9 @@ void Reassociate::OptimizeInst(Instruction *I) {
|
||||
// writing other transformations simpler.
|
||||
if (I->getType()->isFloatingPointTy() || I->getType()->isVectorTy()) {
|
||||
|
||||
// FAdd and FMul can be commuted.
|
||||
unsigned Opcode = I->getOpcode();
|
||||
if (Opcode == Instruction::FMul || Opcode == Instruction::FAdd)
|
||||
if (I->isCommutative())
|
||||
canonicalizeOperands(I);
|
||||
|
||||
// FIXME: We should commute vector instructions as well. However, this
|
||||
// requires further analysis to determine the effect on later passes.
|
||||
|
||||
// Don't try to optimize vector instructions or anything that doesn't have
|
||||
// unsafe algebra.
|
||||
if (I->getType()->isVectorTy() || !I->hasUnsafeAlgebra())
|
||||
|
||||
Reference in New Issue
Block a user