[PATCH] D40721: [InstSimplify] Run constant folding if no other simplifications were possible

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 4 09:09:02 PST 2017


spatel added a comment.

If you add the usual constant folding check to the top of SimplifyInsertElementInst(), the test in pr28725 will simplify to a constant expression:

define <2 x i16> @test1() {
entry:

  ret <2 x i16> <i16 extractvalue (%S select (i1 icmp eq (i16 extractelement (<2 x i16> bitcast (<1 x i32> <i32 1> to <2 x i16>), i32 0), i16 0), %S zeroinitializer, %S { i16 0, i32 1 }), 0), i16 0>

}

This should be fine. InstCombine will turn that into a '0' later.


https://reviews.llvm.org/D40721





More information about the llvm-commits mailing list