Displaying 4 results from an estimated 4 matches for "m_or".
Did you mean:
m_o
2008 Nov 09
0
[LLVMdev] m_Not Pattern Question
..."B", which seems weird and
> wrong to me.
This is deliberate. m_Foo(V) means "match any Foo and put its result
into V." The way it's generally used is to declare empty variables,
match against them, and test the equality:
Value *A, *B, *C, *D;
if (match(Expr, m_Or(m_And(A, B), m_And(C, D))) {
if (B == D) {
... do optimization ...
Nick
> -bw
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
&g...
2008 Nov 09
2
[LLVMdev] m_Not Pattern Question
I have a question about the pattern matching stuff that's used in the
Instruction Combiner. If I have code like this:
if (match(B, m_Select(m_Value(), m_ConstantInt(0),
m_ConstantInt(-1)))) {
if (match(C, m_Not(m_Value(B))))
return SelectInst::Create(cast<User>(B)->getOperand(0), D, A);
and we match, the program fails during the
2010 Jan 05
0
[LLVMdev] [llvm-commits] [llvm] r92458 - in /llvm/trunk: lib/Target/README.txt lib/Transforms/Scalar/InstructionCombining.cpp test/Transforms/InstCombine/or.ll
...gt;> - V1 = 0; V2 = 0; V3 = 0;
>> +
>> + // ((V | N) & C1) | (V & C2) --> (V|N) & (C1|C2)
>> + // iff (C1&C2) == 0 and (N&~C1) == 0
>> + if ((C1->getValue() & C2->getValue()) == 0) {
>> + if (match(A, m_Or(m_Value(V1), m_Value(V2))) &&
>> + ((V1 == B && MaskedValueIsZero(V2, ~C1->getValue())) || // (V|N)
>> + (V2 == B && MaskedValueIsZero(V1, ~C1->getValue())))) // (N|V)
>> + return BinaryOperator::CreateAnd(A,
>>...
2005 Oct 05
1
[LLVMdev] Cast instructions
The following situation comes up a lot in what I'm doing. I want to
check if a value is a certain kind of instruction. The test also needs
to succeed if the value is a *cast* of the instruction (or a cast of a
cast, etc.) I.e., I need to "see through" any intervening casts to get
to the "real" value. It's trivial to write a function that does this,
but does