forked from OSchip/llvm-project
Easy IRgen improvement for bitfields, don't emit x >> 0.
- Logic such as this quite possibly should be optional builder behavior. llvm-svn: 59213
This commit is contained in:
parent
8553a98b8e
commit
f7fb75044f
|
@ -214,8 +214,9 @@ RValue CodeGenFunction::EmitLoadOfBitfieldLValue(LValue LV,
|
|||
llvm::Value *Val = Builder.CreateLoad(Ptr, LV.isVolatileQualified(), "tmp");
|
||||
|
||||
// Shift to proper location.
|
||||
Val = Builder.CreateLShr(Val, llvm::ConstantInt::get(EltTy, StartBit),
|
||||
"bf.lo");
|
||||
if (StartBit)
|
||||
Val = Builder.CreateLShr(Val, llvm::ConstantInt::get(EltTy, StartBit),
|
||||
"bf.lo");
|
||||
|
||||
// Mask off unused bits.
|
||||
llvm::Constant *LowMask =
|
||||
|
|
Loading…
Reference in New Issue