[llvm] [VectorCombine] Only copy IR flags for newly created instructions (PR #193271)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 22 11:46:22 PDT 2026
================
@@ -1282,6 +1286,72 @@ bool VectorCombine::scalarizeVPIntrinsic(Instruction &I) {
return true;
}
+Value *VectorCombine::createUnaryOp(Instruction::UnaryOps Opcode,
+ Value *Operand, Instruction &OldI) {
+ switch (Opcode) {
+ case Instruction::FNeg:
+ return Builder.CreateFNegFMF(Operand, &OldI,
+ OldI.getName() + ".scalar.fneg");
+ case Instruction::UnaryOpsEnd:
+ llvm_unreachable("Invalid unary opcode");
+ }
+ llvm_unreachable("Invalid unary opcode");
+}
+
+Value *VectorCombine::createBinaryOp(Instruction::BinaryOps Opcode, Value *LHS,
----------------
arsenm wrote:
Tests should cover all of these opcodes?
https://github.com/llvm/llvm-project/pull/193271
More information about the llvm-commits
mailing list