[llvm-dev] Binary instruction operand type - Fast-math-flags - Vectorized IR code

Simona Simona via llvm-dev llvm-dev at lists.llvm.org
Thu Mar 3 02:06:10 PST 2016


Hello,

I'm using LLVM 3.4 and noticed that some IR binary instructions have the
following format:
            <result> = frem [fast-math flags]* <ty> <op1>, <op2> ; yields
ty:result

I'm mainly interested in extracting the type of the operands, regardless of
whether the fast-math-flags is set or not.
In the case above, that would be floating-point or vector, because the
instruction is an frem.

Q1. I was just wondering if doing I.getOperand(0)->getType() would be
sufficient to extract the operands type.
I've tried it and I obtain neither a float, nor a vector type, but a
Token (TokenTyID).

Q2. Moreover, how can one extract the fast-math-flags?

Q3. I'd also appreciate it if someone could tell me what C/C++ source
code should I use to generate IR code that
includes binary operation(s) with vector operands. Alternatively, is
there maybe an optimization pass that vectorizes
the IR code?

Many thanks,
Simona
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160303/bb6c44f3/attachment.html>


More information about the llvm-dev mailing list