[PATCH] D115460: Add FMF to hasPoisonGeneratingFlags/dropPoisonGeneratingFlags

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 13 13:35:33 PST 2021


spatel added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/shuffle_select-inseltpoison.ll:779
 
 define <4 x double> @fdiv_fdiv(<4 x double> %v0) {
 ; CHECK-LABEL: @fdiv_fdiv(
----------------
reames wrote:
> spatel wrote:
> > I looked at the code for this and related transforms in "foldSelectShuffle", and it's a mess.
> > We have lots of miscompiles like this:
> > https://alive2.llvm.org/ce/z/MHoacO
> > ...and I don't think proposed but uncommitted patches like D93818 / D103874 resolve those. 
> > 
> > We probably need to add an identity shuffle with undef/poison elements preserved from the original code. Otherwise, we are potentially leaking poison from the variable value in the original code. This could take a few patches to fix, so I wouldn't hold this patch up for it (but I'll try to get that sorted out soon).
> I don't follow this comment at all, so if there's anything in here you want me to change, please rephrase.  
Sorry, that was confusing. There are problems with this set of transforms that are independent of this patch. The test changes here are minor, so I am not worried about them. Nothing for you to do in this patch.


================
Comment at: llvm/test/Transforms/PhaseOrdering/ARM/mve-floatreduce.ll:16
 ; CHECK-NEXT:    [[TMP4:%.*]] = bitcast <4 x i32> [[TMP3]] to <8 x half>
-; CHECK-NEXT:    [[TMP5:%.*]] = fadd fast <8 x half> [[TMP1]], [[TMP4]]
+; CHECK-NEXT:    [[TMP5:%.*]] = fadd reassoc nsz arcp contract afn <8 x half> [[TMP1]], [[TMP4]]
 ; CHECK-NEXT:    [[TMP6:%.*]] = extractelement <8 x half> [[TMP5]], i32 0
----------------
reames wrote:
> spatel wrote:
> > This diff should have disappeared with the rebase?
> This passed check-llvm after the rebase, and the CI build checks agree, so no.  
Hmm...if I apply this patch locally, this test fails for me...

```
; CHECK-NEXT: [[TMP5:%.*]] = fadd reassoc nsz arcp contract afn <8 x half> [[TMP1]], [[TMP4]]
              ^
<stdin>:13:41: note: scanning from here
 %4 = bitcast <4 x i32> %3 to <8 x half>
                                        ^
<stdin>:13:41: note: with "TMP1" equal to "%1"
 %4 = bitcast <4 x i32> %3 to <8 x half>
                                        ^
<stdin>:13:41: note: with "TMP4" equal to "%4"
 %4 = bitcast <4 x i32> %3 to <8 x half>
                                        ^
<stdin>:14:2: note: possible intended match here
 %5 = fadd fast <8 x half> %1, %4
 ^

Input file: <stdin>
Check file: /Users/spatel/GitHub/llvm-project/llvm/test/Transforms/PhaseOrdering/ARM/mve-floatreduce.ll

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           .
           .
           .
           8: entry: 
           9:  %0 = shufflevector <8 x half> %in, <8 x half> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6> 
          10:  %1 = fadd fast <8 x half> %0, %in 
          11:  %2 = bitcast <8 x half> %1 to <4 x i32> 
          12:  %3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> <i32 1, i32 undef, i32 3, i32 undef> 
          13:  %4 = bitcast <4 x i32> %3 to <8 x half> 
next:16'0                                             X error: no match found
next:16'1                                               with "TMP1" equal to "%1"
next:16'2                                               with "TMP4" equal to "%4"
          14:  %5 = fadd fast <8 x half> %1, %4 

```


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115460/new/

https://reviews.llvm.org/D115460



More information about the llvm-commits mailing list