radeon/llvm: Fix segfault while lowering lrp intrinsic
authorTom Stellard <thomas.stellard@amd.com>
Fri, 18 May 2012 00:39:54 +0000 (20:39 -0400)
committerTom Stellard <thomas.stellard@amd.com>
Fri, 18 May 2012 00:42:16 +0000 (20:42 -0400)
src/gallium/drivers/radeon/AMDGPUISelLowering.cpp

index b447e67bd8a5d94a76309a2501bec1ce78887729..8df80352085fe8d1e0f0ea121dc17a7ecfe615a0 100644 (file)
@@ -91,8 +91,9 @@ SDValue AMDGPUTargetLowering::LowerIntrinsicLRP(SDValue Op,
 {
   DebugLoc DL = Op.getDebugLoc();
   EVT VT = Op.getValueType();
-  SDValue OneSubA = DAG.getNode(ISD::FSUB, DL, VT, DAG.getConstant(1, VT),
-                                                   Op.getOperand(1));
+  SDValue OneSubA = DAG.getNode(ISD::FSUB, DL, VT,
+                                DAG.getConstantFP(1.0f, MVT::f32),
+                                Op.getOperand(1));
   SDValue OneSubAC = DAG.getNode(ISD::FMUL, DL, VT, OneSubA,
                                                     Op.getOperand(3));
   return DAG.getNode(AMDILISD::MAD, DL, VT, Op.getOperand(1),