Displaying 20 results from an estimated 31 matches for "binaryops".
Did you mean:
binaryop
2012 Apr 19
2
[LLVMdev] Tablegen to match a literal in an instruction
I am trying to make some modifications to our code generator that will produce better code, but require adding new patterns.
What I am trying to do is take a register/register pattern and change it to a register/immediate.
So for example, I have this pattern:
class ILFormat<ILOpCode op, dag outs, dag ins, string asmstr, list<dag> pattern>
: Instruction {
let Namespace =
2012 Apr 19
3
[LLVMdev] Tablegen to match a literal in an instruction
I'm not at the machine that has the changes, but it was failing at index 0.
Micah
From: Owen Anderson [mailto:resistor at mac.com]
Sent: Thursday, April 19, 2012 3:35 PM
To: Villmow, Micah
Cc: LLVM Developers Mailing List
Subject: Re: [LLVMdev] Tablegen to match a literal in an instruction
Micah,
I don't see anything wrong with this offhand. Have you tried getting the debug output
2012 Apr 19
0
[LLVMdev] Tablegen to match a literal in an instruction
Micah,
I don't see anything wrong with this offhand. Have you tried getting the debug output from llc -debug, and matching it up with the state machine in your DAGISel.inc to see at what step the auto-generated matcher is failing to match your and-with-immediate?
-Owen
On Apr 19, 2012, at 3:07 PM, "Villmow, Micah" <Micah.Villmow at amd.com> wrote:
> I am trying to make
2012 Apr 19
0
[LLVMdev] Tablegen to match a literal in an instruction
Right, it's failing when it tries to materialize a move of a constant into a register. But it's only trying to do that because it previously failed to fold the constant into the AND. What you need to do is step through the path it takes when matching the AND node, and try to figure out why it ends up selecting the register-register version rather than the register-immediate version.
2017 Sep 13
2
How to add optimizations to InstCombine correctly?
Hi,
I am working on PR34474 and try to add a new optimization to
InstCombine. Like in other parts of the visitMul function I add a Shl
through the IR builder and create a new BinaryOp which I return from
visitMul. If I understand correctly the new BinaryOp returned from
visitMul should replace the original Instruction in the Worklist.
However, I end up in an infinite loop and the Instruction
2017 Sep 13
3
How to add optimizations to InstCombine correctly?
There is in fact a transform out there somewhere that reverses yours.
define i64 @foo(i64 %a) {
%b = shl i64 %a, 5
%c = add i64 %b, %a
ret i64 %c
}
becomes
define i64 @foo(i64 %a) {
%c = mul i64 %a, 33
ret i64 %c
}
~Craig
On Wed, Sep 13, 2017 at 10:11 AM, Craig Topper <craig.topper at gmail.com>
wrote:
> Your code seems fine. InstCombine can infinite loop if some other
2017 Sep 14
3
How to add optimizations to InstCombine correctly?
Hi Craig,
thanks for digging into this. So InstCombine is the wrong place for
fixing PR34474. Can you give me a hint where such an optimization should
go into CodeGen? I am not really familiar with stuff that happens after
the MidLevel.
Cheers,
Michael
Am 13.09.2017 um 19:21 schrieb Craig Topper:
> And that is less instructions. So from InstCombine's perspective the
> multiply is
2017 Sep 16
2
How to add optimizations to InstCombine correctly?
This conversation has (partially) moved on to D37896 now, but if possible I was hoping that we could perform this in DAGCombiner and remove the various target specific combines that we still have.
At least ARM/AARCH64 and X86 have cases that can hopefully be generalised and removed, but there will probably be a few legality/perf issues that will occur.
Simon.
> On 14 Sep 2017, at 06:23,
2009 Dec 10
2
[LLVMdev] SplitVecRes with SIGN_EXTEND_INREG unsupported
On Thu, Dec 10, 2009 at 12:46 PM, Villmow, Micah <Micah.Villmow at amd.com> wrote:
> Eli,
> I have a simple SplitVecRes function that implements what you mentioned, splitting the LHS just as in BinaryOp, but passing through the RHS. The problem is that the second operand is MVT::Other, but when casted to an VTSDNode reveals that it is a vector length of the same size as the LHS
2013 Nov 26
2
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...oo", functionType,
nullptr));
llvmFunction->setCallingConv(llvm::CallingConv::C);
llvm::BasicBlock * body = llvm::BasicBlock::Create(c, "__entry__",
llvmFunction);
llvm::IRBuilder <> builder(body);
llvm::Value * result =
builder.CreateBinOp(llvm::Instruction::BinaryOps::Add,
llvm::ConstantInt::getSigned(functionType, 40),
llvm::ConstantInt::getSigned(functionType, 2));
builder.CreateRet(result);
llvm::verifyModule(module, llvm::PrintMessageAction);
std::string errorInfo;
llvm::raw_fd_ostream fileStream("test.ll", errorInfo);
llvm:...
2008 Oct 08
3
[LLVMdev] Lost instcombine opportunity: "or"s of "icmp"s (commutability)
instcombine can handle certain orders of "icmp"s that are "or"ed together:
x != 5 OR x > 10 OR x == 8 becomes..
x != 5 OR x == 8 becomes..
x != 5
However, a different ordering prevents the simplification:
x == 8 OR x > 10 OR x != 5 becomes..
%or.eq8.gt10 OR x != 5
and that can't be simplified because we now have an "or" OR "icmp".
What would I
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
I am currently improving the D37896 to include the suggestions from
Chad. However, running the lit checks for the x86 backend I observe some
changes in the generated MC, e.g.:
llvm/test/CodeGen/X86/lea-3.ll:13:10: error: expected string not found
in input
; CHECK: leal ([[A0]],[[A0]],2), %eax
^
<stdin>:10:2: note: scanning from here
orq %rdi, %rax
^
<stdin>:10:2:
2005 Jan 27
1
[LLVMdev] Question about inserting IR code
...ddresult", BB);
By following this way, it works well when I insert some IR code whose operand is integer type like IntTy, however, when I tried to insert similar thing whose operands are float point, I got the following message when I run it
void llvm::BinaryOperator::init(llvm::Instruction::BinaryOps,
llvm::Value*, llvm::Value*): Assertion `getType()->isIntegral() && "Tried
to create an logical operation on a non-integral type!"' failed.
It seems that I cannot insert float point type operand by this way, right? If so, is there any way I can insert IR code whose operand...
2017 Jul 24
2
LazyValueInfo vs ScalarEvolution
On Mon, Jul 24, 2017 at 2:29 PM, John Regehr via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> On 7/24/17 3:16 PM, Hongbin Zheng via llvm-dev wrote:
>
>> Thanks, maybe we could use ScalarEvolution in LazyValueInfo if it is
>> available?
>>
>
> This should be fairly easy to try, if you want to propose a patch and run
> some experiments. The question is
2009 Dec 10
0
[LLVMdev] SplitVecRes with SIGN_EXTEND_INREG unsupported
Eli,
I don't see how this helps with the splitting of the Other node as it isn't the Dest that is the problem, but the second source value. Any place in the code that I can look at on how to split a VTSDNode?
Thanks,
Micah
> -----Original Message-----
> From: Eli Friedman [mailto:eli.friedman at gmail.com]
> Sent: Thursday, December 10, 2009 1:25 PM
> To: Villmow, Micah
2008 Oct 08
0
[LLVMdev] [PATCH] Lost instcombine opportunity: "or"s of "icmp"s (commutability)
Here's an initial stab, but I'm not too happy about the temporarily
adding new instructions then removing it because returning it will
have it added back in to replace other uses. I also added a couple
test cases pass with the new InstructionCombining changes (the old
code only passes one of the added tests).
Also, this change exposes some simplification for
2009 Dec 10
0
[LLVMdev] SplitVecRes with SIGN_EXTEND_INREG unsupported
Eli,
I have a simple SplitVecRes function that implements what you mentioned, splitting the LHS just as in BinaryOp, but passing through the RHS. The problem is that the second operand is MVT::Other, but when casted to an VTSDNode reveals that it is a vector length of the same size as the LHS SDValue. This causes a split on the LHS side to work correctly, but then it fails instruction selection
2017 Sep 19
0
How to add optimizations to InstCombine correctly?
Hi Sanjay,
thanks for enlighten me on terms of tests. I assume I have to run the test-suite benchmarks to check for regressions? Is there a guide to get the metrics from the benchmarks?
Cheers,
Michael
BTW the beginner tag for bugs was really a good idea to get started with contributing to llvm.
On Tue, Sep 19, 2017 at 3:58 PM +0200, "Sanjay Patel" <spatel at
2013 Nov 28
0
[LLVMdev] Disabling optimizations when using llvm::createPrintModulePass
...llptr));
> llvmFunction->setCallingConv(llvm::CallingConv::C);
> llvm::BasicBlock * body = llvm::BasicBlock::Create(c, "__entry__",
> llvmFunction);
> llvm::IRBuilder <> builder(body);
> llvm::Value * result =
> builder.CreateBinOp(llvm::Instruction::BinaryOps::Add,
> llvm::ConstantInt::getSigned(functionType, 40),
> llvm::ConstantInt::getSigned(functionType, 2));
> builder.CreateRet(result);
>
> llvm::verifyModule(module, llvm::PrintMessageAction);
>
> std::string errorInfo;
> llvm::raw_fd_ostream fileStream("t...
2011 Dec 06
1
[LLVMdev] Problem with IR code instruction
...cation.so -substitution src/ciphers/aes/aes_enc.bc -o src/ciphers/aes/aes_enc.bc -stats
0 opt 0x00000000007f8faf
1 opt 0x00000000007f9419
2 libpthread.so.0 0x00007f2e08fb07e0
3 opt 0x000000000078da7c llvm::BinaryOperator::Create(llvm::Instruction::BinaryOps, llvm::Value*, llvm::Value*, llvm::Twine const&, llvm::Instruction*) + 44
4 LLVMobfuscation.so 0x00007f2e093d7de9
5 opt 0x00000000007a483a llvm::FPPassManager::runOnFunction(llvm::Function&) + 346
6 opt 0x00000000007a4aeb llvm::FPPassManager::runOnModule(llv...