This patch includes two changes I'm not entirely certain of.

First, in PatternMatch.h, the m_Neg matcher is incorrect for VP vectors. It matches sub <+0.0, +0.0, ...>, %x but the correct pattern is sub <-0.0, -0.0, ...>, %x. Since this matcher is dead, I simply commented it out with a note that it was broken. It would be simple to delete or fix it instead. (In fact, patch 4 includes just such a fix.)

Second, in GlobalOpt.cpp, the ShrinkGlobalToBoolean transformation excludes FP, but allows vectors. It doesn't explain why. FP exclusion was added last November to fix a crash, it looks like. I made it exclude vectors, too, but there's no overwhelming reason why.

In addition to these, in LowerSelect.cpp:

bool LowerSelect::runOnFunction(Function &F) {
  bool Changed = false;
  for (Function::iterator BB = F.begin(), E = F.end(); BB != E; ++BB)
    for (BasicBlock::iterator I = BB->begin(), E = BB->end(); I != E; ++I) {
      if (SelectInst *SI = dyn_cast<SelectInst>(I))
        if (!OnlyFP || SI->getType()->isFloatingPoint()) {
          // Split this basic block in half right before the select instruction.

This pass is dead except for opt -lowerselect, so there's no client to say which (isFloatingPoint or isFPOrFPVector) is the correct behavior for the OnlyFP option. The pass could be deleted, the OnlyFP option deleted, the test switched to !OnlyFP || SI->getType()->isFPOrFPVector(), or the pass extended to lower any combination of FP and integer scalars and vectors. Or, of course, it could be left alone!

— Gordon


Attachment: pr970-3.patch
Description: Binary data


_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to