LLVM: VectorSlice Class Reference (original) (raw)

Helper class for "break large PHIs" (visitPHINode).

This represents a slice of a PHI's incoming value, which is made up of:

Slice examples: <4 x i64> -> Split into four i64 slices. -> [i64, 0, 1], [i64, 1, 1], [i64, 2, 1], [i64, 3, 1] <5 x i16> -> Split into 2 <2 x i16> slices + a i16 tail. -> [<2 x i16>, 0, 2], [<2 x i16>, 2, 2], [i16, 4, 1]

Definition at line 1669 of file AMDGPUCodeGenPrepare.cpp.

Slice Inc according to the information contained within this slice.

This is cached, so if called multiple times for the same BB & Inc pair, it returns the same Sliced value as well.

Note this intentionally does not return the same value for, say, [bb.0, %0] & [bb.1, %0] as:

This is both a minor optimization to avoid creating duplicate instructions, but also a requirement for correctness. It is not forbidden for a PHI node to have the same [BB, Val] pair multiple times. If we returned a new value each time, those previously identical pairs would all have different incoming values (from the same block) and it'd cause a "PHI node has multiple entries for the same basic block with different incoming values!" verifier error.

Definition at line 1699 of file AMDGPUCodeGenPrepare.cpp.

References B(), llvm::dyn_cast(), llvm::BasicBlock::getTerminator(), Idx, and NumElts.