[PATCH] D46379: [ConstantFold] Turn off expression simplification for vector type

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 31 14:02:20 PDT 2018


spatel added a comment.

This is a constant folding change, so the test should be visible with just "opt -constprop ..."

Ie, the test should be minimized and moved under test/Analysis/ConstantFolding.

I don't know this code. Is the bug only related to GEP? But this patch also affects cast-of-cast when the outer/second cast is to a vector type? Eg, you don't want to inhibit this:

  define <4 x i16> @test_mmx_const() {
    %A = bitcast <2 x i32> zeroinitializer to x86_mmx
    %B = bitcast x86_mmx %A to <4 x i16>
    ret <4 x i16> %B
  }



  $ opt -constprop foo.ll -S
  define <4 x i16> @test_mmx_const() {
    ret <4 x i16> zeroinitializer
  }

(so there should be a negative test for that example in this patch)


Repository:
  rL LLVM

https://reviews.llvm.org/D46379





More information about the llvm-commits mailing list