Skip to content

Commit

Permalink
Use BitVector instead of int in R600 SIISelLowering.
Browse files Browse the repository at this point in the history
int may not have enough bits in it, which was detected by UBSan
bootstrap (it reported left shift by a too large constant).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216579 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
vonosmas committed Aug 27, 2014
1 parent 34806d2 commit e909464
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Target/R600/SIISelLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "SIInstrInfo.h"
#include "SIMachineFunctionInfo.h"
#include "SIRegisterInfo.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/CodeGen/CallingConvLower.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
Expand Down Expand Up @@ -411,7 +412,7 @@ SDValue SITargetLowering::LowerFormalArguments(
assert(CallConv == CallingConv::C);

SmallVector<ISD::InputArg, 16> Splits;
uint32_t Skipped = 0;
BitVector Skipped(Ins.size());

for (unsigned i = 0, e = Ins.size(), PSInputNum = 0; i != e; ++i) {
const ISD::InputArg &Arg = Ins[i];
Expand All @@ -424,7 +425,7 @@ SDValue SITargetLowering::LowerFormalArguments(

if (!Arg.Used) {
// We can savely skip PS inputs
Skipped |= 1 << i;
Skipped.set(i);
++PSInputNum;
continue;
}
Expand Down Expand Up @@ -488,7 +489,7 @@ SDValue SITargetLowering::LowerFormalArguments(
for (unsigned i = 0, e = Ins.size(), ArgIdx = 0; i != e; ++i) {

const ISD::InputArg &Arg = Ins[i];
if (Skipped & (1 << i)) {
if (Skipped[i]) {
InVals.push_back(DAG.getUNDEF(Arg.VT));
continue;
}
Expand Down

0 comments on commit e909464

Please sign in to comment.