[llvm] r342851 - [DAGCombiner] Clarify a comment. NFC
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 23 14:17:56 PDT 2018
Author: ctopper
Date: Sun Sep 23 14:17:56 2018
New Revision: 342851
URL: http://llvm.org/viewvc/llvm-project?rev=342851&view=rev
Log:
[DAGCombiner] Clarify a comment. NFC
This comment was misleading about why we were restricting to before legalize types. The reason given would only apply to before legalize ops. But there is a before legalize types reason that should also be listed.
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=342851&r1=342850&r2=342851&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Sun Sep 23 14:17:56 2018
@@ -9843,8 +9843,10 @@ SDValue DAGCombiner::visitBITCAST(SDNode
return DAG.getUNDEF(VT);
// If the input is a BUILD_VECTOR with all constant elements, fold this now.
- // Only do this before legalize, since afterward the target may be depending
- // on the bitconvert.
+ // Only do this before legalize types, since we might create an illegal
+ // scalar type. Even if we knew we wouldn't create an illegal scalar type
+ // we can only do this before legalize ops, since the target maybe
+ // depending on the bitcast.
// First check to see if this is all constant.
if (!LegalTypes &&
N0.getOpcode() == ISD::BUILD_VECTOR && N0.getNode()->hasOneUse() &&
More information about the llvm-commits
mailing list