SuccessChanges

Summary

  1. [SelectionDAG] Always intersect SDNode flags during getNode() node memoization. (details)
  2. [InstCombine] Test abs with dominating condition (NFC) (details)
Commit 714ceefad9b96ab3ef20913f2110883a1ad34a13 by paulsson
[SelectionDAG] Always intersect SDNode flags during getNode() node memoization.

Previously SDNodeFlags::instersectWith(Flags) would do nothing if Flags was
in an undefined state, which is very bad given that this is the default when
getNode() is called without passing an explicit SDNodeFlags argument.

This meant that if an already existing and reused node had a flag which the
second caller to getNode() did not set, that flag would remain uncleared.

This was exposed by https://bugs.llvm.org/show_bug.cgi?id=47092, where an NSW
flag was incorrectly set on an add instruction (which did in fact overflow in
one of the two original contexts), so when SystemZElimCompare removed the
compare with 0 trusting that flag, wrong-code resulted.

There is more that needs to be done in this area as discussed here:

Differential Revision: https://reviews.llvm.org/D86871

Review: Ulrich Weigand, Sanjay Patel
The file was addedllvm/test/CodeGen/SystemZ/fp-mul-14.ll
The file was modifiedllvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp (diff)
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp (diff)
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUISelLowering.h (diff)
The file was modifiedllvm/include/llvm/CodeGen/SelectionDAGNodes.h (diff)
The file was addedllvm/test/CodeGen/SystemZ/int-cmp-60.ll
Commit d401e376e464b97cabde1fa9c675630e7f275a1c by nikita.ppv
[InstCombine] Test abs with dominating condition (NFC)
The file was modifiedllvm/test/Transforms/InstCombine/abs-intrinsic.ll (diff)