Skip to content

Commit 62581b8

Browse files
committed
Explain promoted extraction for simd shuffle
1 parent de51143 commit 62581b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_codegen_llvm/mir/block.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,9 @@ impl<'a, 'tcx> FunctionCx<'a, 'tcx> {
507507
// promotes any complex rvalues to constants.
508508
if i == 2 && intrinsic.unwrap().starts_with("simd_shuffle") {
509509
match *arg {
510+
// The shuffle array argument is usually not an explicit constant,
511+
// but specified directly in the code. This means it gets promoted
512+
// and we can then extract the value by evaluating the promoted.
510513
mir::Operand::Copy(mir::Place::Promoted(box(index, ty))) |
511514
mir::Operand::Move(mir::Place::Promoted(box(index, ty))) => {
512515
let param_env = ty::ParamEnv::reveal_all();

0 commit comments

Comments
 (0)