Currently I can use a BUILD_PAIR to make a pair of two arbitrary values
to a desired result value. For example, I can make i8,build_pair =
(i8, i8) or i16,build_pair = (i1, i8).
This is turning out to very handy when I replace nodes during the
expansion/legalization of types for my target.
I was just wondering if we could go one more step further and create a
BUILD_TRIPLET node which can contain three incoming operands instead of
just two. I know that I can do that with two build_pairs , but a
build_triplet will make my code cleaner and easy to follow.
- Sanjiv
Currently I can use a BUILD_PAIR to make a pair of two arbitrary values
to a desired result value. For example, I can make i8,build_pair =
(i8, i8) or i16,build_pair = (i1, i8).
I don't think those are legal; from SelectionDAGNodes.h:
// BUILD_PAIR - This is the opposite of EXTRACT_ELEMENT in some ways. Given
// two values of the same integer value type, this produces a value twice as
// big. Like EXTRACT_ELEMENT, this can only be used before legalization.
This is turning out to very handy when I replace nodes during the
expansion/legalization of types for my target.
I was just wondering if we could go one more step further and create a
BUILD_TRIPLET node which can contain three incoming operands instead of
just two. I know that I can do that with two build_pairs , but a
build_triplet will make my code cleaner and easy to follow.
Maybe MERGE_VALUES would be more suited to what you're doing?
-Eli
Currently I can use a BUILD_PAIR to make a pair of two arbitrary values
to a desired result value. For example, I can make i8,build_pair =
(i8, i8) or i16,build_pair = (i1, i8).
This is turning out to very handy when I replace nodes during the
expansion/legalization of types for my target.
I was just wondering if we could go one more step further and create a
BUILD_TRIPLET node which can contain three incoming operands instead of
just two. I know that I can do that with two build_pairs , but a
build_triplet will make my code cleaner and easy to follow.
We generally do not extend the IR just for convenience. Adding something like BUILD_TRIPLET is too arbitrary. It goes against the LLVM philosophy. Sorry.
Evan